Update Constant Contact user account details.

Make a PUT call to the /account/summary endpoint to update account related details for the Constant Contact user account; such as the account owner and account contact email address information.

This PUT method provides a partial update, where only valid properties included in the request body are updated and excluded properties are not overwritten. To use this PUT method, you must have the role of Account Owner required to update account-level details.

Parameters

Include only those CustomerPut account properties that you want to update in the request body parameter:

  • contact_email: (string) The Constant Contact account owner’s email address. This address must be a confirmed email address that already exists for this account. To get a list of confirmed emails for the account, make a GET call to the /account/emails endpoint and set the confirm_status query parameter to CONFIRMED.
  • contact_phone: (string) The account owner’s contact phone number (up to 25 characters in length).
  • country_code: (string) The uppercase two-letter ISO 3166-1 code representing the organization’s country.
  • encoded_account_id: (read only, string) The read only encoded account ID that uniquely identifies the account. Changes to read-only fields are ignored.
  • first_name: (string) The account owner’s first name.
  • last_name: (string) The account owner’s last name.
  • organization_name: (string) The name of the organization that is associated with this account.
  • state_code: (string) The uppercase two-letter ISO 3166-1 code used to represent the state location for this account. This property is required if the country_code is US (United States) or CA (Canada).
  • time_zone_id: (string) The time zone you want this account to use; as defined in the IANA time-zone database (see http://www.iana.org/time-zones).
  • website: (string) The organization’s website URL.

Example PUT Request

PUT https://api.cc.email/v3/account/summary

Endpoint Requirements

User privileges: account:update

Authorization scopes: account_update


<?php

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

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Connection' => 'keep-alive',
  'content-length' => '343',
  'accept-encoding' => 'gzip, deflate',
  'Host' => 'api.cc.email',
  'Postman-Token' => '6937b064-d483-4ecb-b9bc-e9dc1ec9b93b,e456d23d-e89f-4dce-ad75-92d14b255590',
  'Cache-Control' => 'no-cache',
  'User-Agent' => 'PostmanRuntime/7.13.0',
  'Authorization' => 'Bearer {access token}',
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
));

$request->setBody('{
    "contact_email": "web@mailinator.com",
    "contact_phone": "5089991111",
    "country_code": "US",
    "first_name": "webservices",
    "last_name": "sum",
    "organization_name": "Constant Contact",
    "state_code": "MA",
    "time_zone_id": "US/Eastern",
    "website": "http://www.ctctwebservices.com"
}');

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

curl -X PUT \
  https://api.cc.email/v3/account/summary/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access token}' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: api.cc.email' \
  -H 'Postman-Token: 6937b064-d483-4ecb-b9bc-e9dc1ec9b93b,c90bb1fd-a324-4404-a034-39252b8f626a' \
  -H 'User-Agent: PostmanRuntime/7.13.0' \
  -H 'accept-encoding: gzip, deflate' \
  -H 'cache-control: no-cache' \
  -H 'content-length: 343' \
  -d '{
    "contact_email": "web@mailinator.com",
    "contact_phone": "5089991111",
    "country_code": "US",
    "first_name": "webservices",
    "last_name": "sum",
    "organization_name": "Constant Contact",
    "state_code": "MA",
    "time_zone_id": "US/Eastern",
    "website": "http://www.ctctwebservices.com"
}'


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"contact_email\": \"webs@mailinator.com\",\n    \"contact_phone\": \"5089991111\",\n    \"country_code\": \"US\",\n    \"first_name\": \"webservices\",\n    \"last_name\": \"sum\",\n    \"organization_name\": \"Constant Contact\",\n    \"state_code\": \"MA\",\n    \"time_zone_id\": \"US/Eastern\",\n    \"website\": \"http://www.ctctwebservices.com\"\n}");
Request request = new Request.Builder()
  .url("https://api.cc.email/v3/account/summary/")
  .put(body)
  .addHeader("Accept", "application/json")
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access token}")
  .addHeader("User-Agent", "PostmanRuntime/7.13.0")
  .addHeader("Cache-Control", "no-cache")
  .addHeader("Postman-Token", "6937b064-d483-4ecb-b9bc-e9dc1ec9b93b,beb9b649-b760-4128-a18c-551cde1bdd70")
  .addHeader("Host", "api.cc.email")
  .addHeader("accept-encoding", "gzip, deflate")
  .addHeader("content-length", "343")
  .addHeader("Connection", "keep-alive")
  .addHeader("cache-control", "no-cache")
  .build();

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

Response

{
    "contact_email": "web@mailinator.com",
    "contact_phone": "5089991111",
    "country_code": "US",
    "first_name": "webservices",
    "last_name": "sum",
    "organization_name": "Constant Contact",
    "state_code": "MA",
    "time_zone_id": "US/Eastern",
    "website": "http://www.ctctwebservices.com"
}                                                                                                           

Try it!