48
Unsubscribe from event
With this service an already registered event via subscribe service can be unsubscribed by the host from the
device.
Before the TCP connection is closed the host must unsubscribe all active events !
The active subscribed events can be read out over the IoT core service ->
Method: POST
URL:
Request body data:
{"code": "
request
", "cid": <
Number
>, "adr": "data/port[
N
]/<
Event
>/ unsubscribe ", "
reply
": "
reply text
", "data":
{"callback": "http://<
ip address
>:<
Port
>/<
Eventhandler
>", }}
Request
element
Value
Remark
code
"request"
-
cid
<Number>
CID must match to the cid of the subscribe event
otherwise the unsubscribe will not work !
adr
"data/port[
N
]/<Event>/unsubscribe"
For DTE10x :
N
= 1…4
For DTE60x, DTE80x, DTE9Xx:
N
= 1
<
Event
>: Event name to unsubscribe from.
reply
"reply text"
Optional: Text to be send back in the response.
If not needed, this element can be removed from the
request.
data
{
"callback":
"http://<
ip address
> :
<
Port
>/
<
Eventhandler
>"
}
Data of the IoT Webserver
(1)
:
IP address
: IP address.
Port
: IP port number.
Eventhandler
: Name of the eventhandler to
unsubscribe from.
(1)
Please check, that the IoT Webserver is available under the IP address and the IP port is not blocked by the
firewall.
Response data:
{"cid": 1001, "adr": "mydevice/remote/someotherdevice/someevent/unsubscribe", "reply": "reply text", "code": 200}
Response
element
Value
Remark
cid
<Number>
Correlation identifier.
Same as send in request.
adr
<string>
Optional.
Text sent in element "reply" of the service request
e.g. "
reply text"
code
200
Response code of the IoT core
See chapter ->
Example:
See
Receive C/Qi from IO port automatically