Contact_edit and contact_add api gives no response about format of data posted error

Hello All,

I am using contact_add api to create a contact in the active campaign account.I am following the same as mentioned in below link.

I tried posting data as below

req.setBody(‘first_name=a&last_name=b&email=abc@gmail.com&p[0]=0&api_key=******’);
as Content-Type: application/x-www-form-urlencoded is supported.
but not getting any post error message from server.
I am getting status code 200.

I also tried to post data in JSON but didn’t get any error message only status code response 200.

If I am passing all the required field in the body then why I am not getting 201 response code?

1 Like

Hey @naturalpetfoodwareho,

I generally recommending testing with a tool like Postman. If you are getting a 200 then it sounds like it should be working. Did you confirm in the UI that the contact is not actually being added?

Here is the postman collection, you will need to update the “Environment” with your api key and url - https://www.getpostman.com/collections/76b895a39dc6f7997fa2

Also, you might want to check out the contact_sync endpoint as well, it is very similar to contact_add but it will update an existing contact if it exists.

2 Likes

Hi @jskole,

Thanks for the response.

I was able to post and edit contact but by hardcoding every required field in the body because I was finding difficulty implementing List field which is p[123]=123;
Could you please tell me more about this required field?
and another question is: how I can map field like if there is a field name: “Contact Detail” in AC and we need to map it to Contact_Detail__c. Is there any concept of api name also in AC?