send device command
This endpoint is used to send a MQTT command to a device within the user's family.
Request Body
The request body must be a JSON object. This matches the request specified within the separate MQTT Command documentation.
Response
On a successful request, the response will return a JSON object specifying the success or failure of the command request.
Body application/json
Path Parameters
deviceId string Required
POST
/device-v2/{deviceId}/command/status
Server URL: https://api.yotoplay.com
Authorization (bearerAuth)
Request Body
curl "https://api.yotoplay.com/device-v2/{deviceId}/command/status"--header "Authorization: Bearer [YOUR_TOKEN]"
const options = { method: 'POST', headers: { 'Authorization': 'Bearer [YOUR_TOKEN]' }};
fetch('https://api.yotoplay.com/device-v2/{deviceId}/command/status', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.yotoplay.com/device-v2/{deviceId}/command/status", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_HTTPHEADER => [ "Authorization: Bearer [YOUR_TOKEN]" ],]);
$response = curl_exec($curl);$err = curl_error($curl);
curl_close($curl);
if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}
import requests
url = "https://api.yotoplay.com/device-v2/{deviceId}/command/status"
headers = { "Authorization": "Bearer [YOUR_TOKEN]"}
response = requests.request("POST", url, headers=headers)
print(response.text)