Start a Connectivity Management Session:

POST /session/login

Initiates a Connectivity Management session and returns a VZ-M2M session token that is required in subsequent API requests.

Contents

See also:
Getting Credentials to use the API
End a Connectivity Management Session

Uses and Requirements

A session token will remain valid as long as your application continues to use it, but it will expire after 20 minutes of inactivity. The Best Practice for managing sessions is:

  • Send a /session/login request to authenticate and retrieve a VZ-M2M token.
  • Continue to use the same VZ-M2M token in other API requests.
  • Only retrieve a new VZ-M2M token if the ThingSpace Platform returns an error saying that the token is expired.

This is more efficient than logging in to get a new token before every API request.

NOTE: The VZ-M2M token is different from the ThingSpace API token that you must use to send API requests. API tokens are valid for one hour, so they have a different expiration schedule than VZ-M2M tokens. See the Getting Credentials page for more information about the two different tokens.

NOTE: The ThingSpace Platform will lock a contact record after 5 consecutive failed log in attempts. You must contact Verizon Support to get the record unlocked.

Request Components

HTTP Request

POST https://thingspace.verizon.com/api/m2m/v1/session/login

Resource and Query Parameters

None.

Header Parameters

None.

Request Body

The request body must contain the account username and password.

Parameter Name Data Type Description
username
required
string The username for authentication.
password
required
string The password for authentication.

Example Request

curl -X POST https://thingspace.verizon.com/api/m2m/v1/session/login \
  -H 'Authorization: Bearer d7bc43e9acc31aba9654fc5cd0d8c520' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
   "username": "zbeeblebrox",
   "password": "IMgr8"
}'

Success Responses

Status 200

Parameter Name Data Type Description
sessionToken string The identifier for the session that was created by the request. Store the sessionToken for use in the header of all other API requests.

Example Success Response

{
  "sessionToken": "bcce3ea6-fe4f-4952-bacf-eadd80718e83"
}

Failure Responses

Status 400

All error messages are returned in this format:

{
  "errorCode": "error code string",
  "errorMessage": "error message string"
}

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

Try It Out!