cancel
Showing results for 
Search instead for 
Did you mean: 

V2 contact_Id and campaign_Id problems

Occasional Visitor

V2 contact_Id and campaign_Id problems

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?

Tags (1)
3 REPLIES 3
Moderator

Re: V2 contact_Id and campaign_Id problems

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

Occasional Visitor

Re: V2 contact_Id and campaign_Id problems

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!

Moderator

Re: V2 contact_Id and campaign_Id problems

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