Read Trigger

Retrieves the XML or JSON representation of a single trigger.

Notes:

  • “TRIGGER_ID” should be set to the ID of the trigger you want to read.
  • The data for a trigger read can only be encoded as xml or json, not csv.

A full list of trigger parameters is available on the API Resource Attributes page.

Request

Parameters
Method GET
Base URL https://api.xively.com
API Endpoint /v2/triggers/TRIGGER_ID
Headers
X-ApiKey API_KEY_HERE
Body
JSON
XML
CSV
  • GET/v2/triggers/TRIGGER_ID.json

    This request does not require body data
    
  • GET/v2/triggers/TRIGGER_ID.xml

    This request does not require body data
    
  • CSV format not available for this call
    

Response

Parameters
Status Code 200 OK
Headers
No Headers
Body
JSON
XML
CSV
  • {
        "id": 21962,
        "url": "http://requestb.in/131tsul1",
        "trigger_type": "lt",
        "user": "USERNAME",
        "environment_id": 121601,
        "stream_id": "example",
        "threshold_value": "15.0",
        "notified_at": "2013-05-06T20:08:17Z"
    }
    
  • <?xml version="1.0" encoding="UTF-8"?>
    <datastream-trigger>
      <id type="integer">21962</id>
      <url>http://requestb.in/131tsul1</url>
      <trigger-type>lt</trigger-type>
      <threshold-value type="float">15.0</threshold-value>
      <notified-at type="datetime">2013-05-06T20:08:17Z</notified-at>
      <user>USERNAME</user>
      <environment-id type="integer">121601</environment-id>
      <stream-id>example</stream-id>
    </datastream-trigger>
    
  • CSV format not available for this call