{"_id":"582789acbe5c080f00a5a854","__v":0,"parentDoc":null,"category":{"_id":"582789abbe5c080f00a5a803","__v":0,"version":"582789aabe5c080f00a5a7fe","project":"568bdc1483d2061900d86cdc","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-01-05T15:14:04.838Z","from_sync":false,"order":9,"slug":"something","title":"Devices"},"version":{"_id":"582789aabe5c080f00a5a7fe","__v":10,"project":"568bdc1483d2061900d86cdc","createdAt":"2016-11-12T21:29:14.915Z","releaseDate":"2016-11-12T21:29:14.915Z","categories":["582789abbe5c080f00a5a7ff","582789abbe5c080f00a5a800","582789abbe5c080f00a5a801","582789abbe5c080f00a5a802","582789abbe5c080f00a5a803","582789abbe5c080f00a5a804","582789abbe5c080f00a5a805","582789abbe5c080f00a5a806","582789abbe5c080f00a5a807","582789abbe5c080f00a5a808","5827ea984ca29e0f00137a9e","583df597887db62f00644283","583df5d9c622791900e78da5","5845cd8763c11b250037967d","5845d13063c11b2500379681","5859e859e3306d1900126725","587aeb9a01cf3a0f008359eb","587c422af45e2d0f005e200d","587d84dc82f6f30f004ceee5"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"beta2","version_clean":"0.0.0","version":"0"},"user":"568bdbc4fe6fcc0d006dc970","project":"568bdc1483d2061900d86cdc","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-20T08:44:18.274Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"POST https://ioe.droplit.io/api/devices/D573bc694ae9ac9419f028b61/services/BinarySwitch.switchOn HTTP/1.1\nauthorization: AUTH_TOKEN","language":"http"},{"code":"droplit device call D573bc694ae9ac9419f028b61 BinarySwitch.switchOn","language":"text","name":"droplit console"}]},"method":"post","results":{"codes":[{"language":"text","code":" ","name":"","status":200},{"status":401,"code":"","language":"text"},{"language":"text","status":403,"code":""},{"code":"Device with id D573bc694ae9ac9419f028b62 does not exist.","language":"text","status":404}]},"settings":"572c39957c8eff0e00aaa18b","auth":"required","params":[{"_id":"573ecd82804f901700a9dfbf","ref":"","in":"path","required":true,"desc":"[device](doc:devices) id or [alias](doc:aliases)","default":"","type":"string","name":"id"},{"_id":"573ecd82804f901700a9dfbe","ref":"","in":"path","required":true,"desc":"[method selector](doc:service-selectors)","default":"","type":"string","name":"selector"},{"_id":"573ece09a233380e005db12c","ref":"","in":"body","required":false,"desc":"Method parameter(s)","default":"","type":"object","name":"value"}],"url":"/devices/:id/services/:selector"},"isReference":true,"order":8,"body":"You can call a service method on a device with this endpoint.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Parameter notes\"\n}\n[/block]\n## value\nIf the called method has any parameters, they may be specified using _value_. The value is normally set with an ordered array of value for the parameters.\n\nE.g., `\"value\": [ \"foo\", \"bar\" ]` with call the method with `foo` as the first parameter and bar as the second parameter.\n\nAdditionally, the value may be set to a single value in the case where the method will only be invoked with the first parameter.\n\nE.g., `\"value\": \"foo\"` is equivalent to `\"value\": [ \"foo\" ]`.","excerpt":"Call a service method","slug":"call-device-method","type":"endpoint","title":"Call Method"}

postCall Method

Call a service method

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
string
[device](doc:devices) id or [alias](doc:aliases)
selector:
required
string
[method selector](doc:service-selectors)

Body Params

value:
object
Method parameter(s)

Examples


Result Format


Documentation

You can call a service method on a device with this endpoint. [block:api-header] { "type": "basic", "title": "Parameter notes" } [/block] ## value If the called method has any parameters, they may be specified using _value_. The value is normally set with an ordered array of value for the parameters. E.g., `"value": [ "foo", "bar" ]` with call the method with `foo` as the first parameter and bar as the second parameter. Additionally, the value may be set to a single value in the case where the method will only be invoked with the first parameter. E.g., `"value": "foo"` is equivalent to `"value": [ "foo" ]`.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}