Resource Schema Information and Validation

You can use the Alexa Skills Kit Command Line Interface (ASK CLI) or the Alexa Skill Management API (SMAPI) to manage your Alexa skill. Your Alexa skill is represented by a skill manifest which conforms to a schema. When you call a CLI or SMAPI command that requires a skill manifest as an argument, errors can occur if your schema is incorrect.

You can also manage your skill by using the ASK SDKs and Toolkits. When you work with your skill locally, it is represented as a skill package which conforms to a directory structure. When you try to work with a skill package, errors can occur if your directory structure is incorrect.

Schema information is specific to your skill. For example, if you participate in a beta program, the manifest for your skill might require data specific to the beta program, while the manifest for a similar skill does not. Before you call a CLI or SMAPI command, or work with a skill package locally, you can get information about the schema or directory structure that your skill requires. You can use this information to validate your schema or directory structure before errors occur.

This document describes the resourceSchema API. You can also get schema and skill package information by using the get-resource-schema CLI command.

Get resource schema

Get resource schema request

To request schema information for a skill resource, send a GET request to api.amazonalexa.com/v1/skills/resourceSchema/. Your header must contain an access token. For details, see Get an Access Token for SMAPI.

Get resource schema request example

GET / HTTP/1.1
Host: api.amazonalexa.com/v1/skills/resourceSchema/<resource>?operation=<operationName>&vendorId=<vendorId>
Content-type: application/json
Accept: application/json
Authorization: <access token>
{
}

Get resource schema request parameters

Parameter Description Type Required?
resource The resource that you want information for. One of manifest, skillPackageStructure. String Yes
operation The operation that you want the manifest schema for. The manifest schema is different for different operations. For example, when you submit your skill for certification there are more schema validations than when you first create your skill. One of CREATE_SKILL, UPDATE_SKILL, ENABLE_SKILL, SUBMIT_SKILL. String Yes when resource is manifest.
vendorId Specify your vendor ID to include schema specific to any beta features that you have access to. String Yes

Get resource schema response

Get resource schema response example

HTTP/1.1 200 OK
Content-Type: application/json
Location: v1/skills/resourceSchema/manifest
{
  "expiryTime": "2020-10-29T06:38:35.549Z", 
  "schemaLocationUrl": "<url>"
}

Get resource schema response fields

Field Description Type
schemaLocationUrl The schema information is provided at a presigned URL. The URL that contains your information is valid for 60 minutes. String
expiryTime The time when the url expires, specified in UTC. A string in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ.

Errors

The following table lists the error status codes you can receive.

HTTP response status code Description
400 Bad Request The message is invalid, possibly due to missing fields, incorrect values, or malformed JSON.
401 Unauthorized The access token isn't valid because it is expired or malformed. Refresh your token and retry the request.
403 Forbidden You don't have access to the specified vendorId.
429 Too Many Requests The number of requests is too high. Resend the request up to three times, with at least a one-second interval between each send attempt.
500 Internal Server Error An error occurred with Alexa, and the message couldn't be processed. Resend the message up to three times, with at least a one-second interval between each send attempt.