Get A List Of Codes

Get a List of Long Codes: GET /codes

Returns a list of all long codes owned by the current user. Codes are associated with services that you provide, and are required to send messages and to register callback listener endpoints.

Contents

See also:
Register a Callback Listener
Send an SMS Message

Request Components

HTTP Request

GET https://thingspace.verizon.com/api/messaging/v1/codes

Resource Path and Query Parameters

None.

Header Parameters

The request header must contain a current ThingSpace authorization bearer token.

Parameter Name Data Type Description
Authorization
required
string HTTP Authorization request header.

Request Body

None.

Success Responses

Status 200

A successful response contains an array of all long codes owned by the current user. The response body will be empty if there are no codes registered for the current user.

Parameter Name Data Type Description
code string A registered long code.

Example Success Response

{ 
  "codes": [
    {
      "code": "9038644951"
    },
    {
      "code": "9038641594"
    }
  ]
}

Failure Responses

Status 400

All error messages are returned in this format:

{
  "error": "The type of error, such as INVALID_REQUEST.",
  "error_description": "Additional error information.",
  "error_url": "Optional URI with more information about the error."
}

The error_url field will not be present if there is no URI for more information.

Error codes and messages are listed on the Status Codes page, along with explanations and suggestions for corrective actions.

Try It Out!