Service Provider Network Mapping REST API Reference
Use the Service Provider Network Mapping REST API to manage service provider network mappings for Alexa Smart Properties (ASP) Web Real-Time Communication (WebRTC) calling. Before you use this API, make sure that you create the service provider ID. For more details, see Self-Service Onboarding REST API Reference.
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 Service Provider Network Mapping 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 Service Provider Network Mapping API supports the following operations.
Operation | HTTP method and URI |
---|---|
| |
| |
| |
|
Create network mapping
After you create a serviceProviderId
by using the Create service provider operation, you can create network mappings. For skill-based WebRTC calling, you map the skillID
with the serviceProviderId
.
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 network mapping, you make a POST
request to the /v1/communications/serviceProviders/{serviceProviderId}/network
resource.
Request path and header example
POST /v1/communications/serviceProviders/{serviceProviderId}/network 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 identifier of the service provider. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"networkType": "SKILL",
"skillConfiguration": {
"skillId": "amzn1.ask.skill.1"
}
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Type of network for WebRTC skill-based calling. |
String |
Yes |
|
Skill configuration details |
Object |
Yes |
|
Skill ID to which you want to map your service provider ID. |
String |
Yes |
Response
A successful response returns HTTP 201 Created
, along with the status of the request.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"serviceProviderId": "amzn1.comms.csp.id.2",
"status": "ACTIVE"
}
Response body properties
Property | Description | Type |
---|---|---|
|
Unique identifier for the service provider. |
String |
|
Request status. |
String |
HTTP status codes
Status | Description |
---|---|
|
Mapping 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 network mapping
Delete an existing mapping between a service provider and a skill.
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 a service provider ID, you make a DELETE
request to the /v1/communications/serviceProviders/{serviceProviderId}/network
resource.
Request path and header example
DELETE /v1/communications/serviceProviders/{serviceProviderId}/network 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 identifier of the service provider. |
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 status of the target.
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 |
---|---|
|
Service provider ID 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 network mapping
Get the skill associated with the specified service provider.
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 get the network mapping, you make a GET
request to the /v1/communications/serviceProviders/{serviceProviderId}/network
resource.
Request path and header example
GET /v1/communications/serviceProviders/{serviceProviderId}/network 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 identifier of the service provider. |
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 network mapping.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"networkType": "SKILL",
"skillConfiguration": {
"skillId": "amzn1.ask.skill.1"
}
}
Response body properties
Property | Description | Type |
---|---|---|
|
Type of network for WebRTC skill-based calling. |
String |
|
Skill ID mapped to the specified service provider ID. |
String |
HTTP status codes
Status | Description |
---|---|
|
Response body contains the network mapping. |
|
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 network mapping
Modify an existing service provider network mapping to skill.
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 service provider mapping, you make a PUT
request to the /v1/communications/serviceProviders/{serviceProviderId}/network
resource.
Request path and header example
PUT /v1/communications/serviceProviders/{serviceProviderId}/network 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 identifier of the service provider. |
String |
Yes |
|
Header |
Access token for the customer. |
String |
Yes |
Request body example
{
"networkType": "SKILL",
"skillConfiguration": {
"skillId": "amzn1.ask.skill.4"
}
}
Request body properties
Property | Description | Type | Required |
---|---|---|---|
|
Type of network for WebRTC skill-based calling. |
String |
Yes |
|
Skill configuration details |
Object |
Yes |
|
New Skill ID to which you want to map your service provider ID. |
String |
Yes |
Response
A successful response returns HTTP 200 OK
, along with the details of the network mapping.
On error, the response returns the appropriate HTTP status code and includes a response body with an Error object.
Response body example
{
"serviceProviderId": "amzn1.comms.csp.id.2",
"status": "ACTIVE"
}
Response body properties
Property | Description | Type |
---|---|---|
|
Unique identifier for the service provider. |
String |
|
Request status. |
String |
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 Service Provider Network Mapping 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
- 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