1

enter image description here

From my understanding by Googling the 403 error means the API key is right but access is forbidden? But I'm not really 100% sure what that means or how to resolve it.

Below is my code that triggers when I press a button (I've manually added the contact data for testing).

Any help is greatly appreciated.

My code:

$.ajax({
      async: true,
      crossDomain: true,
      url: 'https://myactivehost.api-us1.com/api/3/contacts',
      method: 'POST',
      headers: {
        accept: 'application/json',
        'content-type': 'application/json',
        'Api-Token': 'myAPIkey'
      },
      processData: false,
      data: '{"contact":{"email":"npm.jake@gmail.com"}}',
      success: function() {
        console.log('success');
      },
      error: function() {
       console.log('failed'); 
      }
    });
Jacob Johnson
  • 551
  • 1
  • 6
  • 20

0 Answers0