method.exec
The method.exec command is used to execute a method call for a Thing.
TR50 Request
{
"cmd": {
"command": "method.exec",
"params": {
"thingKey": "mything",
"method": "methodName",
"ackTimeout": 30,
"params": {
"paramKey": "paramValue"
}
}
}
}
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
thingKey |
String |
Yes |
Identifies the thing to which the method call is to be associated. This parameter may also contain a mailbox alias. |
method |
String |
Yes |
The method you wish to execute on the thing. |
ackTimeout |
Integer |
|
Acknowledge timeout duration in seconds (maximum of 300). |
ttl |
Integer |
|
The time to live of the message. Defaults to the ackTimeout. |
params |
Object |
|
Notification variables or method parameters to be executed with the method. |
TR50 Response
If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.
{
"cmd": {
"success": true
}
}
Response Parameters
Name |
Type |
Description |
---|---|---|
params |
Object |
The completion variables returned by the method's execution, if any. |