Adding a contact using REST returns 404 Not Found

SOLVED
Go to solution
Participant

Adding a contact using REST returns 404 Not Found

This is my first time working with Constant Contact REST.  

 

I replaced the access token and other account related info in this messages with --------

 

 

All I need to be able to do is add a new contact to a list. I'm sending the XML below to:

https://api.constantcontact.com/ws/customers/-------/contacts/?access_token=------------

 

        <entry xmlns="http://www.w3.org/2005/Atom">
            <title type="text"> </title>
            <updated>2012-08-15 15:47:39</updated>
            <author></author>
            <id>data:,none</id>
            <summary type="text">Contact</summary>
            <content type="application/vnd.ctct+xml">
                <Contact xmlns="http://ws.constantcontact.com/ns/1.0/">
                    <EmailAddress>----@-----.com</EmailAddress>
                    <FirstName>---</FirstName>
                    <LastName>---</LastName>
                    <OptInSource>ACTION_BY_CONTACT</OptInSource>
                    <ContactLists>
         <ContactList id="http://api.constantcontact.com/ws/customers/--------/lists/6" />
                    </ContactLists>
                </Contact>
            </content>
        </entry>

 

And I get this back

HTTP/1.1 404 Not Found
Connection: close
Content-Length: 20
Content-Type: text/plain
Date: Wed, 15 Aug 2012 21:47:40 GMT
Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate, no-cache="Set-Cookie"
Pragma: no-cache
Server: Apache
Vary: Accept-Encoding,User-Agent
X-Powered-By:
Set-Cookie: BIGipServerProdAPI=189142026.6695.0000; path=/

Error 404: Not Found


What am I doing wrong? 

 

Thanks

 

1 ACCEPTED SOLUTION
Member

Hello,

 

Try removing the last slash in your url before your parameters (e.g., ---/contacts?access_token=-----).

 

Let us know if that helps.  A 404 error means the request uri is invalid, and the extra slash is the likely culprit, I think.

Mark Coleman
Support Engineer

View solution in original post

2 REPLIES 2
Member

Hello,

 

Try removing the last slash in your url before your parameters (e.g., ---/contacts?access_token=-----).

 

Let us know if that helps.  A 404 error means the request uri is invalid, and the extra slash is the likely culprit, I think.

Mark Coleman
Support Engineer

View solution in original post

Thanks!!

 

That worked. 

Developer Portal

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

Visit Page