I can't get the account information..

CorentinM
Occasional Participant

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
Jimmy_D
Moderator

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
CorentinM
Occasional Participant

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

Developer Portal

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

Visit Page