The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Not able to extract XML output for number of Opens, Sends, Clicks etc... from API using .Net

Highlighted
Occasional Participant

Not able to extract XML output for number of Opens, Sends, Clicks etc... from API using .Net

Hi,


I am new to constant contact API and i am trying to extract summary report of number of opens, number of clicks, number of sends to all my email campaigns present in the account through api. I am unable to get the XML output. the output that i get only contains collections of Name, Status and Date Sent. I have a trial account and created 6 email campaigns. when i click on reports link it shows me all the summary of sends, clicks and opens in the website but not able to get the same values in the XML output. Please help me ASAP. Any help will be appreciated.


Thanks,


Ravindranath


 

4 REPLIES 4
Highlighted
Moderator

For sent campaigns, the

For sent campaigns, the statistic events are in drill down resource URIs.  Here is a sample of one:


 


https://api.constantcontact.com/ws/customers/{username}/campaigns/{campaign_id}/events/bounces


 


This would provide you with all the bounces for the campaign with ID campaign_id.  There are also resources for clicks, opens, sends, optouts and forwards.  Hope this helps!

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

For sent campaigns

Hi,


Thanks for you response, i appreciate your imediate response. but i am getting some output which i am not able to figure out what it is.


I tried with the following code which you suggested, it generates a XML response but gives me some time format i am not able to get the bounces count when i query by this following string:


https://api.constantcontact.com/ws/customers/{username}/campaigns/{campaign_id}/events/bounces


The output i get after querying is as follows:


{username} 2010-10-07T04:52:50.804Z


Note: I took the campaign ID form the query string which can be seen on mouse hover of a eamil campaign in constant contact. It is constructed as uid=some id. I am not sure if this is the real campaing ID.


 


Please can anyone tell what kind of output is this?


Any help will be appreciated.


 

Highlighted
Employee

Re: For sent campaigns

The UID is the campaign ID, but the recommend way to retrieve this ID would be to perform an http get on https://api.constantcontact.com/ws/customers/{user-name}/campaigns. This will return a paginated response of 50 campaigns, including their ID.


 


Regard the response you are receiving, how is it you are performing that query (using a programming environment? Web browser? etc..) It looks like you are successfully retrieving the bounce data for that campaign, but as there are no bounces recorded it is only displaying the username for the account and the date that the campaign was last updated. For example, your XML probably looks similar to what is below.


 


<?xml version="1.0" encoding="UTF-8"?>

<feed xmlns="http://www.w3.org/2005/Atom">

  <id>http://api.constantcontact.com/ws/customers/{user-name}/campaigns/{campaign-id}/events/bounces</id>

  <title type="text">Bounce Events for Customer: {user-name}, Campaign id: {campaign-id}</title>

  <link href="bounces"></link>

  <link href="bounces" rel="self"></link>

  <author>

    <name>{user-name}</name>

  </author>

  <updated>2010-10-07T12:15:28.071Z</updated>

  <link href="/ws/customers/{user-name}/campaigns/{campaign-id}/events/bounces" rel="first"></link>

</feed>

David J

Highlighted
Occasional Participant

Re: For sent campaigns

Hi David,


 


Thanks for the response, i solved the problem. The problem was in building the URL. The above mentioned URL works for me with the desired XML output.


 


Thanks,


Ravindranath

Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured