API c# development

Hi, I was wondering could anyone point me in the direction of some c# examples>
thanks,
Luke

Dave Dave, 7 years ago

Luke, hang tight, we'll be releasing an updated wrapper in C# on the site in the next few days. Keep an eye on the blog for the announcement.

Xtian, 7 years ago

Here is what I did to add WS to my C# project in Visual Studio (should work with express version as well) - also be aware that I am not a hardcore c# developer, I mostly work with flash and AS3, so other devs may have a better solution :)

Open your Asp.net website and right click on the project name and select "Add web reference"

Enter "http://api.createsend.com/api/api.asmx" where it asks for the URL, click "GO".

The api should get returned. At this point, you may want to give a new "Web Reference Name" in the box on the right. I named mine "CampaignMonitorWS". Click "Add Reference".

Now created a new page with code-behind and go into the CS file that was generated.

At the top of the page add your web reference like so:
Using CampaignMonitorWS;

Now pretty much anywhere in the code you can create a new reference object to the API, like this:

CampaignMonitorWS.api ws = new CampaignMonitorWS.api();

Once that is in, make a call to any of the methods:

try
        {
            ws.AddSubscriber([YOUR_API_KEY], [YOUR_LIST_ID], [VALID_EMAIL_ADDRESS], [NAME_OF_SUBSCRIBER]);
        }
        catch (Expression ex)
        {
            Response.write(ex.Message)
        }

Hope that helps!

-Xtian

Dave Dave, 7 years ago

Luke, it took a little longer to get it out the door, but you'll be pleased to know our .NET wrapper has just been re-released and is available for download.

Enjoy.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098