This sample application goes through the basic workflow of sending an email through the API using C# and .NET. It implements the following functionalities:
While the only necessary change is adding your account credentials to the code, we recommend also updating the contact information on lines 80-90 so that you actually receive the launched message.
The provided sample code was developed using Visual Studio Express 2010 on a Windows 7 computer. The sample was built using the Partner API WSDL, but it also works fine for those using the Enterprise API. If you are using the Enterprise API, keep in mind that there are some methods that aren't available without a Partner account (for example, sub-account creation and management). Check out the API documentation at http://developers.verticalresponse.com if there's any confusion; the Partner-only methods are flagged as such in the documentation.
If you are using the VerticalResponse Partner API (i.e. to access subaccounts and other features) you should have been given a certificate file that ends with a .p12 extension. Before you can perform any partner-specific functions, you will need to install that certificate on your machine.
Click on the .p12 file certificate file provided by Vertical Response.
Click "Next" on the first screen
The p12 file path should already be provided. If not, browse to it. Click Next.
Enter the certificate passphrase provided by Vertical Response.
Select "Place all certificates in the following store". Then click on Browse.
Check "Show Physical Stores" and select "Local Computer" under "Trusted Root Certification Authorities". Click "Okay".
Click "Finish" on the final screen.
In order for the code to find your partner client certificates, you'll need to update the app.config file in the solution browser.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="VRAPIBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="Certificate" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
<client>
<endpoint address="https://api.verticalresponse.com/1.0/VRAPI"
binding="basicHttpBinding" bindingConfiguration="VRAPIBinding"
contract="VRAPI.VRAPIPortType" name="VRAPIPort" behaviorConfiguration="clientEndpointCredential" />
</client>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="clientEndpointCredential">
<clientCredentials>
<clientCertificate findValue="api-services@verticalresponse.com" storeName="Root" storeLocation="LocalMachine" x509FindType="FindByIssuerName"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>