Update contact API returns 400 bad request

Highlighted
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
Highlighted
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
Developer Portal

View API documentation, code samples, get your API key.

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured