I feel like a complete noob

I can view the json directly from an url like
http://api.createsend.com/api/v3/clients/<CLIENTID>/campaigns.json
But I cannot parse it using jquery with a script such as

$.getJSON(url,function(json){
            $.each(json.results,function(i,sb){
               $("#results").append('<p>'+sb.Subject+'</p>');
            });
        });

Any help, anyone? I suppose I need to authenticate first, but how...
This is based on http://webhole.net/2009/11/28/how-to-read-json-with-javascript/ - and it works nicely using a Twitter url without authentication required.

jamesd jamesd, 5 years ago

Firstly, all API calls require authentication using your Campaign Monitor API key.

It is possible to pass credentials for HTTP basic authentication using jQuery.ajax(), however this is very insecure, as you would need to have your Campaign Monitor API key accessible in your JavaScript, which I would definitely not recommend doing.

This security issue is also the reason we do not currently support jsonp in the API, as we do not want to encourage people to make calls to the API, with their API keys available for all to read. You are much better off making calls to the API on the server side.

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