Retrieve the list of scopes your access token is currently using

Make a POST call to the /token_info endpoint to return the list of OAuth2.0 scopes associated with your access token. Use the token property in the request body to specify the OAuth2.0 token you are returning information for. You cannot return authentication information for expired access tokens.

Constant Contact requires specific scopes to make V3 API requests. See the Scopes Required by V3 API Routes table in this topic for the scopes required by each API route.

Authorization Requirements

User privileges: None

Authorization scopes: None

Like the other V3 API methods, this method requires a valid bearer access token in the Authorization header.

Request Body

Request Body Schema

Schema Property Data Type Description
token
required
string A valid OAuth2 bearer access token.

Example Access Token Information Call

This example get call returns the scopes associated with the access token included in the request body.

<?php

$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/token_info');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => 'Bearer {access_token}',
  'Content-Type' => 'application/json'
));

$request->setBody('{
	"token" : "{access_token}"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
curl -X POST \
  https://api.cc.email/v3/token_info \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Content-Type: application/json' \
  -d '{
	"token" : "{access_token}"
}'
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"token\" : \"{access_token}\"\n}");
Request request = new Request.Builder()
  .url("https://api.cc.email/v3/token_info")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access_token}")
  .build();

Response response = client.newCall(request).execute();

Response Body

This example response body is for an access token that contains four scopes.

{
    "scopes": [
        "account_read",
        "account_update",
        "contact_data",
        "campaign_data"
    ]
}

Try it!

Scopes Required by V3 API Routes

Description Endpoint Route Required Scope
Account Endpoints /account account_read or account_update
Contacts Endpoints /contacts contact_data
Contact Lists Endpoints /contact_lists contact_data
Custom Fields Endpoints /contact_custom_fields contact_data
Bulk Activities Endpoints /activities contact_data
Contacts Reporting /reports/contact_reports contact_data
Email Campaigns /emails campaign_data
Email Reporting /reports/email_reports campaign_data