campaignmonitor/createsend-dotnet

Campaign.SendPreview is returning a 102: Invalid ClientID error

Closed this issue · 3 comments

After creating a campaign (successfully) on CM using the API (with ApiAuthentication), calling the SendPreview method fails with this error

The CreateSend API responded with the following error - 102: Invalid ClientID

The code being called is

Campaign c = new Campaign(campaignid);
c.SendPreview(emailAddresses, "Fallback");

This calls into the correct method, by the looks of it

https://api.createsend.com/api/v3/campaigns/{campaignid}/sendpreview.json
{
"PreviewRecipients": ["test1@example.com", "test2@example.com"],
"Personalize": "Random"
}

It shouldn't need a client ID, as the campaign ID is set.

Help please??

Ah hold on, it would appear that the new version of the wrapper requires there to be an auth passed in to get the campaign. I'll try that.

Ok, using the latest wrapper, now calling

var c = new Campaign(ApiAuth, campaignid);
c.SendPreview(emailAddresses, "Fallback");

Where

ApiAuth = new ApiKeyAuthenticationDetails(ApiKey);

and still getting

The CreateSend API responded with the following error - 102: Invalid ClientID

Any ideas please?

Bug on my side - the campaign ID wasn't being set. Sorry!