Retrieve a List of Device Groups:

GET /groups/{accountname}

Returns a list of all device groups in a specified account.

Contents

See also:
Get Information about a Device Group
Update a Device Group
Create a Device Group
Delete a Device Group

Request Components

HTTP Request

GET https://thingspace.verizon.com/api/m2m/v1/groups/{accountname}

Resource Path and Query Parameters

You must include the account name in the path.

Parameter Name Data Type Description
accountname
required
string The name of the account for which you want a list of device groups. An account name is usually numeric, and must include any leading zeros.

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 Name Data Type Description
Authorization
required
string HTTP Authorization bearer token.
VZ-M2M-Token
required
string A valid session token returned by POST /session/login.
Content-Type
required
string Must be application/json.

Request Body

None.

Success Responses

Status 200 A successful request returns an array of device group objects:

Parameter Name Data Type Description
name string The name of the device group.
description string The description of the device group.
isDefaultGroup boolean Identifies the default device group.
extendedAttributes arry of extendedAttribute objects Any extended attributes for the device group, as Key and Value pairs.
key string The key for an extended attribute.
value string The value of an extended attribute.

Example Success Response

[
  {
    "name": "Unassigned Devices",
    "description": "All devices that are not in another device group.",
    "isDefaultGroup": true,
    "extendedAttributes": null
  },
  {
    "name": "West Coast Devices",
    "description": "",
    "isDefaultGroup": false,
    "extendedAttributes": null
  },
  {
    "name": "East Coast Devices",
    "description": "",
    "isDefaultGroup": false,
    "extendedAttributes": null
  }
]

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!