You must have the role of Account Owner assigned to update account level details.
Before you can send an email from the account, you must first specify the physical address to use to contact the organization. The physical_address
displays on all emails that are sent from the account. The account level address information can differ from the organization’s physical address.
If you have not yet added a physical address for the account, add one by making a POST call to the /account/summary/physical_address
endpoint.
Parameters
In the request body
parameter, include all AccountPhysicalAddress
required properties for the country_code
that you specify.
address_line1
: (string, required) Line 1 of the organization’s street address.address_line2
: (string) Line 2 of the organization’s street address.address_line3
: (string) Line 3 of the organization’s street address.city
: (string) The city where the organization is located. Required ifcountry_code
isUS
(United States) orCA
.state_code
: (string) The two-letter ISO 3166-1 code for the organization’s state and only used if thecountry_code
isUS
orCA
. If not, exclude this property from the request body.state_name
: (string) Used if the state where the organization is physically located is not in the United States or Canada. Ifcountry_code
isUS
orCA
, exclude this property from the request body.postal_code
: (string) The postal code address (ZIP code) of the organization. This property is required if thestate_code
isUS
orCA
. If not, exclude this property from the request body.country_code
: (string, required) The two-letter ISO 3166-1 code for the organization’s country.
Example POST Request
POST https://api.cc.email/v3/account/summary/physical_address
Endpoint Requirements
User privileges: account:update
Authorization scopes: account_update
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/account/summary/physical_address');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Connection' => 'keep-alive',
'content-length' => '211',
'accept-encoding' => 'gzip, deflate',
'Host' => 'api.cc.email',
'Cache-Control' => 'no-cache',
'Authorization' => 'Bearer {access token}',
'Content-Type' => 'application/json',
'Accept' => 'application/json'
));
$request->setBody('{
"address_line1": "123 Maple Street",
"address_line2": "Unit 1",
"address_line3": "Apartment 234",
"city": "Boston",
"state_code": "MA",
"postal_code": "02451",
"country_code": "us"
}
');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
curl -X POST \
https://api.cc.email/v3/account/summary/physical_address \
-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 'accept-encoding: gzip, deflate' \
-H 'cache-control: no-cache' \
-H 'content-length: 211' \
-d '{
"address_line1": "123 Maple Street",
"address_line2": "Unit 1",
"address_line3": "Apartment 234",
"city": "Boston",
"state_code": "MA",
"postal_code": "02451",
"country_code": "us"
}
'
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \n \"address_line1\": \"123 Maple Street\",\n \"address_line2\": \"Unit 1\",\n \"address_line3\": \"Apartment 234\",\n \"city\": \"Boston\",\n \"state_code\": \"MA\",\n \"postal_code\": \"02451\",\n \"country_code\": \"us\"\n}\n \n \n");
Request request = new Request.Builder()
.url("https://api.cc.email/v3/account/summary/physical_address")
.post(body)
.addHeader("Accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access token}")
.addHeader("Cache-Control", "no-cache")
.addHeader("Host", "api.cc.email")
.addHeader("accept-encoding", "gzip, deflate")
.addHeader("content-length", "211")
.addHeader("Connection", "keep-alive")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Response
{
"address_line1": "123 Maple Street",
"address_line2": "Unit 1",
"address_line3": "Apartment 234",
"city": "Boston",
"state_code": "MA",
"postal_code": "02451",
"country_code": "us"
}