Using jQuery to interact with API

I'm relatively new to Campaign Monitor. Signed up my first client through the white label service just today in fact. Now they're interested in taking the reports a set further. They'd like to have the reports viewable on their own domain.

I've been trying to use the jQuery method .ajax but so far it's been unsuccessful. Is it possible to access the report api via jQuery? If yes, why isn't my code below working. It just fails silently, not event the error callback shows up...

  url: '',
  dataType: 'jsonp',
  dataFilter: function(data, type){
         alert("data is: " + data);
  success: function(data) {
    alert('Load was performed.');
  error: function(xht, type, details){
      alert('error ' + details);
  complete: function(xht, textStatus){

The %3 at the end is suppose to be two curly closing br

jjosephs, 6 years ago

The %3 at the end is suppose to be two curly closing braces followed by a closing parentheses and a semi-colon. Forum kept stripping it out for som strange reason.

jamesd jamesd, 6 years ago

Hey there,

We actually don't support responses using JSONP, which it appears you are trying to use to get around the same origin policy.

We deliberately chose not to support JSONP. The simple reason for this is that we do not have any "public" API methods available which do not require an API key to be used, and we didn't want to encourage people to start writing JavaScript which included their API in clear text.

In your case, you probably want to make your calls to the Campaign Monitor API on your server, rather than directly from the browser.

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