Address Book REST API Reference
Use the Address Book REST API to manage address books, associate address books to rooms, and add contacts to an address book in Alexa Smart Properties (ASP).
Before you add a contact to an address book of a room, you must create the communications profile to enable the calling capability. Alexa uses the communication profile ID instead of a unit ID to identify the Alexa-enabled devices in the room. For more details, see Communications REST API Reference.
If you want to create and manage address books and contacts in the ASP management console instead, see Manage Communications Features in the Management Console.
Resource limits
The Address Book API defines the following resource limits. If you exceed the limit, the request fails with a message
in the response body that indicates the limit reached.
Resource | Limit | Error message |
---|---|---|
Contacts per address book. |
2000 |
You have reached the maximum number of contacts that can be created per address book: 2000. |
Address books associated with a unit. |
10 |
You have reached the maximum number of address books that can be associated with a unit: 10. |
Phone numbers associated with a unit. |
10 |
You have reached the maximum number of phone numbers that can be associated with a unit: 10. |
Units associated with an address book. |
2500 |
You have reached the maximum number of units that can be associated with an address book: 2500. |
Phone numbers per contact. |
3 |
The number of phone numbers must be between 1 and 3. |
Address books per organization. |
35000 |
You have reached maximum number of address books that you can create per organization: 35000. |
API endpoint
Based on the country of your organization, set the Host
parameter in the request header to one of the following API endpoints.
Country | Endpoint |
---|---|
CA, US |
|
DE, ES, FR, IT, UK |
|
JP |
|
Authentication
Each API request must have an authorization header whose value is the access token retrieved from Login with Amazon (LWA). For details, see Manage API Access.
Operations
The Address Book API supports the following types of operations:
- Manage address books – Create address books and associate them with rooms on your property.
- Manage contacts – Create contacts and add them to an address book. You can create a contact with a phone number, communication profile, or WebRTC service provider.
Manage address books
Operation | HTTP Method and URI |
---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Manage contacts
Operation | HTTP Method and URI |
---|---|
| |
| |
| |
| |
| |
|
Create address book
Create an address book.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To create an address book, you make a POST
request to the /v1/addressBooks
resource.
Request path and header example
POST /v1/addressBooks HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"name": "Address Book for Property Name"
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Address book name. |
String |
Yes |
Response
A successful response returns HTTP 201 Created
, along with the address book ID.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
{
"addressBookId": "amzn1.alexa.addressbook.did.1000"
}
Response body properties
Property | Description | Type |
---|---|---|
|
Identifies the new address book. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains an address book ID. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Delete address book
Delete the specified address book.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To delete an address book, you make a DELETE
request to the /v1/addressBooks/{addressBookId}
resource.
Request path and header example
DELETE /v1/addressBooks/{addressBookId} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 204 No Content
.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
The response has no body.
Response body properties
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Address book deleted successfully. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Get address book
Get the details of the specified address book.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To get the details of the address book, you make a GET
request to the v1/addressBooks/{addressBookId}
resource.
Request path and header example
GET /v1/addressBooks/{addressBookId} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with the details of the address book.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
{
"addressBookId": "amzn1.alexa.addressbook.did.1000",
"name": "Example Property Name"
}
Response body properties
Property | Description | Type |
---|---|---|
|
Identifies the address book. |
String |
|
Address book name. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains details about the specified address book. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
List address books
Get the list of address books owned by the caller.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To list address books, you make a GET
request to the /v1/addressBooks
resource.
Request path and header example
GET /v1/addressBooks?maxResults={maxResults}&nextToken={nextToken} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Query |
Maximum number of results to return in the response. |
Integer |
No |
|
Query |
Token from the previous response. |
String |
No |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with a list of address books.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
{
"results": [{
"addressBookId": "amzn1.alexa.addressbook.did.1000",
"name": "Property Address Book"
}
],
"paginationContext": {
"nextToken": "someToken.1"
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
List of address books. |
Array of objects |
|
Identifies the address book. |
String |
|
Address book name. |
String |
|
Indicates whether there are more results to return. |
Object |
|
Included when the response is truncated. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains a list of address books owned by the caller. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Update address book
Update the name of the specified address book.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To update the book name you make a PUT
request to the /v1/addressBooks/{addressBookId}
resource.
Request path and header example
PUT /v1/addressBooks/{addressBookId} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"name": "Example Property Name"
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Address book name. |
String |
Yes |
Response
A successful response returns HTTP 200 OK
, along with XYZ.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
The response has no body.
Response body properties
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Address book properties updated successfully. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Create address book association
Associate an address book with the specified unit.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To create an association, you make a POST
request to the /v1/addressBooks/{addressBookId}/unitAssociations
resource.
Request path and header example
POST /v1/addressBooks/{addressBookId}/unitAssociations HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"unitId": "amzn1.alexa.unit.did.101"
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Identifies the unit to associate with the address book. |
String |
Yes |
Response
A successful response returns HTTP 201 Created
, along with the association.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
{
"unitId": "amzn1.alexa.unit.did.101",
"addressBookId": "amzn1.alexa.addressbook.did.1234"
}
Response body properties
Property | Description | Type |
---|---|---|
|
Identifies the unit to associate with the address book. |
String |
|
Identifies the address book. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the unit - address book association. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Create address book associations in bulk
Associate the specified address book with up to 100 units.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To create associations, you make a POST
request to the /v1/addressBooks/{addressBookId}/unitAssociations/batch
resource.
Request path and header example
POST /v1/addressBooks/{addressBookId}/unitAssociations/batch HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"items": [{
"itemId": 1,
"unitId": "amzn1.alexa.unit.did. 101"
},
{
"itemId": 2,
"unitId": "amzn1.alexa.unit.did.102"
}
]
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
List of units to associate with the address book. |
Array of objects |
Yes |
|
Unique identifier for the contact, usually a sequence of numbers starting from 1. |
Integer |
Yes |
|
Identifies the unit to associate with the address book. |
String |
Response
A successful response returns HTTP 200 OK
, along with the list of associations.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body examples
The following example shows a successful response with contact IDs assigned to each item.
The following example shows a response body with both success and error message at the individual item level. Both results
and errors
properties can coexist in the same response.
The following example shows a response body with all items failed.
The following example shows an error response body for an entire request, not for individual items.
Response body properties
Property | Description | Type |
---|---|---|
|
List of success results. |
Array of objects |
|
(Optional) Unique identifier from the request. Use to associate the request item with the response item. Not included if the error is at the request level. |
Integer |
|
Identifies the unit associated with the address book. |
String |
|
Identifies the address book. |
String |
|
(Optional) List of error results. |
Array of objects |
|
(Optional) Unique identifier from the request. Use to associate the request item with the response item. |
Integer |
|
HTTP response code for the failed request item. |
Integer |
|
Type of error that occurred. |
String |
|
Human-readable error message. The error message appears only for debugging and logging purposes. You must not share it with the customer. No business logic should depend on the content of the error description. |
String |
Error property values for individual items
status
|
errorCode
|
errorDescription
|
---|---|---|
|
|
UnitId is not valid. Please check your Input. |
|
|
UnitId is mandatory |
|
|
Requested action cannot be performed as you don't have access over the specified resource. |
|
|
UnitId doesn't exist |
|
|
AddressBook is already associated with the unit |
|
|
An internal service error occurred. |
HTTP status codes
Status | Description |
---|---|
|
Associations created successfully. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Delete address book association
Remove the association between an address book and a unit.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To remove an association, you make a DELETE
request to the /v1/addressBooks/{addressBookId}/unitAssociations
resource.
Request path and header example
DELETE /v1/addressBooks/{addressBookId}/unitAssociations?unitId={unitId} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Query |
Identifies the unit. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 204 No Content
.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
The response has no body.
Response body properties
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Association deleted successfully. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
List address book associations for a unit
Get a list of address books associated with the specified unit.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To get associations, you make a GET
request to the /v1/addressBooks/unitAssociations
resource.
Request path and header example
GET /v1/addressBooks/unitAssociations?unitId={unitId}&maxResults={maxResults}&nextToken={nextToken} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Query |
Identifies the unit. |
String |
Yes |
|
Query |
Maximum number of results to return in the response. |
Integer |
No |
|
Query |
Token from the previous response. |
String |
No |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with a list of address book associations.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
{
"results": [{
"unitId": "amzn1.alexa.unit.did.101",
"addressBookId": "amzn1.alexa.addressbook.did.1234"
},
{
"unitId": "amzn1.alexa.unit.did.101",
"addressBookId": "amzn1.alexa.addressbook.did.1235"
}
],
"paginationContext": {
"nextToken": "someToken.2"
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
List of associations. |
Array of objects |
|
Identifies the unit associated with the address book. |
String |
|
Identifies the address book. |
String |
|
Indicates whether there are more results to return. |
Object |
|
Included when the response is truncated. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the unit - address book associations. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
List unit associations for an address book
Get the list of unit associations for the specified address book. You can optionally specify the unit ID to get the association for a specific unit.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To get associations, you make a GET
request to the /v1/addressBooks/{addressBookId}/unitAssociations
resource.
Request path and header example
GET /v1/addressBooks/{addressBookId}/unitAssociations?unitId={unitId}&maxResults={maxResults}&nextToken={nextToken} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Query |
Identifies the unit. |
String |
No |
|
Query |
Maximum number of results to return in the response. |
Integer |
No |
|
Query |
Token from the previous response. |
String |
No |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with a list of unit associations for the specified address book.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
{
"results": [{
"unitId": "amzn1.alexa.unit.did.101",
"addressBookId": "amzn1.alexa.addressbook.did.1234"
},
{
"unitId": "amzn1.alexa.unit.did.102",
"addressBookId": "amzn1.alexa.addressbook.did.1234"
},
{
"unitId": "amzn1.alexa.unit.did.103",
"addressBookId": "amzn1.alexa.addressbook.did.1234"
}
],
"paginationContext": {
"nextToken": "someToken.2"
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
List of associations. |
Array of objects |
|
Identifies the unit associated with the address book. |
String |
|
Identifies the address book. |
String |
|
Indicates whether there are more results to return. |
Object |
|
Included when the response is truncated. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the unit - address book associations. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Create contact
Add a contact to the specified address book. A contact can be an address book entry that represents a callable Alexa-enabled device, PSTN number, or WebRTC endpoint. You can create a contact with a phone number, communication profile, or service provider contact ID for WebRTC calling.
phoneNumbers
object in requests for France (fr-FR).This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To create a contact, you make a POST
request to the /v1/addressBooks/{addressBookId}/contacts
resource.
Request path and header example
POST /v1/addressBooks/{addressBookId}/contacts HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body examples
The following examples show requests to create a contact in the specified address book. You can define a contact as a phone number, communication profile, or WebRTC service provider.
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Contact to create.
Include one type of contact: |
Object |
Yes |
|
Contact name. |
String |
Yes |
|
Contact phone number. Note: You can't include a phone number in
fr-FR . |
String |
No |
|
Identifies the communication profile for a unit. |
String |
No |
|
Include for WebRTC calling only. |
Object |
No |
|
Internal ID of the service provider. |
String |
No |
Response
A successful response returns HTTP 201 Created
, along with the contact ID.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
{
"contactId": "amzn1.alexa.contact.did.1101"
}
Response body properties
Property | Description | Type |
---|---|---|
|
ID that represents the contact. |
String |
HTTP status codes
Status | Description |
---|---|
|
Reciprocal association created successfully. |
|
Indicates that one or more properties in the request body aren't valid.
|
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Create contacts in bulk
Create address book contacts in bulk. You can create up to 100 contacts in a single request. A contact is an address book entry that represents a callable Alexa-enabled device or PSTN number. You can create a contact with a phone number or a communication profile.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To create multiple contacts, you make a POST
request to the /v1/addressBooks/{addressBookId}/contacts/batch
resource.
Request path and header example
POST /v1/addressBooks/{addressBookId}/contacts/batch HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"items": [{
"itemId": 1,
"contact": {
"name": "Mary - Room 202",
"phoneNumbers": [{
"number": "+15555551212"
},
{
"number": "+15555551213"
}
]
}
},
{
"itemId": 2,
"contact": {
"name": "Bob - Room 203",
"alexaCommunicationProfileId": "amzn1.alexa.communications.profile.did.1234"
}
}
]
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
List of contacts to add to the address book. |
Array of objects |
Yes |
|
Unique identifier for the contact, usually a sequence of numbers starting from 1. |
Integer |
Yes |
|
Contact to create.
Include one type of contact per item: |
Object |
Yes |
|
Contact name. |
String |
Yes |
|
Contact phone number. Note: You can't include a phone number in
fr-FR . |
String |
No |
|
Identifies the communication profile for a unit. |
String |
No |
|
Include for WebRTC calling only. |
Object |
No |
|
Internal ID of the service provider. |
String |
No |
Response
A successful response returns HTTP 201 Created
, along with the list of contact IDs.
For overall request failure, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error. If errors occur for individual items, the response body includes the success and error items.
Response body examples
The following example shows a successful response with contact IDs assigned to each item.
The following example shows a response body with both success and error message at the individual item level. Both results
and errors
properties can coexist in the same response.
The following example shows a response body with all items failed.
The following example shows an error response body for an entire request, not for individual items.
Response body properties
Property | Description | Type |
---|---|---|
|
List of success results. |
Array of objects |
|
(Optional) Unique identifier from the request. Use to associate the request item with the response item. Not included if the error is at the request level. |
Integer |
|
Unique identifier for the contact. |
String |
|
(Optional) List of error results. |
Array of objects |
|
(Optional) Unique identifier from the request. Use to associate the request item with the response item. |
Integer |
|
HTTP response code for the failed request item. |
Integer |
|
Type of error that occurred. |
String |
|
Human-readable error message. The error message appears only for debugging and logging purposes. You must not share it with the customer. No business logic should depend on the content of the error description. |
String |
Error property values for individual items
status
|
errorCode
|
errorDescription
|
---|---|---|
|
|
Contact must have at least one PhoneNumber or a CommunicationProfileId. |
|
|
A Contact can't contain both PhoneNumber and a CommunicationProfileId. You must add either one. |
|
|
AlexaCommunicationProfileId isn't in standard format. |
|
|
Given phone number is not per E.164 format. |
|
|
Contact is mandatory. |
|
|
Contact Name must be between 1 and 50 characters. |
|
|
Number of phone numbers must be between 1 and 3. |
|
|
ItemId is mandatory for all request items. |
|
|
ItemId should be unique for each request item. Multiple requests with itemId [X] present. |
|
|
Request item list size must be between 1 to 100. |
|
|
Requested action cannot be performed as you don't have access over the specified resource. |
|
|
An internal service error occurred. |
HTTP status codes
Status | Description |
---|---|
|
Reciprocal association created successfully. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Delete contact
Delete a contact from the specified address book.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To delete a contact, you make a DELETE
request to the /v1/addressBooks/{addressBookId}/contacts/{contactId}
resource.
Request path and header example
DELETE /v1/addressBooks/{addressBookId}/contacts/{contactId} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Path |
Identifies the contact. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 204 No Content
.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
The response has no body.
Response body properties
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Contact deleted successfully. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Get contact
Get the details of the specified contact from the address book.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
Phone number supported: US, UK, CA, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To get a contact, you make a GET
request to the /v1/addressBooks/{addressBookId}/contacts/{contactId}
resource.
Request path and header example
GET /v1/addressBooks/{addressBookId}/contacts/{contactId} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Path |
Identifies the contact. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with the details of the specified contact.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body examples
The following examples show contact details: phone number, communication profile, or WebRTC service provider.
Response body properties
Property | Description | Type |
---|---|---|
|
Contact to create.
Includes one type of contact: |
Object |
|
Contact name. |
String |
|
(Optional) Contact phone number. Note: You can't include a phone number in
fr-FR |
String |
|
(Optional) Identifies the communication profile for a unit. |
String |
|
(Optional) Included for WebRTC calling only. |
Object |
|
Internal ID of the service provider. |
String |
|
Uniquely identifies the contact. |
Integer |
HTTP status codes
Status | Description |
---|---|
|
Response body contains a list of contacts from the specified address book. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
List contacts
Get the list of contacts for a given address book.
phoneNumbers
object isn't returned in requests for France (fr-FR).This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, CA, IT, DE, ES, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To list contacts, you make a GET
request to the /v1/addressBooks/{addressBookId}/contacts
resource.
Request path and header example
GET /v1/addressBooks/{addressBookId}/contacts?maxResults={maxResults}&nextToken={nextToken} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Query |
Maximum number of results to return in the response. |
Integer |
No |
|
Query |
Token from the previous response. |
String |
No |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
The request has no body.
Request body properties
The request has no body.
Response
A successful response returns HTTP 200 OK
, along with a list of contacts.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
{
"results": [{
"contactName": "Example Contact Name 1",
"contactId": "amzn1.alexa.contact.did.1101"
},
{
"contactName": "Example Contact Name 2",
"contactId": "amzn1.alexa.contact.did.1234"
},
{
"contactName": "Example Contact Name 3",
"contactId": "amzn1.alexa.contact.did.1235"
}
],
"paginationContext": {
"nextToken": "someToken.1"
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
List of contacts. |
Array of objects |
|
Name of the contact. |
String |
|
Unique identifier for the contact. |
String |
|
Indicates whether there are more results to return. |
Object |
|
Included when the response is truncated. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains a list of contacts from the specified address book. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Update contact
Update the metadata for the specified contact in an address book.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
Phone number supported: US, UK, CA, JP |
US, UK, FR, CA, IT, DE, ES, JP |
US |
Request
To update a contact, you make a PUT
request to the /v1/addressBooks/{addressBookId}/contacts/{contactId}
resource.
Request path and header example
PUT /v1/addressBooks/{addressBookId}/contacts/{contactId} HTTP/1.1
Host: api.amazonalexa.com
Accept: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Identifies the address book. |
String |
Yes |
|
Path |
Identifies the contact. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body examples
The following examples show requests to update a contact in the specified address book. You can define a contact as a phone number, communication profile, or WebRTC service provider.
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Contact to create.
Include one type of contact: |
Object |
Yes |
|
Contact name. |
String |
Yes |
|
Contact phone number. Note: You can't include a phone number in
fr-FR . |
String |
No |
|
Identifies the communication profile for a unit. |
String |
No |
|
Include for WebRTC calling only. |
Object |
No |
|
Internal ID of the service provider. |
String |
No |
Response
A successful response returns HTTP 200 OK
, along the updated contact.
On error, the response returns the appropriate HTTP status code and includes a response body with a message
string that describes the error.
Response body example
The response has no body.
Response body properties
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Response body contains a list of contacts from the specified address book. |
|
Indicates that one or more properties in the request body aren't valid. |
|
Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource. |
|
Indicates that the authorization token is valid, but the requested operation isn't allowed. |
|
Requested resource not found. |
|
Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off. |
|
Error occurred on the server. You can retry the request by using exponential back-off. |
|
Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request. |
Related topics
Last updated: frontmatter-missing