To retrieve all currently connected social network accounts, make a GET call to the /social/connections endpoint. The response includes account info and a connection_status for each connection. You can surface this information in your UI to show users the current state of each network — for example, when a token has expired, scopes are missing, or the connection is rate-limited. Note that a broken connection cannot be repaired through this API; the end user must reconnect the network from within Constant Contact.

A connection represents an authorized link to a social network account (for example, a Facebook user account or an Instagram business account). Multiple profiles (Pages, Business accounts, and so on) can exist under a single connection.

Example Request

GET https://api.cc.email/v3/social/connections

Endpoint Requirements

User privileges: campaign:read

Authorization scopes: campaign_data

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cc.email/v3/social/connections',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer {access_token}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
curl --location 'https://api.cc.email/v3/social/connections' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}'
OkHttpClient client = new OkHttpClient().newBuilder().build();
Request request = new Request.Builder()
        .url("https://api.cc.email/v3/social/connections")
        .get()
        .addHeader("Content-Type", "application/json")
        .addHeader("Authorization", "Bearer {access_token}")
        .build();
Response response = client.newCall(request).execute();

Example Response

The response wraps the list of connections under a connections array. Each entry contains the connected account_info and a connection_status object describing the current state of the connection.

{
  "connections": [
    {
      "account_info": {
        "network": "facebook",
        "network_account_id": "24258109677114580",
        "display_name": "Jane Doe",
        "username": "Jane Doe",
        "image_url": "https://graph.facebook.com/24258109677114580/picture?type=large"
      },
      "connection_status": {
        "has_token": true,
        "is_active_user": true,
        "rate_limited": false,
        "token_has_scopes": true,
        "token_is_valid": true
      }
    },
    {
      "account_info": {
        "network": "instagram",
        "network_account_id": "17841475595296980",
        "display_name": "mybusinesspage",
        "username": "mybusinesspage",
        "account_url": "https://instagram.com/mybusinesspage/"
      },
      "connection_status": {
        "has_token": true,
        "is_active_user": true,
        "rate_limited": false,
        "token_has_scopes": true,
        "token_is_valid": true
      }
    }
  ]
}

If connection_status.token_is_valid is false or connection_status.rate_limited is true, the user must re-authorize or wait before publishing succeeds for that network.

Test the endpoint using our reference tester: Try it!

Tags: