Hi,
I'm attempting to add (Post) a new contact and receiving a 400 - Bad Request Error.
Dim request = New RestRequest(Method.POST)
request.AddHeader("content-type", "application/json")
request.AddHeader("cache-control", "no-cache")
request.AddHeader("accept", "application/json")
request.AddHeader("scope", "contact_data")
request.AddHeader("authorization", strToken)
request.AddParameter("application/json", strBody, ParameterType.RequestBody)
Here is the JSON body:
{""email_address"":{""address"":""karen-wilson@mpsi20.org"",""permission_to_send"":""implicit""},""company_name"":""MPS Muskogee High School"",""first_name"":""Karen"",""last_name"":""Wilson"",""create_source"":""Account"",""update_source"":""Account"",""list_memberships"":[""0882b6be-6bd4-11eb-91bb-fa163e6eddcc""]}"
(Please ignore the double-quotes as that is how it's displayed in Visual Studio)
I'm sending this on behalf of a Constant Contact customer who is receiving this error message. I'm able to create Contacts in other CC environments but there is something preventing me from doing so for this specific customer. I don't see anything wrong. I have a valid Connection (I can download lists, list members, etc.) The email address is valid. The List ID is valid.
I am able to update lists for existing Contacts. Just can't seem to add new ones.
Please let me know if you require additional information.
Thanks,
Chris
Hello Chris,
Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.
It looks like your request was formatted correctly, but the list that you are trying to post to (based on the example you provided) has been deleted, which is most likely what caused the 400 response.
Please have a look and let us know if you have any other questions!
Support Tips
"There's a multitude of ways to engage your audience through us using your social platforms - via ads, social post metrics, email links, and more! " - Will
See ArticleSupport Tips
"Target your most engaged contacts by creating a segment. Create a special offer or show your appreciation!" - Caitlin
See ArticleSupport Tips
"Greet new contacts with one or more automated Welcome Emails depending on their interests or your business goals." - Nick
See Article