Got a 'How do I' question? Join 'Ask a Trainer' Monday to Friday, 11am to 4pm ET for instant help and pro tips!

V2 contact_Id and campaign_Id problems

WilliamM853
Constant Contact Partner
0 Votes

I am having trouble getting individual campaign or contact information using V2 api.

 

I am getting similar results with either call.

The payload I am sending is this:

URI: https://api.constantcontact.com/v2/contacts/contactId/tracking?api_key=<somekey>
Request Headers: array(2) { [0]=> string(58) "Authorization: Bearer <somethingsecret>" [1]=> string(21) "contactId: 1206033418" }

 

The response I am getting is:

400
Invalid ID. Acceptable formats are positive longs or UUIDs

 

What am I doing wrong, or how di I properly format ids in PHP?

3 REPLIES 3
David_B.
Employee
0 Votes

Hello,

 

Thank you for reaching out to Constant Contact API Developer Support.

 

The contact ID actually goes in your request URL and not as a header item. So for your example, you would make a call to:

https://api.constantcontact.com/v2/contacts/1206033418/tracking?api_key=somekey

 

And include your Authorization header (with the bearer token) along with it. This will return all of the tracking associated with this specific contact.

 

Please let us know if you have any other questions!

 

Regards,

David B.
Tier II API Support Engineer

WilliamM853
Constant Contact Partner
0 Votes

Hi David,

Thank you for your attention.

I tried that, and received this error message:

404 - No matching resource was found for the supplied URL.

 

This is the data sent:

URI: https://api.constantcontact.com/v2/contacts/1206033418/tracking?api_key=<api_key>
Request Headers: array(1) { [0]=> string(58) "Authorization: Bearer XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" }

 

Still not sure what I am doing wrong!

David_B.
Employee
0 Votes

Hello,

 

That error in this case typically means that there isn't a contact with that ID in the account you are working with. Would you be willing to send an email to us at webservices(at)constantcontact.com with the Constant Contact username you are working in? I can do some digging and verify exactly why you're getting that error.

 

Please let us know if you have any other questions!

 

Regards,

David B.
Tier II API Support Engineer

Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up