1. Tutorials
  2. Retrieving Data with the M2X API

Retrieving Data with the M2X API

Learn how to retrieve data from a single device using the M2X API. We'll walk you through the entire process - from discovering the required API call using the M2X API documentation, to acquiring all the necessary information to craft your request, to making a successful request using cURL.

Tutorial Outline

  1. In this tutorial we’ll be retrieving device data from a single device. Review the API Documentation for this request to determine your options.

  2. This API request will need to include the Device ID and Stream Name which can be found on the Device Dashboard.

  3. All Device level requests must be authenticated by including a Device or Master API Key in the X-M2X-KEY header. Device level API keys are accessible under the API Keys tab of Device Dashboard.

  4. Now you have all the information you will need to craft the API request. Test out the request on the command line using cURL:

              curl -i "https://api-m2x.att.com/v2/devices/[DEVICE-ID]/streams/[STREAM-NAME]/values?[OPTIONAL-PARAMETERS]" -H "X-M2X-KEY: [MASTER-API-KEY]"