Claim the ringtone
const url = 'https://collab.work.optidata.cloud/api/rooms/calls/a3050cd3-5921-4153-b90a-owt42-e94de63c7b15/ringtone/check';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://collab.work.optidata.cloud/api/rooms/calls/a3050cd3-5921-4153-b90a-owt42-e94de63c7b15/ringtone/check \ --header 'Authorization: Bearer <token>'Asks whether this device should play the ringtone for an incoming call.
When a user has several Optiwork windows or devices open, each one asks;
the first to ask gets 204 and plays the ringtone, and the others get
403 for the next 30 seconds, so the ringtone plays once.
Release the claim with endCall when the call is answered or stops
ringing. You must be a party of the call.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The room’s hash (from its link) or its permanent-link identifier custom_hash.
Responses
Section titled “ Responses ”Play the ringtone on this device.
No authentication key was sent, or it is malformed.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}Another of your windows or devices is already playing the ringtone, or you are not a party of the call.
An error raised by the application’s own rules.
object
What went wrong.
The HTTP status, repeated.
What to do about it, when there is a hint.
A refused or not-found request.
object
Examples
Already ringing elsewhere
{ "error": "You are not allowed to play the ringtone at this moment", "status": 403, "help": ""}Not a party of the call
{ "message": "You are not a participant of this call."}No room has this hash or permanent link.
A refused or not-found request.
object
Examples
{ "message": ""}The authentication key is expired or not recognised. Get a fresh one and retry.
Authentication failures use an error key rather than message.
object
Examples
{ "error": "JWT passport expired: Passport expired"}