I'm working on a little script using the API. Everything was working fine yesterday, now today, if I call the getCampaignList function I get an error:
Invalid access token: <my-access-token>
Those values haven't changed. The access token works fine if I run it from the API tester, it even works fine if I run the same script from my local machine rather than on the server it's intended to run on. I checked this endpoint https://oauth2.constantcontact.com/oauth2/tokeninfo.htm and the token still doesn't expire for almost 10 years.
I verified on the server that the php curl extension is installed and working. I don't understand why it would have stopped working suddenly, and why it still works on a different machine. It's PHP version 5.4 on the server and 5.5 on my local box, but again, it worked a day ago so ...
Any tips at all on how to debug this from here? I am stumped.
Thanks for reaching out to Constant Contact's API Support.
Without seeing the snippet of code that is running on your server I could not say exactly what the issue is; however based on what you describe is sounds like you may just have a syntax error or typo somewhere. If your API still works on the local machine and in our API tester then the key is still valid.
Check and make sure the server is not submitting the API key and Access Token in reverse order. Look for any minor typos; they happen to us all. If those are not the issue you can send us a code snippet. If you need to keep your data private feel free to email us at firstname.lastname@example.org.
I'm still not sure what the problem was, but you're right that it was something silly. I just re-cloned the code from Github and now it works fine. Go figure!
View API documentation, code samples, get your API key.
We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...Read More