cancel
Showing results for 
Search instead for 
Did you mean: 

New to Constant Contact API and Where to get Access Tokens

Occasional Contributor

New to Constant Contact API and Where to get Access Tokens

Hi,

 

I'm trying follow this example code on this link, https://v3.developer.constantcontact.com/api_guide/contacts_sync.html#endpoint-requirements-1, under 'Example GET /Contacts call using updated_after Parameter', excluding updated_after. 

 

I'm pretty new to the whole API thing and trying to learn. So, I'm just trying to print the results right now to the console.log(), but I don't know if I'm setting this part, 

'Authorization' => 'Bearer {access_token}',

correct or not.

 

So far I have it something like this:

'Authorization' => '0000000-0000-0000-bdde-e7d90fcf0cc7',

so tell me if I'm doing it wrong or not. Do I need the 'Bearer' part before the access token?

 

Also, is the access token a totally different code from API key and Secret Key that you generate after creating a new application. If so how do I generate a token or where do I find it?

5 REPLIES 5
Occasional Contributor

Re: New to Constant Contact API and Where to get Access Tokens

Also, I should mention that I'm using the PHP version.

Moderator

Re: New to Constant Contact API and Where to get Access Tokens

Hello,

 

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

 

You will want to set your Authorization header to be "Bearer " plus whatever your access token is. So using your example:

 

'Authorization' => 'Bearer 0000000-0000-0000-bdde-e7d90fcf0cc7',


Please let me know if you have any other questions!

 

Regards,
David B.
Tier II API Support Engineer

Occasional Contributor

Re: New to Constant Contact API and Where to get Access Tokens

Hi David,

 

Thank you for responding back to me.

 

The access token in this case, can I use my API Key or Secret Key? Or is that something i need to generate separately? If so, how would I do that?

Moderator

Re: New to Constant Contact API and Where to get Access Tokens

Hello,

 

The Access Token comes from the OAuth process and is what tells us which Constant Contact account to access, and that your app has permission to do so.

 

See this page in our documentation:

https://v3.developer.constantcontact.com/api_guide/auth_overview.html

 


Regards,
David B.
Tier II API Support Engineer

Occasional Contributor

Re: New to Constant Contact API and Where to get Access Tokens

Hi David_B,

 

Thanks for the response and documentation. I will read up on that.