Requests & Responses

Requests

Consistent with the RESTful ideology, resources are exposed via HTTP endpoints. The action that is performed on a resource is controlled via the request's HTTP method.

For GET requests, data is transmitted via query variables. For POST, PUT and DELETE delete requests, data is transmitted in JSON form via the request's body.

Success Responses

The following table illustrates the expected responses indicating the request has been successfully performed.

Request MethodResponse CodeResponse Headers
GET200 OK
POST201 CreatedThe response will contain the Location header indicating the URI of the newly created resource.
PUT200 OK
DELETE204 No Content

Error Responses

The following table illustrates potential error responses and provides a general description of when they occur.

Response CodeDescription
401 Unauthorized When the request cannot be authenticated and/or the requestor is not authorized to perform the requested action.
When the credentials provided to obtain an access token are incorrect.
When the Authorization header is missing or the token is invalid.
When the client or resource owner does not have permission to perform the requested action.
404 Not Found When the requested HTTP method + HTTP endpoint is invalid/unimplemented.
When the requested resource does not exist.
429 Too Many Requests* When the requestor has exceeded the rate limit.
500 Server Error* When the API encounters an unrecoverable error while processing a request. SkySwitch developers will automatically be informed when the API responds in this capacity.

The body of the error response will contain a message parameter, suitable for displaying to the end user.

{
  "error": "Validation failed on the following fields: The npa must be 3 digits. The nxx must be 3 digits."
}