Make a GET call to the /account/user/privileges
endpoint to return the user privileges associated with your access token. Constant Contact requires specific user privileges to make requests using the V3 API. For more information on the user roles in Constant Contact and the privileges associated with them, see the User Roles and Privileges Overview topic.
When you send a request that lacks the necessary user privileges, the V3 API returns a 403 Forbidden error with this response body:
{
"error_key": "access_denied",
"error_message": "Request forbidden due to insufficient user privileges."
}
You can use the GET /account/user/privileges
endpoint and the V3 API Endpoint Privileges table to determine which privileges you are missing.
Example Get Email Campaign Activity Call
This example GET call returns an array of objects containing user privileges. The example response body is for the Constant Contact campaign creator role.
GET https://api.cc.email/v3/account/user/privileges
Endpoint Requirements
User privileges: None
Authorization scopes: None
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/account/user/privileges');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Postman-Token' => '6624a73b-1032-4d89-aa98-7e6a86da525a',
'cache-control' => 'no-cache',
'Authorization' => 'Bearer {access_token}'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cc.email/v3/account/user/privileges")
.get()
.addHeader("Authorization", "Bearer {access_token}")
.addHeader("cache-control", "no-cache")
.addHeader("Postman-Token", "066251e0-0f6a-4e30-bc6d-5776a5f87a58")
.build();
Response response = client.newCall(request).execute();
curl -X GET \
https://api.cc.email/v3/account/user/privileges \
-H 'Authorization: Bearer {access_token}' \
-H 'Postman-Token: e824ef79-cdd9-4574-9426-3f5101d9baa8' \
-H 'cache-control: no-cache'
Response
[
{
"privilege_id": 15,
"privilege_name": "ui:myAccount:cmtnyLogin"
},
{
"privilege_id": 19,
"privilege_name": "ui:myAccount:viewPricingPage"
},
{
"privilege_id": 21,
"privilege_name": "ui:myAccount:help"
},
{
"privilege_id": 25,
"privilege_name": "product:read"
},
{
"privilege_id": 52,
"privilege_name": "contacts:lists:read"
},
{
"privilege_id": 29,
"privilege_name": "campaign:list"
},
{
"privilege_id": 30,
"privilege_name": "campaign:create"
},
{
"privilege_id": 31,
"privilege_name": "campaign:read"
},
{
"privilege_id": 32,
"privilege_name": "campaign:write"
},
{
"privilege_id": 33,
"privilege_name": "campaign:content:write"
},
{
"privilege_id": 57,
"privilege_name": "campaign:copy"
},
{
"privilege_id": 59,
"privilege_name": "paymentconfig:read"
},
{
"privilege_id": 67,
"privilege_name": "mylibrary:file:read"
},
{
"privilege_id": 66,
"privilege_name": "mylibrary:file:update"
},
{
"privilege_id": 70,
"privilege_name": "mylibrary:folder:update"
},
{
"privilege_id": 71,
"privilege_name": "mylibrary:folder:read"
},
{
"privilege_id": 69,
"privilege_name": "mylibrary:folder:create"
},
{
"privilege_id": 65,
"privilege_name": "mylibrary:file:create"
},
{
"privilege_id": 68,
"privilege_name": "mylibrary:folder:delete"
}
]