I have an API on my Coldfusion 8 website that adds contacts to my Constant Contact lists. However, just recently (and out of the blue), the following error started appearing:
The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
HTTP Request error with Constant Contact
Status Code: 403 Forbidden
Request Method: PUT
I'm using this wrapper: https://github.com/constantcontact/Constant-Contact-ColdFusion-8
... and the URL is here: http://laminedor.ca/mailing-list
I'm not sure if something changed and I need to update some code, but I definitely didn't make any changes on my end that would have broken it.
Any help would be greatly appreciated!
Hi, If you are receiving a 403 error, it can mean that you are providing a valid username and password, but you are providing a different username in the API URL. When I tried to sign up on your page, I got the following error in my browser:
The element at position 1 of dimension 1, of array variable "CONTACTSARRAY," cannot be found.
|The error occurred in E:\websites\laminedor.ca\www\dsp\dsp_newsletter.cfm: line 46
44 : 45 : <cfset contactsArray = ContactsCollection.searchByEmail(form.txtEmail)> 46 : <cfset contactObj = ContactsCollection.getContactDetails(contactsArray)> 47 : 48 : <cfset matchList = Replace( contactLists, "https", "http" )>
Thanks for the feedback! However, I don't think this is the case.
<cfset application.ccUsername = "xxxxxx"> <cfset application.apiPath = "https://api.constantcontact.com/ws/customers/#application.ccUsername#">
I'm using this in my application.cfm, so it's for sure using the same username for both.
Also, to be clear, this exact code was working when I first implemented it in May of 2013, and it just stopped working. Nothing has changed on my end, so this is why I'm a little stumped as to what the problem could be.
Any further direction would be greatly appreciated.
In this case, a 403 error on the V1 API for contacts can be caused by two things:
1. An invalid API Key
2. Authentication provided for an account other than the account being accessed.
After digging deeper into your issue I can confirm that it is not an issue with the API key being used. I can also say that the error is only happening when you are performing a PUT request to the Constant Contact API. What I would suggest is to search the code where you are making a PUT request to update an existing contact and verify that the username provided in the URL is being properly built.
If after checking on that, you are still not able to find any answers, we may be able to provide some additional assistance if you are able to contact us at firstname.lastname@example.org and provide the code for how you are executing the contact update.
Thanks for the help Elijah!
Everything looks good on my end, especially since this exact code was working in the past, and just stopped working.
I will reach out for support at the e-mail address provided.