Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
/alert/{alert_id}
Info

Retrieves Modifies a specific alert, or a channel of alerts, or all channels available to the user if channel_id is not provided. (TODO: UPDATE)alerts for a user

Note: alert_type_id can be created/found in the settings api call

Possible Methods

GET POST PUT DELETE

Arguments

...

alert_id(optional)
Channel Alert id to try and return, if not provided returns all channels for current usermodify

Json Object

...

Code Block
{
        String "channelalert_id";
: "531733e8b8e08e9d2197b0b0",   	String event_id;
    "events" : [],	String channel_id;
    	String alert_type_id;
   "locations" : [],	Date last_alert_time;
        "name" : "abc123"
	long next_possible_alert_time_ms;
}

 

Example

...

Code Block
curl -b cookies.txt -X GET "http://localhost:8185/channelalert/532af74cb8e0870ad33d94cd" > response.txt
curl -b cookies.txt -X GET POST -d '{"event_id":"52e2e833e4b013563c3ea1ee", "alert_type_id":"532af8d8b8e0dd9b47dea7f8"}' "http://localhost:8185/channel/531733e8b8e08e9d2197b0b0alert" > response.txt
curl -b cookies.txt -X POSTPUT -d '{"nameevent_id":"52e2e833e4b013563c3ea1ee", "alert_type_id":"abc123532af8d8b8e0dd9b47dea7f9"}'  "http://localhost:8185/channelalert" > response.txt
curl -b cookies.txt -X PUT-dDELETE '{"name":"renamed my channel"}'  "http://localhost:8185/alert/532af74cb8e0870ad33d94cd" > response.txt

 

Example Response
Info
Info
curl -b cookies.txt -X GET "http://localhost:8185/channelalert/531733e8b8e08e9d2197b0b0532af911b8e0dd9b47dea7fa" > response.txt

 

Code Block
 {
curl
 
-b
 
cookies.txt
 
-X PUT-d '{"channel_id":"531733e8b8e08e9d2197b0b0", "name":"renamed my channel"}' "http://localhost:8185/channel" > response.txt curl -b cookies.txt -X DELETE -d '{"channel":"531733e8b8e08e9d2197b0b0"}' "http://localhost:8185/channel" > response.txt curl -b cookies.txt -X DELETE "http://localhost:8185/channel/531733e8b8e08e9d2197b0b0" > response.txt

 

Example Response
(TODO: UPDATE)
Code Block
  "response": {
        "action": "Alert",
        "success": true,
        "message": "Return specific alert: 532af911b8e0dd9b47dea7fa",
        "time": 0
    },
    "data": {
        "alert_id": "532af911b8e0dd9b47dea7fa",
        "event_id": "52e2e833e4b013563c3ea1ee",
        "channel_id": "532851a1b8e0cd4ae4050b06",
        "alert_type_id": "532af8d8b8e0dd9b47dea7f8",
        "last_alert_time": "Mar 21, 2014 03:39:30 PM UTC",
        "next_possible_alert_time_ms": 1395502770715
    }
}