Enter the Share Your Success Sweepstakes 2024 For the Chance to Win Great Prizes!

Get 404 Error when trying to update a contact

MikeK7170
Campaign Collaborator
0 Votes

I have tried to resolve using Postman and get same issue. For the POST I am using a URL of (I x'd out some of the real id):

 

https://api.cc.email/v3/contacts/8dxxxb22-xxxx-xxxx-xxxx-fa163xxxxefc

 

With that URL I am posting a Body in raw JSON. And in the header a Bearer Token. I know am passing an up to date token. because I did a GET and was able to retrieve the contact using the same URL (above) and it gave me the information I expected. I have tried using both Basic Auth and Bearer token. I would assume it is a Bearer Token.

 

I cannot figure out what I am missing here. I have tested the JSON I am trying to pass in the developer form, it works as expected - besides this error is saying it cannot find the resource. The only thing that seems to be at issue is that I am doing a POST rather than a GET, but that is what the documentation says, and also I have to push a BODY with this so can't really use a GET. Any ideas??? I am stumped, this should work.

 

Postman shows the following as the result - essentially a 404

[
    {
        "error_key""not_found",
        "error_message""The requested resource was not found."
    }
]
 
 
4 REPLIES 4
MikeK7170
Campaign Collaborator
0 Votes

I should have mentioned. I am attempting this via the API. I use JAVA in development, but issue still exists using Postman.

John__B
Employee
0 Votes

Hello Mike,

 

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.

 

The reason you are getting a 404 response on the update a contact request is because this should be a PUT request for updating an existing contact, rather than a POST request which would typically be used for creating a new contact. Below I am including a link to the reference documentation for this particular request:

 https://developer.constantcontact.com/api_reference/index.html#!/Contacts/putContact

 

Please have a look and let us know if you have any other questions!

 

Regards,


John B.
API Support Specialist
Did I answer your question? If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
MikeK7170
Campaign Collaborator
0 Votes

Hi John, thanks. I did figure it out a little while after the post I made. I guess I should not be developing after midnight, I know I read that stuff at least 10 times but it did not process that it was a PUT not a POST for some reason. Once I realized it, I tried in Postman and it worked, so I changed my Java code and it worked. I think it was the error that wasn't really helping me realize the issue - though I do realize why the error I got is the one the API sends, it was just not dawning on me.

 

Sorry to have bothered with such a simple one.

 

John__B
Employee
0 Votes

Hello Mike,

 

I'm glad to hear that the update a contact request is working for you now. 

 

Feel free to reach out with any additional questions!

 

Regards,


John B.
API Support Specialist
Did I answer your question? If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up