Distribution API

The Distribution API allows you to manage device distributions, allowing you to take a device from prototype to market. Distributions represent a group of Devices that begin life with the attributes of the original device template when created.

Distribution triggers can be managed via the Triggers API.

Authentication

All methods described in this page require that a Master API Key is specified in the X-M2X-KEY header. Any attempt of using a Distribution or Device level API key would result in a 403 Forbidden response. Learn more about API Keys.

List Distributions

GET /distributions

Retrieve the list of device distributions accessible by the authenticated API key.

The list of device distributions can be paginated and ordered by using one or more of the following parameters:

  • page Page number to be retrieved.
  • limit Number of distributions to return per page. It must be a number between 0 and 100. If a higher value is sent, the API will use 100 instead.

Sorting distributions can be done via the sort parameter, and the sorting direction is controlled by the dir parameter, allowing the values asc (default) and desc for ascending and descending order, respectively. The sort value can be one of the following options:

  • created: the distribution's creation timestamp.
  • name: the distribution's name.

Responses

Success

200 OK
Content-Type: application/json

{ "distributions": [
  { "id": "1b3ba972fcf92a156fc8c0ca1554434c",
    "name": "Sample Distribution",
    "description": "Longer description for Sample Distribution",
    "visibility": "public",
    "status": "enabled",
    "url": "https://api-m2x.att.com/v2/distributions/1b3ba972fcf92a156fc8c0ca1554434c",
    "key": "8eb857a0672879dcad16f198aaafbc5b",
    "created": "2014-10-09T17:09:43.443Z",
    "updated": "2014-10-09T17:09:43.443Z",
    "devices": {
      "total": 10,
      "registered": 8,
      "unregistered": 2
    }
  },
  { "id": "4fc642808294b2f8af137bb655fa0e18",
    "name": "Sample Distribution",
    "description": "Longer description for Sample Distribution",
    "visibility": "private",
    "serial": null,
    "status": "enabled",
    "url": "https://api-m2x.att.com/v2/distributions/4fc642808294b2f8af137bb655fa0e18",
    "key": "df17a48c5208d8db584b6b994dc6726b",
    "created": "2014-10-10T18:07:54.314Z",
    "updated": "2014-10-10T18:07:54.314Z",
    "devices": {
      "total": 10,
      "registered": 10,
      "unregistered": 0
    } } ],
  "total": 1000,
  "pages": 500,
  "limit": 2,
  "current_page": 1 }

Inactive Account

403 Forbidden
Content-Type: application/json

{ "message": "Account Not Active", "description": "Your account has not been activated yet. If you need to re-send the activation email, please visit https://m2x.att.com/activation-required" }

Search Distributions

GET /distributions/search

Retrieve the list of device distributions accessible by the authenticated API key that meet the search criteria.

The list of device distributions can be filtered by using one or more of the following parameters:

  • q Text to search. Only distributions containing this text in its name or description will be returned.
  • page Page number to be retrieved.
  • limit Number of devices to return per page. It must be a number between 0 and 100. If a higher value is sent, the API will use 100 instead.
  • tags A comma delimited list of tags.
  • modified_since An ISO8601 timestamp. All distributions modified since this parameter will be included.
  • unmodified_since An ISO8601 timestamp. All distributions modified before this parameter will be included.
  • visibility The visibility that the distribution sets to its devices. Either public or private. When not specified, both public and private will be returned.

Sorting distributions can be done via the sort parameter, and the sorting direction is controlled by the dir parameter, allowing the values asc (default) and desc for ascending and descending order, respectively. The sort value can be one of the following options:

  • created: the distribution's creation timestamp.
  • name: the distribution's name.

Distributions can also be searched by their metadata. The metadata parameter, contrary to the other ones, cannot be sent via the query string. Instead, they should be sent as a JSON payload in the body of the request. Below follows a more detailed description and specification of the metadata parameter.

Metadata Filters

The metadata parameter should be an object in which each key is the exact name of a custom distribution metadata field, and the value is an object that holds the desired filters for the given field.

The metadata filters object should have a valid operator as the key, pointing to the value to be used for that particular operator.

This is an example of what this metadata object could look like:

{
  "metadata": {
    "color": {
      "match": "blue"
    },
    "owner": {
      "match": "Smith"
    }
  }
}

In this example, distributions would be filtered returning only the ones that have a color metadata field that contains the word blue, and an owner metadata field that contains the word Smith.

The name used for each metadata field in this type of search needs to be an exact match, and the list of names cannot have repeated values.

Metadata Filter Operators

Currently, only one operator is supported:

  • match: filters metadata fields that have a value which contains the one specified.

This method requires that a master API key is specified in the X-M2X-KEY header.

Responses

Success

200 OK
Content-Type: application/json

{ "distributions": [
  { "id": "1b3ba972fcf92a156fc8c0ca1554434c",
    "name": "Sample Distribution",
    "description": "Longer description for Sample Distribution",
    "visibility": "public",
    "status": "enabled",
    "url": "https://api-m2x.att.com/v2/distributions/1b3ba972fcf92a156fc8c0ca1554434c",
    "key": "8eb857a0672879dcad16f198aaafbc5b",
    "created": "2014-10-09T17:09:43.443Z",
    "updated": "2014-10-09T17:09:43.443Z",
    "devices": {
      "total": 10,
      "registered": 8,
      "unregistered": 2
    }
  },
  { "id": "4fc642808294b2f8af137bb655fa0e18",
    "name": "Sample Distribution",
    "description": "Longer description for Sample Distribution",
    "visibility": "private",
    "serial": null,
    "status": "enabled",
    "url": "https://api-m2x.att.com/v2/distributions/4fc642808294b2f8af137bb655fa0e18",
    "key": "df17a48c5208d8db584b6b994dc6726b",
    "created": "2014-10-10T18:07:54.314Z",
    "updated": "2014-10-10T18:07:54.314Z",
    "devices": {
      "total": 10,
      "registered": 10,
      "unregistered": 0
    } } ],
  "total": 1000,
  "pages": 500,
  "limit": 2,
  "current_page": 1 }

Inactive Account

403 Forbidden
Content-Type: application/json

{ "message": "Account Not Active", "description": "Your account has not been activated yet. If you need to re-send the activation email, please visit https://m2x.att.com/activation-required" }

Create Distribution

POST /distributions

Create a new device distribution. Accepts the following parameters:

  • name the name of the new device distribution (required).
  • description containing a longer description (optional).
  • visibility either "public" or "private" (required).
  • base_device the ID of the device to be used as the device template for this distribution (optional).
  • metadata an object containing custom metadata fields and values (optional).

Request

Content-Type: application/json

{ "name": "Sample Distribution",
  "description": "Longer description for Sample Distribution",
  "visibility": "public" }

Responses

Success

201 Created
Content-Type: application/json
Location: https://api-m2x.att.com/v2/distributions/1b3ba972fcf92a156fc8c0ca1554434c

{ "id": "1b3ba972fcf92a156fc8c0ca1554434c",
  "name": "Sample Distribution",
  "description": "Longer description for Sample Distribution",
  "visibility": "public",
  "status": "enabled",
  "url": "https://api-m2x.att.com/v2/distributions/1b3ba972fcf92a156fc8c0ca1554434c",
  "key": "8eb857a0672879dcad16f198aaafbc5b",
  "created": "2014-10-09T17:09:43.373Z",
  "updated": "2014-10-09T17:09:43.373Z",
  "devices": {
    "total": 0,
    "registered": 0,
    "unregistered": 0
  } }

Inactive Account

403 Forbidden
Content-Type: application/json

{ "message": "Account Not Active", "description": "Your account has not been activated yet. If you need to re-send the activation email, please visit https://m2x.att.com/activation-required" }

Validation Failed

422 Unprocessable Entity
Content-Type: application/json

{ "message": "Validation Failed",
  "errors": { "name": ["not_present"] } }

A developer will receive this response if one of these validations fail:

  • The name must be specified (not_present).
  • The visibility must be either "public" or "private" (not_valid).
  • base_device must be a valid device ID that belongs to the authenticated account if present (not_found).
  • The metadata parameter must be an object containing valid metadata (see Update Distribution Metadata).

View Distribution Details

GET /distributions/{id}

Retrieve information about an existing device distribution.

Responses

Success

200 OK
Content-Type: application/json

{ "id": "1b3ba972fcf92a156fc8c0ca1554434c",
  "name": "Sample Distribution",
  "description": "Longer description for Sample Distribution",
  "visibility": "public",
  "status": "enabled",
  "url": "https://api-m2x.att.com/v2/distributions/1b3ba972fcf92a156fc8c0ca1554434c",
  "key": "8eb857a0672879dcad16f198aaafbc5b",
  "created": "2014-10-09T17:09:43.526Z",
  "updated": "2014-10-09T17:09:43.526Z",
  "metadata": {
    "color": "blue",
    "owner": "John Smith"
  },
  "devices": {
    "total": 10,
    "registered": 8,
    "unregistered": 2
  } }

Inactive Account

403 Forbidden
Content-Type: application/json

{ "message": "Account Not Active", "description": "Your account has not been activated yet. If you need to re-send the activation email, please visit https://m2x.att.com/activation-required" }

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified device distribution does not exist or belongs to another developer.

Update Distribution Details

PUT /distributions/{id}

Update an existing device distribution's information. Accepts the following parameters:

  • name (required)
  • description (optional)
  • visibility either "public" or "private" (required).
  • metadata an object containing custom metadata fields and values (optional).

Request

Content-Type: application/json

{ "name": "Sample Distribution",
  "description": "Longer description for Sample Distribution",
  "visibility": "public" }

Responses

Success

204 No Content

Inactive Account

403 Forbidden
Content-Type: application/json

{ "message": "Account Not Active", "description": "Your account has not been activated yet. If you need to re-send the activation email, please visit https://m2x.att.com/activation-required" }

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified device distribution does not exist or belongs to another developer.

Validation Failed

422 Unprocessable Entity
Content-Type: application/json

{ "message": "Validation Failed",
  "errors": { "name": ["not_present"] } }

A developer will receive this response if one of these validations fail:

  • The name must be specified (not_present).
  • The visibility must be either "public" or "private" (not_valid).
  • The metadata parameter must be an object containing valid metadata (see Update Distribution Metadata).

Read Distribution Metadata

GET /distributions/{id}/metadata

Get custom metadata of an existing Distribution.

Responses

Success

200 OK
Content-Type: application/json

{ "color": "blue",
  "owner": "John Smith" }

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified Distribution does not exist or belongs to another developer.

Update Distribution Metadata

PUT /distributions/{id}/metadata

Update the custom metadata of the specified Distribution. Distribution metadata can store arbitrary string values at custom field names. Each time the distribution metadata is updated, the current metadata is discarded and only the updated metadata is retained.

Field names must begin with a lowercase letter, may contain only lowercase letters, numbers, and the _ character and may be up to 250 characters long. Field values may be any string up to 5,000 characters.

Request

Content-Type: application/json

{ "color": "blue",
  "owner": "John Smith" }

Responses

Success

204 No Content

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified distribution does not exist or belongs to another developer.

Validation Failed

422 Unprocessable Entity
Content-Type: application/json

{ "message": "Validation Failed",
  "errors": { "color_code": ["not_valid"], "owner name": ["name_not_valid"] } }

A developer will receive this response if one or more of these validations fail:

  • Field value must be a string (not_valid).
  • Field value must be no longer than 5,000 characters (too_long).
  • Field name must contain only allowed characters (name_not_valid).
  • Field name must be no longer than 250 characters (name_too_long).

Read Distribution Metadata Field

GET /distributions/{id}/metadata/{field}

Get the value of a single custom metadata field from an existing Distribution. The final segment of the path specifies the metadata field name from which the value should be read.

Responses

Success

200 OK
Content-Type: application/json

{ "value": "John Smith" }

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified distribution does not exist or belongs to another developer.

Metadata Field Not Found

404 Not Found
Content-Type: application/json

{ "message": "Metadata Field Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified metadata field does not exist in the given Distribution.

Update Distribution Metadata Field

PUT /distributions/{id}/metadata/{field}

Update the custom metadata of the specified Distribution. Distribution metadata can store arbitrary string values at custom field names. The final segment of the path specifies the metadata field name in which the given value should be stored.

Field names must begin with a lowercase letter, may contain only lowercase letters, numbers, and the _ character and may be up to 250 characters long. Field values may be any string up to 5,000 characters.

Request

Content-Type: application/json

{ "value": "John Smith" }

Responses

Success

204 No Content

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified distribution does not exist or belongs to another developer.

Validation Failed

422 Unprocessable Entity
Content-Type: application/json

{ "message": "Validation Failed",
  "errors": { "owner": ["not_valid"] } }

A developer will receive this response if one or more of these validations fail:

  • Field value must be a string (not_valid).
  • Field value must be no longer than 5,000 characters (too_long).
  • Field name must contain only allowed characters (name_not_valid).
  • Field name must be no longer than 250 characters (name_too_long).

List Devices from an existing Distribution

GET /distributions/{id}/devices

Retrieve a list of devices added to the specified distribution. The list can be paginated and ordered by using one or more of the following parameters:

  • page Page number to be retrieved.
  • limit Number of devices to return per page. It must be a number between 0 and 100. If a higher value is sent, the API will use 100 instead.

Listed devices are sorted by descendant last activity timestamp by default. Sorting direction is controlled by the dir parameter, allowing the values asc (default) and desc for ascending and descending order, respectively. The sorting field can be set by passing one of the following values on the sort parameter:

  • created: The device's creation date; this is the default.
  • last_activity: The device's last recorded activity.
  • name: The device's name.

The current values for the streams of each device can be included using the following query parameter:

  • include_stream_values Either true, false, or a comma-separated list of stream names. If true, then the current value of all streams for each listed device will be included in the response. If false, no stream values will be retrieved (this is the default behavior). If a list of stream names is specified, then only the current value of those streams will be included in the response. Any stream which can't be found will be silently ignored.

In order to search for devices using more filters and parameters, please refer to the device search API endpoint.

Responses

Success

200 OK
Content-Type: application/json

{ "devices": [
  {
    "id": "b1e8abbad65cb52b0d75eb2e63efa782",
    "name": "Sensor",
    "description": "Description",
    "visibility": "private",
    "serial": "ABC11111",
    "status": "enabled",
    "tags": ["ipsum", "lorem"],
    "url": "https://api-m2x.att.com/v2/devices/b1e8abbad65cb52b0d75eb2e63efa782",
    "streams": {
      "url": "https://api-m2x.att.com/v2/devices/b1e8abbad65cb52b0d75eb2e63efa782/streams",
      "count": 1,
      "values": {
        "temperature": 72
      }
    },
    "key": "78981e4daf83c38cab03d83d513db7be",
    "created": "2014-10-21T23:13:03.965Z",
    "updated": "2014-10-21T23:13:03.965Z"
  },
  {
    "id": "e38f93669c88151e76f1c587edd9ef74",
    "name": "Sensor",
    "description": "Description",
    "visibility": "private",
    "serial": "ABC11112",
    "status": "enabled",
    "tags": [],
    "url": "https://api-m2x.att.com/v2/devices/e38f93669c88151e76f1c587edd9ef74",
    "streams": {
      "url": "https://api-m2x.att.com/v2/devices/e38f93669c88151e76f1c587edd9ef74/streams",
      "count": 0,
      "values": {}
    },
    "key": "8a2567003b282f494ddfc7ee64dcb327",
    "created": "2014-10-21T23:13:22.225Z",
    "updated": "2014-10-21T23:13:22.225Z"
  },
  {
    "id": "b1d1a0b9df316531241d0fd48b5c8fe6",
    "name": "Sensor",
    "description": "Description",
    "visibility": "private",
    "serial": "ABC12345",
    "status": "enabled",
    "tags": [],
    "url": "https://api-m2x.att.com/v2/devices/b1d1a0b9df316531241d0fd48b5c8fe6",
    "streams": {
      "url": "https://api-m2x.att.com/v2/devices/b1d1a0b9df316531241d0fd48b5c8fe6/streams",
      "count": 0,
      "values": {}
    },
    "key": "43fc778532e092b93e3d8a871164297c",
    "created": "2014-10-21T23:06:46.001Z",
    "updated": "2014-10-21T23:06:46.001Z"
  } ] }

Inactive Account

403 Forbidden
Content-Type: application/json

{ "message": "Account Not Active", "description": "Your account has not been activated yet. If you need to re-send the activation email, please visit https://m2x.att.com/activation-required" }

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified device distribution does not exist or belongs to another developer.

Add Device to an existing Distribution

POST /distributions/{id}/devices

Add a new device to an existing distribution. Requires the following parameter:

  • serial device serial number (required). Must be unique.

The following parameters are optional, and will be inherited from the distribution if not given:

  • name the name of the new device (optional).
  • description containing a longer description (optional).
  • visibility either "public" or "private" (optional).
  • tags a comma separated list of device tag names (optional).

Request

Content-Type: application/json

{ "serial": "ABC1234" }

Responses

Success

201 Created
Content-Type: application/json
Location: https://api-m2x.att.com/v2/devices/b1e8abbad65cb52b0d75eb2e63efa782

{ "id": "b1e8abbad65cb52b0d75eb2e63efa782",
  "name": "Sensor",
  "description": "Description",
  "visibility": "private",
  "serial": "ABC1234",
  "status": "enabled",
  "tags": [],
  "metadata": {},
  "url": "https://api-m2x.att.com/v2/devices/b1e8abbad65cb52b0d75eb2e63efa782",
  "key": "78981e4daf83c38cab03d83d513db7be",
  "created": "2014-10-21T23:13:03.062Z",
  "updated": "2014-10-21T23:13:03.062Z" }

Inactive Account

403 Forbidden
Content-Type: application/json

{ "message": "Account Not Active", "description": "Your account has not been activated yet. If you need to re-send the activation email, please visit https://m2x.att.com/activation-required" }

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified device distribution does not exist or belongs to another developer.

Validation Failed

422 Unprocessable Entity
Content-Type: application/json

{ "message": "Validation Failed",
  "errors": { "serial": ["not_unique"] } }

A developer will receive this response if the device serial number was not provided, was invalid or it was already used for another device.

Delete Distribution

DELETE /distributions/{id}

Delete an existing device distribution. Notice that deleting a distribution does not delete its devices, which remain intact.

Responses

Success

204 No Content

Inactive Account

403 Forbidden
Content-Type: application/json

{ "message": "Account Not Active", "description": "Your account has not been activated yet. If you need to re-send the activation email, please visit https://m2x.att.com/activation-required" }

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified device distribution does not exist or belongs to another developer.

List Data Streams

GET /distributions/{id}/streams

Retrieve list of data streams associated with the specified distribution.

Responses

Success

200 OK
Content-Type: application/json

{ "streams": [
  { "name": "temperature",
    "display_name": "Temperature",
    "type": "numeric",
    "value": 32,
    "unit": { "label": "celsius", "symbol": "C" },
    "url": "https://api-m2x.att.com/v2/distributions/a4f919d931c265ddd7b76649eac22f7e/streams/temperature",
    "created": "2014-09-09T19:15:00.895Z",
    "updated": "2014-09-10T19:15:00.325Z" },
  { "name": "humidity",
    "display_name": "Humidity",
    "type": "numeric",
    "value": 80,
    "unit": { "label": "percent", "symbol": "%" },
    "url": "https://api-m2x.att.com/v2/distributions/a4f919d931c265ddd7b76649eac22f7e/streams/humidity",
    "created": "2014-09-09T19:15:00.875Z",
    "updated": "2014-09-10T19:15:00.234Z" } ] }

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified distribution does not exist or belongs to another developer.

Create/Update Data Stream

PUT /distributions/{id}/streams/{name}

Update a data stream associated with the specified distribution (if a stream with this name does not exist it gets created).

This action can only be performed if the distribution doesn't have devices within it already. When this happens, modifying its streams is not allowed, as new devices would be configured differently than existing devices.

Data streams accept only numeric values by default, this behavior can be configured by setting the type attribute to alphanumeric upon creation. Once a stream is created, it's type cannot be changed.

This request accepts the following parameters:

  • display_name the name used in reports and charts to identify this stream. Unlike the name attribute, it accepts spaces and symbols (optional).
  • unit a JSON object describing the unit used to measure this stream's values. It accepts two attributes: label and symbol.
  • type the stream's type. This value can be numeric or alphanumeric and can only be specified when creating a data stream. (optional, type is numeric by default)

Request

Content-Type: application/json

{ "display_name": "Temperature", "unit": { "label": "celsius", "symbol": "C" } }

Responses

Success

204 No Content

Distribution is locked

403 Forbidden
Content-Type: application/json

{ "message": "Distribution Locked", "description": "The resource you requested is disabled or not accessible with your API key. Please try again with an API key authorized for this operation. Learn more about managing API keys at https://m2x.att.com/developer/documentation/overview#API-Keys" }

A developer will receive this response when the specified distribution already has devices within it.

Distribution Not Found

404 Not Found
Content-Type: application/json

{ "message": "Distribution Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified distribution does not exist or belongs to another developer.

View Data Stream

GET /distributions/{id}/streams/{name}

Get details of a specific data stream associated with an existing distribution.

Responses

Success

200 OK
Content-Type: application/json

{ "name": "temperature",
  "display_name": "Temperature",
  "type": "numeric",
  "value": 32,
  "unit": { "label": "celsius", "symbol": "C" },
  "url": "https://api-m2x.att.com/v2/distributions/a4f919d931c265ddd7b76649eac22f7e/streams/temperature",
  "created": "2014-09-09T19:15:00.344Z",
  "updated": "2014-09-10T19:15:00.390Z" }

Distribution/Stream Not Found

404 Not Found
Content-Type: application/json

{ "message": "Stream Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified data stream does not exist. It will also receive this status code if the specified distribution does not exist or belongs to another developer.

Delete Data Stream

DELETE /distributions/{id}/streams/{name}

Delete an existing data stream associated with a specific distribution.

This action can only be performed if the distribution doesn't have devices within it already. When this happens, modifying its streams is not allowed, as new devices would be configured differently than existing devices.

Responses

Success

204 No Content

Distribution is locked

403 Forbidden
Content-Type: application/json

{ "message": "Distribution Locked", "description": "The resource you requested is disabled or not accessible with your API key. Please try again with an API key authorized for this operation. Learn more about managing API keys at https://m2x.att.com/developer/documentation/overview#API-Keys" }

A developer will receive this response when the specified distribution already has devices within it.

Distribution/Stream Not Found

404 Not Found
Content-Type: application/json

{ "message": "Stream Not Found", "description": "The resource you requested could not be found. Please verify that the correct resource path was provided, or refer to https://m2x.att.com/developer/documentation for complete API documentation." }

A developer will receive this response when the specified data stream does not exist. It will also receive this status code if the specified distribution does not exist or belongs to another developer.