Account API is giving 403

let url = ‘https://XXX.api-us1.com/api/3/accounts’;

fetch(url, {

  method: 'POST',

  mode: "no-cors",

  headers: {

    accept: '*/*',

    'content-type': 'application/json',

    'Api-Token': 'XXX'

  },

  body: JSON.stringify({ account: formObj })

}

)

  .then(response => response.json())

  .then(response => console.log(response, 'RES BY CAMP'))

  .catch(err => console.error(err, 'ERR RES BY CAMP'));

api returning 403 please help me on this

1 Like

Hello,

For security reasons you can’t access the APIs via Javascript in the browser. You will need to use a backend server or middle-ware to access the APIs.

Thank you,
-Matt

Thank you Matt for your help.