1. Home
  2. Developers
  3. Playback commands

API guide

Advance a cue without advancing twice

A network timeout and a second operator pressing Next are different problems. Use an idempotency key for the first and the room version for the second.

Updated By The runofsho team
ON THIS PAGE
  1. Read before you act
  2. Send one Next command
  3. Decide whether to retry
  4. Endpoint reference

Read before you act

Use a rehearsal room with at least two cues and an operate key authorized for that room. Set API, ROOM and RUNOFSHO_KEY as in the quickstart. This example changes the selected timer; do not point it at a live show.

STATE=$(curl -fsS "$API/rooms/$ROOM/state" \
  -H "Authorization: Bearer $RUNOFSHO_KEY") || exit 1
printf '%s' "$STATE" | jq '.data | {version, current_timer, next_timer}'
VERSION=$(jq -er '.data.version' <<< "$STATE") || exit 1

Send one Next command

Confirm that the displayed next timer is the one you intend to cue. Generate one unique key for this button press (uuidgen here), then keep that key and payload together until the outcome is known.

PRESS=$(uuidgen) || exit 1
PAYLOAD=$(jq -n --argjson v "$VERSION" '{expected_version:$v,autostart:false}')
curl -sS --fail-with-body "$API/rooms/$ROOM/playback/next" \
  -H "Authorization: Bearer $RUNOFSHO_KEY" \
  -H "Idempotency-Key: $PRESS" \
  -H 'Content-Type: application/json' --data "$PAYLOAD"

Success returns the new room state in data. Read data.current_timer and data.version instead of guessing which row won. When a button means “start” or “pause”, use the explicit start or stop command rather than toggle.

Decide whether to retry

Outcome Correct next action
Connection dropped before the reply Retry the same cURL call, not the setup lines. The same key and request can replay the first response for 24 hours.
409 STALE_STATE Fetch room state again. Show the operator the current and next cue; only issue a new command if they still intend to advance.
409 IDEMPOTENCY_CONFLICT The key was reused for a different request. Do not silently replace it and resend.
422 INVALID_TRANSITION Next does not wrap around from the last timer. Inspect the selected cue instead of retrying.

Endpoint reference

See it run before your next show.

Open the sample room, start a cue, add a minute and send a message. No account needed.

Try a sample room