ActiveCampaign / activecampaign-api-nodejs

Node.js wrapper for the ActiveCampaign API
MIT License
39 stars 36 forks source link

I get an XML error telling me I am not authorized #42

Closed mtimofiiv closed 6 years ago

mtimofiiv commented 7 years ago

I am attempting to do contact/sync.

try {
  const data = {
    email: form_data.email,
    ip4: ctx.request.ip,
    form: form_id,
    api_output: 'json'
    // some more fields...
  }
  // In my app, the ctx.acApi is equal to ActiveCampaign.api
  const acRequest = await ctx.acApi(`contact/sync`, data)
  // do some things with response, irrelevant to this issue
} catch (error) {
  console.error(error)
}

And as a response I get (in XML, I might add, not in the requested JSON format):

<?xml version='1.0' encoding='utf-8'?>
<root><error>You are not authorized to access this file</error></root>

Earlier in the app (when it boots) I run this:

const authCheck = await ctx.acApi.credentials_test() // this has a success: true

Could you tell me what is going wrong here?

mtimofiiv commented 6 years ago

Could someone from ActiveCampaign get back to me please?

cristiangrama commented 6 years ago

I don't see any issues here. Can you please check again?