Reply
Occasional Contributor
ChloeG85
Posts: 7
Registered: ‎10-06-2011

401 status (No API Access) Unable to get the summary data

[ Edited ]

Hi Constant Contact,

 

i am trying to access the API with the following urls:

 

https://api.constantcontact.com/ws/customers/{username}/campaigns/{campaignsid}

 

and 

 

https://api.constantcontact.com/ws/customers/{username}/contacts/{campaignsid}/events/

 

I am using PHP CURL to get the data.

 

i just want to get the stats of emails which were sent by using constant contact.

 

you can contact me directly at [removed by moderator]

 

I would be highly grateful if anyone can help me how to get the summary data in PHP.

 

Thanks & Regards,

Osama Ahmed Momin

Mark-C
Posts: 181
Topics: 3
Kudos: 10
Solutions: 14
Registered: ‎07-23-2011

Re: 401 status (No API Access) Unable to get the summary data

Hello Osama,

 

I've removed the email address from your post to prevent email scraping, and I'll be sending you a response via email, as requested.

 

In general, I would suggest using our PHP wrapper library, which simplified programming of requeests for campaign information by handling the API requests for you using integrated PHP cURL functions.

 

Cheers,

Mark Coleman
Support Engineer
Occasional Contributor
ChloeG85
Posts: 7
Registered: ‎10-06-2011

Re: 401 status (No API Access) Unable to get the summary data

Hi Mark,

 

I am unable to integrate the PHP wrapper class perfectly, all i wanted is to recevie the summary data of caimpaigns. i dont want anything else. just the stats which are in summary. could you please guide me how to do it in simplest way.

 

Thanks & Regards,

Osama Ahmed Momin

Mark-C
Posts: 181
Topics: 3
Kudos: 10
Solutions: 14
Registered: ‎07-23-2011

Re: 401 status (No API Access) Unable to get the summary data

[ Edited ]

Hi Osama,

 

Can you be more specific about what data you are trying to obtain?  We may not have an API call that returns only the data you are seeking, so you may need to make a request that returns more information than needed, and parse the specific data you want from the response.  

 

It's beyond the scope of what I can offer you to show you how to code this, but if I have more information on what specific data you are seeking, I may be able to help you identify which API calls you need to make, or offer some advice on how to use the wrapper to get just the data you want from our API's response.

 

Our API responds to your request be sending back formatted XML, so if you are not interested in using the wrapper, you'll need to read the response into a string variable, and parse that using the PHP SimpleXML library, which will store the parsed response in an object from which you can call the data you're interested in within your script. 

 

If you need assistance with learning the code you need to accomplish this, I can point you to some resources that will help you with that.

 

If you would like to continue to try and implement the wrapper, please explain what issue you have had with that, and I may be able to offer some more helpful advise on that as well.

 

Mark Coleman
Support Engineer