cancel
Showing results for 
Search instead for 
Did you mean: 
Tonight from 11:00 PM - 12:00 AM ET we need to make a few updates to our site.
We recommend finishing up your work before 11:00 PM and logging in after 12:00 AM.
Thank you for your patience while we make these important updates.

Update contact API returns 400 bad request

Visitor

Update contact API returns 400 bad request

Hi,

 

I am getting "400 Bad Request" error when testing update contact API on https://constantcontact.mashery.com

 

Here are the parameters

ContactID: 1076292947

Content-Type: application/json

action-by: ACTION_BY_OWNER

Request body

{
    "addresses": [],
    "cell_phone": "",
    "company_name": "",
    "created_date": "2019-06-11T19:53:28.000Z",
    "custom_fields": [],
    "email_addresses": [{
        "confirm_status": "NO_CONFIRMATION_REQUIRED",
        "email_address": "test@mail.com",
        "id": "94c6bf68-8c82-11e9-a7ac-d4ae52754db0",
        "opt_in_date": "2019-06-11T19:53:28.000Z",
        "opt_in_source": "ACTION_BY_VISITOR",
        "status": "REMOVED"
    }],
    "fax": "",
    "first_name": "John",
    "home_phone": "",
    "id": "1076292947",
    "job_title": "",
    "last_name": "Doe",
    "lists": [{
        "id": "1503197308",
        "status": "ACTIVE"
    }],
    "middle_name": "",
    "modified_date": "2019-06-12T15:01:48.000Z",
    "notes": [],
    "prefix_name": "",
    "source": "API",
    "source_details": "bfu test",
    "status": "REMOVED",
    "work_phone": ""
}
Tags (1)
1 REPLY 1
Moderator

Re: Update contact API returns 400 bad request

Hello @BoF04,

 

Thank you for reaching out to Constant Contact's API Support.

 

You have a line that shows as "id": "1076292947", which is causing the problem. When doing a PUT having the contactID in the request body is not required. While this matches the contactID and it should not be causing a problem it is. When I tested this I had to remove this line before your JSON worked.


Regards,
Jimmy D.
Tier II API Support Engineer