Assign licenses to devices:

POST /licenses/{account}/assign

Assigns licenses to a specified list of devices so that firmware upgrades can be scheduled for those devices.

Note: This request is only needed for accounts that have a monthly recurring charge (MRC) subscription. Accounts with event-based billing do not need to assign licenses.

Contents

See also:
Schedule a firmware upgrade
Remove licenses from devices
Get a list of devices

Uses and Requirements

The account must have unused licenses available to assign to the devices. You can get the total number of licenses and the number of used licenses with the GET /licenses/{account} request.

Request Components

HTTP Request

POST https://thingspace.verizon.com/api/fota/v1/licenses/{account}/assign

Resource Path and Query Parameters

You must include the account name in the path.

Parameter Name Data Type Description
account
required
string The name of the account for which you want to assign licenses. An account name is usually numeric, and must include any leading zeros.

Header Parameters

The request header must contain a current ThingSpace authorization token and a current VZ-M2M session token, and must set the Content-Type to JSON.

Parameter Name Data Type Description
Authorization
required
string HTTP Authorization request header containing a valid Bearer token.
VZ-M2M-Token
required
string A valid session token returned by a Connectivity Management POST /session/login request.
Content-Type
required
string Must be application/json.

Request Body

The request body identifies the devices to assign licenses to.

Parameter Name Data Type Description
deviceList
required
array of IMEI strings The IMEIs of the devices to assign licenses to.

Example Request

Assign licenses to two devices:

curl https://thingspace.verizon.com/api/fota/v1/licenses/$ACCOUNT/assign -H 'Authorization: Bearer $AUTH_TOKEN' -H 'VZ-M2M-Token: $M2M_TOKEN' -H 'Content-Type: application/json' -d 
{
  "deviceList": [
    "990003425730535", 
    "990000473475989"
  ]
}

Success Responses

Status 200

A success response includes this information:

Parameter Name Data Type Description
accountName string The name (number) of the billing account.
licCount integer The total number of monthly licenses in the MRC subscription.
licUsedCount integer The number of licenses assigned to devices.
deviceList array of objects A JSON object for each device that was in the request
deviceId
string The IMEI of the device.
status
string “LicenseAssignSuccess” or “LicenseAssignFailed.
Reason
string More information about the status, such as “Success” “Device license preexisting” or a reason for a failure, such as “Device Not Found.”

Example Success Response

{
  "accountName": "0242078689-00001",
  "licCount": 9000,
  "licUsedCount": 1000,
  "deviceList": [
      {
          "deviceId": "900000000000001",
          "status": "LicenseAssignSuccess",
          "Reason": "Success"
      },
      {
          "deviceId": "900000000000999",
          "status": "LicenseAssignSuccess",
          "Reason": "Success"
      }
  ]
}

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.