Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Created March 17, 2023 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sendbird-community/d65bf40fee773a6478bb91677ce601fd to your computer and use it in GitHub Desktop.
Save sendbird-community/d65bf40fee773a6478bb91677ce601fd to your computer and use it in GitHub Desktop.
const createUrl = async () => {
const context = await client.instance.context()
const service_user_id = `service_user_${context.data.ticketCreatorData.contact.id}`
const data = await client.request.invoke("buildBackupGroupCallUrl", {userId:
service_user_id} )
/* Modal of returned data.response.
{
"service_user_id": "service_user_150006383534",
"room_id": "b1650746-e810-4aeb-ae2a-422d8a42523c",
"app_id": "YOUR_APP_ID",
"creds": {
"token": "SOME_SENDBIRD_SESSION_TOKEN",
"expires_at": 1672902388000
}
}
*/
roomId = data.response.room_id
const url = `http://localhost:1234/?data=${btoa(JSON.stringify(data.response))}`
document.getElementById('link').innerHTML = url
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment