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

amazon_communication::service_provider

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

POST /v1/communications/serviceProviders/{serviceProviderId}/network

Delete network mapping

DELETE /v1/communications/serviceProviders/{serviceProviderId}/network

Get network mapping

GET /v1/communications/serviceProviders/{serviceProviderId}/network

Update network mapping

PUT /v1/communications/serviceProviders/{serviceProviderId}/network

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

Copied to clipboard.

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

serviceProviderId

Path

Internal identifier of the service provider.
Formatted as an Amazon Common Identifier (ACI), amzn1.comms.csp.id.{id}.

String

Yes

access token

Header

Access token for the customer.
Set to an LWA token.

String

Yes

Request body example

Copied to clipboard.

{
    "networkType": "SKILL",
    "skillConfiguration": {
        "skillId": "amzn1.ask.skill.1"
    }
}

Request body properties

Property Description Type Required

networkType

Type of network for WebRTC skill-based calling.
Valid value: SKILL.

String

Yes

skillConfiguration

Skill configuration details

Object

Yes

skillConfiguration.skillId

Skill ID to which you want to map your service provider ID.
Formatted as Amazon Common Identifier (ACI), amzn1.alexa.skill.did.{id}.
Valid values: 1 – 255 characters.

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

serviceProviderId

Unique identifier for the service provider.
Formatted as an Amazon Common Identifier (ACI), amzn1.comms.csp.id.{id}.

String

status

Request status.
Valid value: ACTIVE: The skill is linked with the service provider ID.

String

HTTP status codes

Status Description

201 Created

Mapping created successfully.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.

401 Unauthorized

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.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. You can retry the request by using exponential back-off.

503 Service Unavailable

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

Copied to clipboard.

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

serviceProviderId

Path

Internal identifier of the service provider.
Formatted as an Amazon Common Identifier (ACI), amzn1.comms.csp.id.{id}.

String

Yes

access token

Header

Access token for the customer.
Set to an LWA token.

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

200 OK

Service provider ID deleted successfully.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.

401 Unauthorized

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.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. You can retry the request by using exponential back-off.

503 Service Unavailable

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

Copied to clipboard.

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

serviceProviderId

Path

Internal identifier of the service provider.
Formatted as an Amazon Common Identifier (ACI), amzn1.comms.csp.id.{id}.

String

Yes

access token

Header

Access token for the customer.
Set to an LWA token.

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

networkType

Type of network for WebRTC skill-based calling.
Valid value: SKILL..

String

skillConfiguration.skillId

Skill ID mapped to the specified service provider ID.

String

HTTP status codes

Status Description

200 OK

Response body contains the network mapping.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.

401 Unauthorized

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.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. You can retry the request by using exponential back-off.

503 Service Unavailable

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

Copied to clipboard.

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

serviceProviderId

Path

Internal identifier of the service provider.
Formatted as an Amazon Common Identifier (ACI), amzn1.comms.csp.id.{id}.

String

Yes

access token

Header

Access token for the customer.
Set to an LWA token.

String

Yes

Request body example

{
    "networkType": "SKILL",
    "skillConfiguration": {
        "skillId": "amzn1.ask.skill.4"
    }
}

Request body properties

Property Description Type Required

networkType

Type of network for WebRTC skill-based calling.
Valid value: SKILL.

String

Yes

skillConfiguration

Skill configuration details

Object

Yes

skillConfiguration.skillId

New Skill ID to which you want to map your service provider ID.
Formatted as Amazon Common Identifier (ACI), amzn1.alexa.skill.did.{id}.
Valid values: 1 – 255 characters.

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

serviceProviderId

Unique identifier for the service provider.
Formatted as an Amazon Common Identifier (ACI), amzn1.comms.csp.id.{id}.

String

status

Request status.
Valid value: ACTIVE: The skill is linked with the service provider ID.

String

HTTP status codes

Status Description

200 OK

Update completed successfully.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.

401 Unauthorized

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.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as the number of requests per unit of time, exceeded. You can retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. You can retry the request by using exponential back-off.

503 Service Unavailable

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

Type of error that occurred.
For specific error types, see the HTTP status code table for each operation.

String

message

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


Was this page helpful?

Last updated: Dec 04, 2024