401 Error with Query string

Regular Participant

401 Error with Query string

I use the following query string (with corrected values) in a web browser and get the login pop up but then get an "Error 401: Error reported: 401 error". I know I log in correctly because I can log into the web and see it. The email address exists and an email was sent to the address. Any suggestions on troubleshooting this error?


https://api.constantcontact.com/ws/customers/{username}/contacts?email=myemail@myemail.com


Also are there any other query strings available?


BTW, I only have one contact in the system.


 

Gary Cawley

3 REPLIES 3
Employee

Make sure that the username that you are using on the login is actually your API key and username separated by a percent sign ie: XXXX-XXXX-XXXX-XXXXXXXXX%username


 


Please try that and let us know if you are still having troubles.

Dan H

Support Engineer, Constant Contact

Regular Participant

Do I need quotes or any other syntax issues?


I receveid an API key and entered the correct values but I get a 400 bad request


Bad Request


https://api.constantcontact.com/ws/customers/XXXX-XXXX-XXXX-XXXXXXXXX%username/contacts?email=myemai...


 


Your browser sent a request that this server could not understand.

 




IBM_HTTP_Server Server at api.constantcontact.com Port 80

Gary Cawley

Moderator

The request URI should only include the Username, not the API key.  You request should be:


 


https://api.constantcontact.com/ws/customers/username/contacts?email=myemail@myemail.com


 


The API Key is only used for passing in the Authentication step

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page