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.

I can't get the account information..

Highlighted
Visitor

I can't get the account information..

Hi,

 

I'm trying to develop my first API but I can't get anything from it..

Here is my code from my class constant contact but I can't get anything from it, the value is empty :/
If someone can help me it would be nice, I'm a beginner ^^

 

<?php
	class cc
{
        private $api_key;

    public function __construct()
    {
        $api_key = 'MyAPIKey';
        
        $this->api_key = $api_key;
        
        
    }
	
	
	
	//Get summary information
	
	function get_summary()
	{
	$uid = uniqid();
        $devid = uniqid();
        $appid = uniqid();
		
        $endpoint = "https://api.constantcontact.com/v2/account/info?";
$endpoint .= "api_key=" . this->api_key; $xml = $this->curl($endpoint); return $rsp; } private function curl($p_endpoint) { $session = curl_init($p_endpoint); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($session); curl_close($session); $rsp = json_decode($data, true); //$this->debug($rsp) ; if ($rsp) { return $rsp; } else { return null; } } private function curlPost($p_endpoint, $json) { $fields = "json=$json"; $session = curl_init($p_endpoint); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); curl_setopt($session, CURLOPT_POST, 1); curl_setopt($session, CURLOPT_POSTFIELDS, $fields); $data = curl_exec($session); //$this->debug($data) ; curl_close($session); $rsp = json_decode($data, true); // $this->debug($rsp); if ($rsp) { return $rsp; } else { return null; } } } ?>

 

2 REPLIES 2
Highlighted
Moderator

Re: I can't get the account information..

Hello Corentin,

 

Thank you for reaching out to Constant Contact's API Support.

 

The endpoint you are trying to use is specifically for Constant Contact Partners. On the documentation page there is a Note: section which states this endpoint will not work unless you are a partner. Since you are getting empty responses you are most likely not a partner with us. If you are I would need to know your Constant Contact username for the partner account. You probably want to keep that data private so you can email that to use at webservices@constantcontact.com.


Regards,
Jimmy D.
Tier II API Support Engineer
Highlighted
Visitor

Re: I can't get the account information..

Thank you very much !
I'm sending an email ! ^^

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