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
I am attempting to do
contact/sync
.And as a response I get (in XML, I might add, not in the requested JSON format):
Earlier in the app (when it boots) I run this:
Could you tell me what is going wrong here?