update shortcuts (beta)
This endpoint is used to update the shortcuts configuration for a specific device identified by deviceId
.
Request Body
The request body must be a JSON object structured as follows:
shortcuts: An object containing the modes for the shortcuts.
modes: An object that defines different modes.
day: An object representing the day mode.
content: An array of commands to be executed during the day. Each command is an object with:
cmd: A string representing the command type (e.g., "track-play").
params: An object containing parameters for the command:
card: A string representing the card identifier.
chapter: A string representing the chapter name.
track: A string representing the track key. For Yoto Daily, this can also equal , which will dynamically play the track for the current day.
night: An object representing the night mode.
- content: An array of commands to be executed during the night (can be empty).
Responses
200 ok application/json
No schema available for this response.
Body application/json
Path Parameters
/device-v2/{deviceId}/shortcuts
Authorization (bearerAuth)
Request Body
curl "https://api.yotoplay.com/device-v2/{deviceId}/shortcuts"--header "Authorization: Bearer [YOUR_TOKEN]"
const options = { method: 'PUT', headers: { 'Authorization': 'Bearer [YOUR_TOKEN]' }};
fetch('https://api.yotoplay.com/device-v2/{deviceId}/shortcuts', 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}/shortcuts", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", 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}/shortcuts"
headers = { "Authorization": "Bearer [YOUR_TOKEN]"}
response = requests.request("PUT", url, headers=headers)
print(response.text)