HTTP/1.1 405 Method Not Allowed

SOLVED
Highlighted
Occasional Contributor

HTTP/1.1 405 Method Not Allowed

Hello

 

I send the Modify a contact with a specific Contact ID API v2 endpoints. It works. I am able to modify the contact. Specifically I am adding a campaign to the list in the contact. After I modify the list with the API I can see the contact changing.

 

Now I want to use the API from my web site. So, I try and copy and paste everything possible and try and execute it. I have successfully executed an API to add a new contact.

 

The URL for the add contact is https://api.constantcontact.com/v2/contacts?action_by=ACTION_BY_VISITOR&api_key=$apiKey.

This is the working API.

 

The URL for the Modify a contact with a specific Contact ID is https://api.constantcontact.com/v2/contacts/$contactId?action_by=ACTION_BY_OWNER&api_key=$apiKey

is the URL where it doesn't.

 

I use a php/curl program in my web site. I traced the curl execution. That is where the HTTP/1.1 405 Method Not Allowed was discovered. What I think after the reading the curl trace is that data is sent to Constant Contact. The trace shows 1381 bytes received at Constant Contact. Then the Curl trace shows We are completely uploaded and fine assuming that the 1381 bytes is ok. I think Constant Contact got the data and didn't like it. Any ideas, seen this before?

 

I sent the actual API's and trace data to Webservices.

1 ACCEPTED SOLUTION

Accepted Solutions
Occasional Contributor

Re: HTTP/1.1 405 Method Not Allowed

Thanks, all fixed.

View solution in original post

2 REPLIES 2
Highlighted
Moderator

Re: HTTP/1.1 405 Method Not Allowed

Hi @LarryV375,

 

I reviewed the files sent and it appears you are trying to do a POST to the endpoint /v2/contacts/{contactID} and this endpoint should be a PUT instead.


Regards,
Jimmy D.
Tier II API Support Engineer
Occasional Contributor

Re: HTTP/1.1 405 Method Not Allowed

Thanks, all fixed.

View solution in original post

Developer Portal

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

Visit Page

Register for our "Making Sense of Online Marketing for Retail" Webinar

Aug 13 retail why ctct banner.png

Join us on Thursday, August 13th at 2pm ET for a free webinar where we'll discuss how to incorporate online marketing into your retail store.

 

Online marketing presents opportunities for retail stores to get found, get more sales, and ultimately grow the business.

 

If you’re just getting started with online marketing or not seeing the results you’ve hoped for then this session is for you. With our guest expert, Bryan Caplan, you’ll learn a smarter, more practical approach to getting the word out about your retail store. From making sure your business is found to keeping it top of mind, find out how to get the word out to the people who matter most online.

 

Read More
Featured