Update a Subscription

Update a subscription:
PATCH /subscriptions

Update an existing subscription resource.

See also:
Create a subscription
Create a target
Query subscriptions
Delete a subscription

Uses and Requirements

Request Components

HTTP Request

PATCH https://thingspace.verizon.com/api/cc/v1/subscriptions

Resource Path and Query Parameters

None.

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.

Property Name Data Type Description
Authorization
required
string HTTP Authorization request header containing a valid ThingSpace Bearer token.
VZ-M2M-Token
required
string A valid session token returned by a Connectivity Management API POST /session/login request using the account’s UWS credentials.
Content-Type
required
string Must be application/json.

Request Body

The request body must include the UUID of the subscription that you want to update plus any properties that you want to change.

Property Name Data Type Description
accountidentifier
required
JSON object The ID of the authenticating billing account, in the format {"billingaccountid":"1234567890-12345"}.
resourceidentifier
required
JSON object The ID of the subscription to upate, in the format {"id": "dd1682d3-2d80-cefc-f3ee-25154800beff"}.
description
optional
string A new description for the subscription.
disabled
optional
boolean Enable or disable the subscription. A disabled subscription will not send any data.
name
optional
string A new name of the subscription.

Example Request

Disable a subscription

curl -X PATCH https://thingspace.verizon.com/api/cc/v1/subscriptions \
  -H 'Authorization: Bearer 506be090c32836bad23e1bcbbe829820' \
  -H 'VZ-M2M-Token: 87734bdb-9c00-4f9a-96f1-d2cc800624b8' \
  -H 'Content-Type: application/json' \
  -d '{
    "accountidentifier": {"billingaccountid":"1223334444-00001"},
    "resourceidentifier": {"id":"58a155ee-6959-6fb2-ef25-aeaa896668b9"},
    "disabled": true
  }'

Success Responses

Status 200

A success response includes the full subscription resource definition.

Property Name Data Type Description
configurationfailures integer The number of streaming failures due to faulty configuration.
createdon string, date-time The date the resource was created.
delegateid string Not currently used.
description string Description of the subscription.
disabled boolean Whether the subscription is currently sending data.
email string The address to which any error reports should be delivered.
filter string Filter for events.
groupid string ID of a tag resource for group-level streaming.
id string, UUID ThingSpace unique ID for the subscription that was created.
kind string Identifies the resource kind.
laststreamingstatus string Success or fail
laststreamingtime string, date-time The date and time that the last stream send was attempted.
lastupdated string, date-time The date the resource was last updated.
name string Name of the subscription.
networkfailures integer The number of failures due to network problems.
streamfailures integer
streamkind string, enum The event type that will be sent in the data stream.
targetid string Target to be used for dispatching events.
targettype string
version string, UUID Version of the underlying schema resource.
versionid string, UUID The version of the resource.

Example Success Response

{
  "configurationfailures": 0,
  "createdon": "2018-12-21T05:05:02.134Z",
  "disabled": true,
  "delegateid": "00000000-0000-0000-0000-000000000000",
  "id": "d8c145dd-6948-67ec-ed9b-6a298806bb4a",
  "kind": "ts.subscription",
  "laststreamingstatus": "",
  "laststreamingtime": "0001-01-01T00:00:00Z",
  "lastupdated": "2018-12-21T05:22:12.178Z",
  "networkfailures": 0,
  "streamfailures": 0,
  "streamkind": "ts.event",
  "targetid": "4e211a0e-e39d-6c32-e15b-d6f07f9e2ec8",
  "version": "1.0",
  "versionid": "5ed6063f-04e0-11e9-8279-02420a5e1b0b"}
}

Failure Responses

Status 4xx

All error messages are returned in this format:

{
  "error": "error code string",
  "error_description": "error message string",
  "cause": "further explanation"
}

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