Standard APIsConnectivity ManagementAPI EndpointsDevice ManagementUsage Segmentation Label Association

API Reference

Set Usage Segmentation Labels

Uses and Requirements

Allow customers to associate a label to a device, ultimately to obtain billing and usage information for their own usage segments operated on devices operated by another party or customer. The customer assigning a label to a device is restricted to retrieving information for their usage segments, and cannot retrieve or access any other device information owned by another party.

For example, this API can be used for the automotive sector in cases where a streaming radio device is present.

You must register for the CarrierService callback service to receive the callback response.

Request Components

HTTP Request

POST https://thingspace.verizon.com/api/m2m/v1/devices/actions/usagesegmentationlabels )

Resource Path and Query Parameters

None.

Header Parameters

The request header must contain a current ThingSpace authorization bearer token and a valid VZ-M2M session token, and must set the content-type to JSON.

Parameter NameData TypeDescription
Authorization requiredstringHTTP Authorization bearer token.
VZ-M2M-Token requiredstringA valid session token returned by POST /session/login.
Content-Type requiredstringMust be application/json.

Request Body Parameters

Parameter NameData TypeDescription
accountName requiredstringThe name of a billing account. An account name is usually numeric, and must include any leading zeros.
labels requiredArray of deviceIds and label objectsMaximum of 2,000 objects are allowed in the array.
deviceId requireddeviceId objectAn identifier for a single device.
deviceId.kind, deviceId.id required for deviceIdstringThe type and value of the device identifier. Valid value is: EID - 32 digits
label.nameVarchar(20)The label you want to associate with the device.
label.valueVarchar (50)The label value.

Example Request Body

{
   "accountName":"9231221278-99990",
   "labels":[
      {
         "deviceIds":[
            {
               "id":"3029423189477699229543109876975",
               "kind":"EID"
            }
         ],
         "label":{
            "name":"VIN",
            "value":"XX1TFCFL5EA137745"
         }
      },
      {
         "deviceIds":[
            {
               "id":"29183120783667588118432098765864",
               "kind":"EID"
            }
         ],
         "label":{
            "name":"VIN",
            "value":"XXUZL54B5YN105457"
         }
      }
   ]
}

Success Responses

Status 200

A successful request returns the request ID.

Parameter NameData TypeDescription
requestIdstringA unique string that associates the request with the results that are sent via a callback message.

Callback Parameters

Parameter NameData TypeDescription
username requiredstringThe username for authentication.
password requiredstringThe password for authentication.
requestId requiredstringThe unique ID of the asynchronous request.
deviceResponsearray of usageSegmentationLabelsResponse objectsSummary of status of the device and label assignment.
usagesegmentationlabelsResponsearray of usageSegmentationLabels objectsThe response of usage segmentation label assignment.
usageSegmentationLabelsarray of deviceId and label objects.
deviceIdsAll identifiers for the device.
deviceIds.kindstringThe type of the device identifier. Valid types of identifiers are: EID - 32 digits
deviceIds.idstringThe value of the device identifier.
label.nameVarchar(20)The label you want to associate with the device.
label.valueVarchar(50)The label value.
actionstringThe type of action you are taking with the label. Valid values include: set
lineStatusstringIndicates the status of the label action. Valid values include: Success Failed(with description of failure)
totalLabelCountstringThe total number of labels.
failedLabelCountstringThe total number of failed label assignments.
successLabelCountstringThe total number of successful label assignments.
statusstringThe status of the request response. Valid values include: Success – The operation was completed and the asynchronous response was returned. Failed – LineStatus would also indicate failed.
callbackCountintegerTotal number of callback requests.
maxCallbackThresholdintegerMaximum number of callbacks allowed.

Example Callback Request

The CarrierService sends the callback.

{
   "username":"foo",
   "password":"bar",
   "requestId":"595f5c44-c31c-4552-8670-020a1545a84d",
   "deviceResponse":{
      "usageSegmentationLabelsResponse":{
         "usageSegmentationLabels":[
            {
               "deviceIds":[
                  {
                     "id":"3029423189477699229543109876975",
                     "kind":"EID"
                  }
               ],
               "label":{
                  "name":"VIN",
                  "value":"XX1TFCFL5EA137745"
               },
               "action":"Set",
               "lineStatus":"Success"
            },
            {
               "deviceIds":[
                  {
                     "id":"29183120783667588118432098765864",
                     "kind":"EID"
                  }
               ],
               "label":{
                  "name":"VIN",
                  "value":"XXUZL54B5YN105457"
               },
               "action":"Set",
               "lineStatus":"Failed",
               "description":"The device does not exist"
            }
         ],
         "totalLabelCount":"2",
         "failedLabelCount":"1",
         "successLabelCount":"1"
      }
   },
   "status":"Success",
   "callbackCount":1,
   "maxCallbackThreshold":4
}

On this page