Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
Error in activecampaign api while creating or updating contact

I am trying to create a contact using "create or update api" from here: https://developers.activecampaign.com/reference#create-or-update-contact-new

I tried calling the cURL command which gives a proper response but while doing it from axios it gives error.

API: https://deskera4783.api-us1.com/api/3/contact/sync Method: POST

Code:

var axios = require("axios");
var data = ({
  contact: {
    email: "jondoe@example.com",
    firstName: "John",
    lastName: "Doe",
    phone: "7223224241",
    fieldValues: [
      { field: "1", value: "The Value for First Field" },
      { field: "6", value: "2008-01-20" },
    ],
  },
});


var config = {
  method: "post",
  url: "https://deskera4783.api-us1.com/api/3/contact/sync",
  headers: {
    "Api-Token":
      "XXX",
    "Content-Type": "application/json",
    Cookie:
      "cmp800513081=0c7070adc5cdc923a8922c47e98dbe77; PHPSESSID=d3e534f9b1a3f61316cd2cf89b41f164; em_acp_globalauth_cookie=caea42ae-d440-4491-9c08-d920b3378638",
  },
  data,
};

axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });

Also, in the network tab request params are not seen neither the response is received. Console error is: enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!