Account Association REST API Reference
Use the Account Association REST API to manage account associations between your service provider for Web Real-Time Communication (WebRTC) calling and endpoints on your Alexa Smart Properties (ASP) network.
To use this API, you must enable the WebRTC add-on subscription. For more details, see WebRTC Calling in Alexa Smart Properties.
API endpoint
The endpoint of the Account Association API is https://api.amazonalexa.com
.
Authentication
Each API request must have an authorization header whose value is the access token retrieved from Login with Amazon (LWA). For details, see Access the Alexa Smart Properties REST APIs.
Access to WebRTC calling is based on the permission scopes enabled for your skill and granted by the customer. Include the following additional permission scope when you request an access token.
Permission scope | Description |
---|---|
|
Allows your skill to access WebRTC calling. |
Operations
The Account Association API supports the following operations.
Operation | HTTP method and URI |
---|---|
| |
| |
| |
|
Create account association
Create an association between a specific Alexa communication profile and an endpoint on your network. You can create your communication profile by using the Create a communication profile operation.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, IT, DE, ES |
US, UK, FR, IT, DE, ES |
US |
Request
To create an account association, you make a POST
request to the /v1/communications/serviceProviders/{serviceProviderId}/externalUsers
resource.
Request path and header example
POST /v1/communications/serviceProviders/{serviceProviderId}/externalUsers HTTP/1.1
Host: api.amazonalexa.com
Content-type: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Internal ID of the service provider. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"externalUserId": "7201",
"amazonId": "amzn1.alexa.communications.profile.did.1234",
"amazonIdType": "communication-profile"
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Unique identifier representing an endpoint in your network that can make or receive WebRTC calls.
|
String |
Yes |
|
Unique Amazon communication profile ID to attach to the association. |
String |
Yes |
|
Describes the type of |
String |
Yes |
Response
A successful response returns HTTP 201 Created
.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
The response has no body.
Response body properties
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
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. |
|
Requested |
|
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 account association
Delete the association between an Alexa communication profile and an endpoint on your network.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, IT, DE, ES |
US, UK, FR, IT, DE, ES |
US |
Request
To delete an association, you make a DELETE
request to the /v1/communications/serviceProviders/{serviceProviderId}/externalUsers
resource.
Request path and header example
DELETE /v1/communications/serviceProviders/{serviceProviderId}/externalUsers HTTP/1.1
Host: api.amazonalexa.com
Content-type: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Internal ID of the service provider. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"externalUserId": "7201"
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Unique identifier representing an endpoint in your network that can make or receive WebRTC calls.
|
String |
Yes |
Response
A successful response returns HTTP 200 OK
.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
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. |
Query account association
Return association details for the specified query filter.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, IT, DE, ES |
US, UK, FR, IT, DE, ES |
US |
Request
To query account association, you make a POST
request to the /v1/communications/serviceProviders/{serviceProviderId}/externalUsers/query
resource.
Request path and header example
POST /v1/communications/serviceProviders/{serviceProviderId}/externalUsers/query HTTP/1.1
Host: api.amazonalexa.com
Content-type: application/json
Authorization: Bearer {access token}
Request path and header parameters
Parameter | Located in | Description | Type | Required |
---|---|---|---|---|
|
Path |
Internal ID of the service provider. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"filters": {
"externalUserIds": ["TestUserId@test.com"]
}
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Query filter to use to get account association details. |
Object |
Yes |
|
List of unique identifiers that represent endpoints in your network that can make or receive WebRTC calls. You can specified 1–30 IDs.
|
Array of strings |
No |
|
Information about pagination. |
Object |
No |
|
Token from the previous response. |
String |
No |
|
Maximum number of results to return in the response. |
Integer |
No |
Response
A successful response returns 200 OK
, along with the list of account associations.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"paginationContext": {
"totalCount": 1,
"nextPageToken": "0"
},
"accountAssociations": [
{
"externalUserId": "TestUserId@test.com",
"amazonId": "amzn1.alexa.communications.profile.did.1234",
"amazonIdType": "communication-profile"
}
]
}
Response body properties
Property | Description | Type |
---|---|---|
|
Information about pagination. |
Object |
|
Total number of user IDs associated with the account. |
Number |
|
Use this value in a subsequent request to get the next page of results. |
String |
|
List of account associations. |
Array of objects |
|
Unique identifier representing an endpoint in your network that can make or receive WebRTC calls. |
String |
|
Amazon communication profile ID. |
String |
|
Describes the type of |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains a list of associations based on the filter criteria in the request. |
|
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 account association
Update an existing endpoint with a new Alexa communication profile.
This operation is available in the following countries.
Healthcare | Hospitality | Senior Living | Core |
---|---|---|---|
US |
US, UK, FR, IT, DE, ES |
US, UK, FR, IT, DE, ES |
US |
Request
To update an association, you make a PUT
request to the /v1/communications/serviceProviders/{serviceProviderId}/externalUsers
resource.
Request path and header example
PUT /v1/communications/serviceProviders/{serviceProviderId}/externalUsers 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 |
Internal ID of the service provider. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"externalUserId": "7201",
"amazonId": "amzn1.alexa.communications.profile.did.ABC9876",
"amazonIdType": "communication-profile"
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
List of unique identifiers that represent endpoints in your network that can make or receive WebRTC calls.
|
String |
Yes |
|
Unique Amazon communication profile ID to attach to the association. |
String |
Yes |
|
Describes the type of |
String |
Yes |
Response
A successful response returns HTTP 200 OK
.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
The response has no body.
Response body properties
The response has no body.
HTTP status codes
Status | Description |
---|---|
|
Update completed 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. |
Object definitions
The Account Association API defines the following object definitions.
Error object
The Error
object defines the error type and message included in the response when an error occurs.
The following example shows the response body.
{
"type": "BAD_REQUEST",
"message": "The request is malformed or is missing any required parameters."
}
Property | Description | Type |
---|---|---|
|
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 message. |
String |
Related topics
- WebRTC Calling in Alexa Smart Properties
- About Alexa Smart Properties
- Account Linking for Custom Skills
- Self-Service Onboarding API Reference for Alexa Smart Properties
- Create and Manage Skills in the Developer Console
Last updated: Dec 04, 2024