Get shadow signals for device
GET /signals/pid/:pid
The shadows is the list of the most recent signals for each zone. The shadows for a specific device can be fetched by making a GET HTTP request.
Request parameters
Parameter | Description |
---|---|
pid |
Required
string
'DK5QPID'
Pid of the device triggered for the shadow |
Request
BACKEND_URL="https://q2.daskeyboard.com"
HEADERS=(-H "X-API-KEY: $API_KEY" -H "Content-Type: application/json")
PID="DK5QPID"
URL="$BACKEND_URL/api/1.0/signals/pid/$PID/shadows"
curl "${HEADERS[@]}" -X GET $URL
var backendUrl = 'https://q2.daskeyboard.com';
var headers = {
"Content-Type": "application/json",
"X-API-KEY": "$API_KEY"
}
// Library to make simplified HTTP client requests
// if not installed run npm install request
var request = require('request');
var pid = 'DK5QPID';
request.get({
url: backendUrl + '/api/1.0/signals/pid/' + pid + '/shadows',
headers: headers,
json: true
}, function (error, response) {
// OK
if (response && response.statusCode == 200) {
console.log('response', response.body);
}
// OK from API response
if(response && response.statusCode != 200){
console.error(response.body);
}
// OK
if (error) {
console.error(error);
}
});
backendUrl = 'https://q2.daskeyboard.com'
headers = { "Content-type": "application/json","X-API-KEY": "uS3qbfUi5sFNq2GU1j7EaAQkgdft0Zwg"}
import json
# sudo pip install request
import requests
pid = 'DK5QPID'
res_shadows = requests.get(backendUrl + '/api/1.0/signals' + '/pid/'+ pid + '/shadows', headers=headers)
# checking the response
if res_shadows.ok:
print "OK"
print res_shadows.text
else:
print "Error: " + res_shadows.text
BACKEND_URL="http://localhost:27301"
HEADERS=(-H "Content-Type: application/json")
PID="DK5QPID"
URL="$BACKEND_URL/api/1.0/signals/pid/$PID/shadows"
curl "${HEADERS[@]}" -X GET $URL
var backendUrl = 'http://localhost:27301';
var headers = {
"Content-Type": "application/json"
}
// Library to make simplified HTTP client requests
// if not installed run npm install request
var request = require('request');
var pid = 'DK5QPID';
request.get({
url: backendUrl + '/api/1.0/signals/pid/' + pid + '/shadows',
headers: headers,
json: true
}, function (error, response) {
// OK
if (response && response.statusCode == 200) {
console.log('response', response.body);
}
// OK from API response
if(response && response.statusCode != 200){
console.error(response.body);
}
// OK
if (error) {
console.error(error);
}
});
backendUrl = 'http://localhost:27301'
headers = { "Content-type": "application/json"}
import json
# sudo pip install request
import requests
pid = 'DK5QPID'
res_shadows = requests.get(backendUrl + '/api/1.0/signals' + '/pid/'+ pid + '/shadows', headers=headers)
# checking the response
if res_shadows.ok:
print "OK"
print res_shadows.text
else:
print "Error: " + res_shadows.text
Response
HTTP 200
[
{
"clientName": "ZAPIER",
"color": "#00FF00",
"createdAt": 1532970435297,
"effect": "BLINK",
"id": 1308193,
"isArchived": false,
"isMuted": false,
"message": "Social media helps solve mystery of skier who disappeared in the Alps in 1954",
"name": "NEWS",
"pid": "DK5QPID",
"updatedAt": 1532970435299,
"userId": 9,
"zoneId": "78"
},
{
"clientName": "",
"color": "#00F",
"createdAt": 1532957910711,
"effect": "SET_COLOR",
"id": 1307671,
"isArchived": false,
"isMuted": false,
"message": "Monday: A longer and more intense wildfire season, a divisive rent control initiative, and Berkeley on a budget.https://www.nytimes.com/2018/07/30/us/california-today-firefighters.html",
"name": "new york times: California Today: The Increasing Strain on State Firefighters",
"pid": "DK5QPID",
"updatedAt": 1532957910713,
"userId": 9,
"zoneId": "128"
}
]