API SOAP Exception

I've been trying to create a new template using CampaignMonitorAPIWrapper.Template.Create call. The API called seemed to be working I was getting the following error.
Return Message : Invalid HTML Page URL

This was correct as the URL was locked down to specific IP ranges. I opened up the page to the IP's on your white list http://help.campaignmonitor.com/topic.aspx?t=77

I am now getting this error( SOAP Exception):

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: Sorry, but we've run into a problem. Please try again or contact support\n   at Pronto.API.ExceptionHandlers.TryThis[T](WebService service, Func`1 body)\n   at Pronto.api.api.CreateTemplate(String ApiKey, String ClientID, String TemplateName, String HTMLPageURL, String ZipFileURL, String ScreenshotURL)\

I'm using the .net library.

Can you shed some light on this?
Many thanks

tobystokes, 7 years ago

Hi,

I've found the problem. I was passing null for the zip file and screenshot when I should have been passing an empty string. e.g.

var templateID = CampaignMonitorAPIWrapper.Template.Create(APIKey, ClientID, "Test template 2", "http://example.com/SimpleTest/Render/", string.Empty, string.Empty);

instead of

var templateID = CampaignMonitorAPIWrapper.Template.Create(APIKey, ClientID, "Test template 2","http://example.com/SimpleTest/Render/", null, null);

Cheers

See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free