Thank you for reaching out to the API Support team here at Constant Contact.
There are a variety of problems that can lead to a 403 error, such as going over your API Key's calls per second or per day limitation. What is the error response message that is coming back with the 403?
Which endpoint are you making the call to?
Are you using PUT or POST to add the contact?
API Support Specialist
Thank you for that information.
That is our base API URL. Would you be able to provide us with the full URL you are POSTing to?
Also, if you prefer we can do some research on your specific issue on our end. If you email email@example.com with your API Key, an example of a contact you are trying to add, and a snippet of the code you are using (if available) we can look into this in more detail.
API Support Specialist
$call = $utility->getApiPath() . '/ws/customers/' . $utility->getLogin() . '/contacts';
$utility->getApiPath() is the base path I gave you
Based on the extended URL you are using our v1 API. While that version of the API is technically deprecated I can provide you with a link to the old documentation if needed. The basis of the issue however; is that since the contact once existed in the account and you are trying to bring them back in to the account you are updating that contact which requires the use of a PUT and not a POST. Most likely the opt-in source will also need to be listed as ACTION_BY_CONTACT.
Here is the link to the deprecated documentation. Click Here
Can you check my xml, I'm getting a new error: "The requested url returned error: 415 Unsupported Media Type"
<?xml version="1.0" encoding="UTF-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <title>TitleNode</title> <updated>2017-07-20T15:40:55+01:00</updated> <author> <name>CTCT Samples</name> </author> <id>urn:uuid:E8553C09F4xcvxCCC53F481214230867087</id> <summary type="text">Customer document</summary> <content type="application/vnd.ctct+xml"> <Contact xmlns="http://ws.constantcontact.com/ns/1.0/"> Customer document <EmailAddress>firstname.lastname@example.org</EmailAddress> <FirstName>jeremiah serrano</FirstName> <LastName /> <MiddleName /> <CompanyName /> <JobTitle /> <OptInSource>ACTION_BY_CONTACT</OptInSource> <HomePhone /> <WorkPhone /> <Addr1 /> <Addr2 /> <Addr3 /> <City /> <StateCode /> <StateName /> <CountryCode /> <PostalCode /> <SubPostalCode /> <Note /> <EmailType /> <CustomField1 /> <CustomField2 /> <CustomField3 /> <CustomField4 /> <CustomField5 /> <CustomField6 /> <CustomField7 /> <CustomField8 /> <CustomField9 /> <CustomField10 /> <CustomField11 /> <CustomField12 /> <CustomField13 /> <CustomField14 /> <CustomField15 /> <ContactLists> <ContactList id="http://api.constantcontact.com/ws/customers/mediademac/lists/1" /> </ContactLists> </Contact> </content> </entry>
Your XML is missing several components and the formatting is not the same as the example listed in the link given in the previous reply. If this is an already established integration then I would go over the document I previously linked and double check on the example XML listed. If this is something you are setting up new I suggest to switch to our v2 API which is easier to work with.
Our v2 API documentation can be found here.
New contacts use POST which is what you are already doing, and they can either be added with ACTION_BY_OWNER or ACTION_BY_CONTACT. Since this issue is with adding in a contact that was deleted is must be done with a PUT and it must be done with ACTION_BY_CONTACT.
In the deprecated api link you sent, where do I get the contact-id of a deleted Contact:
That link is just for updating a contact. It sounds like this is a new integration so I highly suggest switching to our v2 API. However; if you wish to continue with the v1 API please understand since it is deprecated there are no updates or fixes to this version.
You would need to do a GET in order to retrieve the Contact ID. That documentation can be found here.
All of our v1 Documentation can be found here:
To look at contacts specifically, see the links in our documentation here:
Please let me know if you have any other questions for me.
API Support Specialist
View API documentation, code samples, get your API key.Visit Page
The holidays have come and gone. For many seasonal businesses, this means the rush of shoppers has decreased as well. Instead of turning off the lights and waiting for spring, make your email marketi...See Article