Delete a signal using zoneId

DELETE /signals/pid/:pid/zoneId/:zoneId

A signal can be deleted by zoneId by making a DELETE HTTP request. A zone can be called in 3 different ways. To know more about the zones please read this understand zoneId In all the cases the parameter to define the zone will be zoneId

Request parameters

Parameter Description
zoneId Required string 'KEY_Q' '74' '2,2'

Specify the id of the zone triggered

pid Required string 'DK5QPID'

Pid of the device triggered

Request

BACKEND_URL="https://q2.daskeyboard.com"

HEADERS=(-H "X-API-KEY: $API_KEY" -H "Content-Type: application/json")
PID="DK5QPID"
ZONE_ID="2,4"
URL="$BACKEND_URL/api/1.0/signals/pid/$PID/zoneId/$ZONE_ID"

curl "${HEADERS[@]}" -X DELETE $URL

 Copy

 Edit Script

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';
var zoneId = '2,4';

request.delete({
    url: backendUrl + '/api/1.0/signals/pid/' + pid + '/zoneId/' + zoneId,
    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);
    }
});

 Copy

 Edit Script


backendUrl = 'https://q2.daskeyboard.com'

headers = { "Content-type": "application/json","X-API-KEY": "uS3qbfUi5sFNq2GU1j7EaAQkgdft0Zwg"}
import json
# sudo pip install request
import requests



pid = 'DK5QPID'
zone_id = '2,4'
res_shadows = requests.delete(backendUrl + '/api/1.0/signals' + '/pid/'+ pid + '/zoneId/' + zone_id, headers=headers)

# checking the response
if res_shadows.ok:
    print "OK"
    print res_shadows.text
else:
    print "Error: " + res_shadows.text

 Copy

 Edit Script

BACKEND_URL="http://localhost:27301"
HEADERS=(-H "Content-Type: application/json")
PID="DK5QPID"
ZONE_ID="2,4"
URL="$BACKEND_URL/api/1.0/signals/pid/$PID/zoneId/$ZONE_ID"

curl "${HEADERS[@]}" -X DELETE $URL

 Copy

 Edit Script

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';
var zoneId = '2,4';

request.delete({
    url: backendUrl + '/api/1.0/signals/pid/' + pid + '/zoneId/' + zoneId,
    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);
    }
});

 Copy

 Edit Script

backendUrl = 'http://localhost:27301'
headers = { "Content-type": "application/json"}
import json
# sudo pip install request
import requests



pid = 'DK5QPID'
zone_id = '2,4'
res_shadows = requests.delete(backendUrl + '/api/1.0/signals' + '/pid/'+ pid + '/zoneId/' + zone_id, headers=headers)

# checking the response
if res_shadows.ok:
    print "OK"
    print res_shadows.text
else:
    print "Error: " + res_shadows.text

 Copy

 Edit Script

Response
HTTP 200