cancel
Showing results for 
Search instead for 
Did you mean: 

New to Constant Contact and APIs

Occasional Contributor

New to Constant Contact and APIs

Hopefully you can point me in the right direction. 
I (as a developer) need to create an API that will return a summary of all our email Campaigns.
The program to create this is not written yet. It will use the XML returned from the API as input to which i will populate a table with this key information.
Can you tell me how to get an API_key? 
When trying to get the key it is asking to register the New Application name as well as the url of the application, where there is none.

It's going to be a windows based program that will send and read the returned API.

I found this:

api.constantcontact.com/ws/customers/{user​-name}/campaigns/{campaign-id} 

But I don't know how this applies to getting a summary, as shown here:

http://developer.constantcontact.com/docs/campaign-tracking/summary-report.html

 

Can you help?  Thanks

 

 

7 REPLIES 7
CTCT Employee

Re: New to Constant Contact and APIs

Hi Mike,

 

Our XML API is older, and we usually refer to it as our V1 API. It uses URI's that start with api.constantcontact.com/ws. The V2 API uses JSON and the URI's begin with api.constantcontact.com/v2. The last link you refer to below is for the latter. I'd recommend using the V2, JSON, API if you can, because it will be supported for longer than the XML API.

 

You'll want to decide which API you want to use and refer to this documentation for V1 and this documentation for V2.

 

Either way, you can follow the steps here to generate an API Key

 

Best Regards,

Shannon Wallace

Partner API Support Engineer

Occasional Contributor

Re: New to Constant Contact and APIs

Thanks Shannon,

 

I still am a bit confused:

 

It looks like V2 could be the way to go. But this is throwing me:

Getting an API key

Follow these steps to create an account and register your app with Mashery, and get an API key.

 

There is no app to register. and when I spoke to Mashery they made it sound like they were a third party that have their own developers.

We want to create our own APIs.

This is going to be a windows based program that runs on a desktop.

The API needs to obtain activity summary information for all of our campaigns.

 

Theses sample APIs...

...://api.constantcontact.com/ws/customers/{user​-name}/campaigns/{campaign-id}

or

GET: ...//api.constantcontact.com/v2/emailmarketing/campaigns/{campaignId}/tracking/reports/summary

 

looks like they are looking for specific campaign ID's.  And no where in the two samples shows an API key. Is this something that is delivered prior to requesting API information?   As you can see, i am confused or missing something!

Thanks for your time.

 

 

CTCT Employee

Re: New to Constant Contact and APIs

Hi Mike,

 

You will need an API Key, and it will need to be appended to the URL you send a request to. We consider you an 'app' or 'application' in Mashery. You will want to go through the 4 steps on the bottom of the API Keys tab to register an application (where you get your API Key), all the way through to getting an access token for the Constant Contact account you'll be accessing. I'm going to refer only to the V2 endpoints to avoid further confusion. Your request to us to get campaigns will look something like this:

 

GET ...//api.constantcontact.com/v2/emailmarketing/campaigns?api_key=xxxxx

 

Request Headers:

Content-Type: application/json

Authorization: Bearer accessTokenValue

 

Once you get a list of campaigns in the account, with their ID's, you can make subsequent calls to get campaign details and tracking for each campaign. I hope that clarifies things. If not, feel free to respond.

 

Best Regards,

Shannon Wallace

Partner API Support Engineer

 

Highlighted
Occasional Contributor

Re: New to Constant Contact and APIs

Thanks Shannon, you did clear a couple things up.  So to get the information I need it's going to have to be done by several API calls.
As far as getting the API Key, I will attempt to register and see what happens. Thanks again. I'll post back if not successful.  

Occasional Contributor

Re: New to Constant Contact and APIs

Ok, so I am back (that didn't take long!). Already stuck on the first question for obtaining an API Key:

 

1) Application Name, This is the name that appears on the Grant Access screen, during OAUTH flow????? 

 

I do not know what that is asking for. What is the Grant Access screen and what is OAUTH flow? 

 

quesiton 3 asks for Website:   URL of the application (there is none as this will be a windows application on desktop) or Company Website (we have different accounts with Constant Contact, are they asking for a website that might be tied in somehow with the username and password of the Constant Contact account?

 

I feel I am getting closer  (with your help of course).

Thanks

Member

Re: New to Constant Contact and APIs

Thanks Shannon,

I had success on the web site testing the API Urls.  I was able to get a list of campaigns and then the summary of an individual campaign. Now I need to figure how to do this programatically.  When I try to send URL it comes back with a 401 authorization error. So I am thinking there is another send needed prior to the campaign url send.  I'll have to check through there developer section, if there is one.

Thanks

 

this forum...must have en error somewhere, it is showing the reply as being sent by someone else (laura, instead of Mike).

CTCT Employee

Re: New to Constant Contact and APIs

Hi Mike,

 

I think you're probably logged into an account whose owner has a first name of Laura. Let me know if you think that's impossible.

 

I responded to your post here about the 401 errors.

 

Best Regards,

Shannon Wallace

Partner API Support Engineer