Loading...
Loading...
Create and manage video rooms for real-time video communication and conferencing. This skill provides Ruby SDK examples.
npx skill4agent add team-telnyx/skills telnyx-video-rubygem install telnyxrequire "telnyx"
client = Telnyx::Client.new(
api_key: ENV["TELNYX_API_KEY"], # This is the default and can be omitted
)clientbegin
result = client.messages.send_(to: "+13125550001", from: "+13125550002", text: "Hello")
rescue Telnyx::Errors::APIConnectionError
puts "Network error — check connectivity and retry"
rescue Telnyx::Errors::RateLimitError
# 429: rate limited — wait and retry with exponential backoff
sleep(1) # Check Retry-After header for actual delay
rescue Telnyx::Errors::APIStatusError => e
puts "API error #{e.status}: #{e.message}"
if e.status == 422
puts "Validation error — check required fields and formats"
end
end401403404422429GET /room_compositionspage = client.room_compositions.list
puts(page)completed_atcreated_atdownload_urlduration_secsended_atformatidrecord_typeresolutionroom_idsession_idsize_mbstarted_atstatusupdated_atuser_idvideo_layoutwebhook_event_failover_urlwebhook_event_urlwebhook_timeout_secsPOST /room_compositionsformatresolutionsession_idvideo_layoutwebhook_event_failover_urlwebhook_event_urlwebhook_timeout_secsroom_composition = client.room_compositions.create
puts(room_composition)completed_atcreated_atdownload_urlduration_secsended_atformatidrecord_typeresolutionroom_idsession_idsize_mbstarted_atstatusupdated_atuser_idvideo_layoutwebhook_event_failover_urlwebhook_event_urlwebhook_timeout_secsGET /room_compositions/{room_composition_id}room_composition = client.room_compositions.retrieve("5219b3af-87c6-4c08-9b58-5a533d893e21")
puts(room_composition)completed_atcreated_atdownload_urlduration_secsended_atformatidrecord_typeresolutionroom_idsession_idsize_mbstarted_atstatusupdated_atuser_idvideo_layoutwebhook_event_failover_urlwebhook_event_urlwebhook_timeout_secsDELETE /room_compositions/{room_composition_id}result = client.room_compositions.delete("5219b3af-87c6-4c08-9b58-5a533d893e21")
puts(result)GET /room_participantspage = client.room_participants.list
puts(page)contextidjoined_atleft_atrecord_typesession_idupdated_atGET /room_participants/{room_participant_id}room_participant = client.room_participants.retrieve("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(room_participant)contextidjoined_atleft_atrecord_typesession_idupdated_atGET /room_recordingspage = client.room_recordings.list
puts(page)codeccompleted_atcreated_atdownload_urlduration_secsended_atidparticipant_idrecord_typeroom_idsession_idsize_mbstarted_atstatustypeupdated_atDELETE /room_recordingsresponse = client.room_recordings.delete_bulk
puts(response)room_recordingsGET /room_recordings/{room_recording_id}room_recording = client.room_recordings.retrieve("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(room_recording)codeccompleted_atcreated_atdownload_urlduration_secsended_atidparticipant_idrecord_typeroom_idsession_idsize_mbstarted_atstatustypeupdated_atDELETE /room_recordings/{room_recording_id}result = client.room_recordings.delete("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(result)GET /room_sessionspage = client.rooms.sessions.list_0
puts(page)activecreated_atended_atidparticipantsrecord_typeroom_idupdated_atGET /room_sessions/{room_session_id}session = client.rooms.sessions.retrieve("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(session)activecreated_atended_atidparticipantsrecord_typeroom_idupdated_atPOST /room_sessions/{room_session_id}/actions/endresponse = client.rooms.sessions.actions.end_("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(response)resultPOST /room_sessions/{room_session_id}/actions/kickexcludeparticipantsresponse = client.rooms.sessions.actions.kick("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(response)resultPOST /room_sessions/{room_session_id}/actions/muteexcludeparticipantsresponse = client.rooms.sessions.actions.mute("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(response)resultPOST /room_sessions/{room_session_id}/actions/unmuteexcludeparticipantsresponse = client.rooms.sessions.actions.unmute("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(response)resultGET /room_sessions/{room_session_id}/participantspage = client.rooms.sessions.retrieve_participants("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(page)contextidjoined_atleft_atrecord_typesession_idupdated_atGET /roomspage = client.rooms.list
puts(page)active_session_idcreated_atenable_recordingidmax_participantsrecord_typesessionsunique_nameupdated_atwebhook_event_failover_urlwebhook_event_urlwebhook_timeout_secsPOST /roomsenable_recordingmax_participantsunique_namewebhook_event_failover_urlwebhook_event_urlwebhook_timeout_secsroom = client.rooms.create(unique_name: "my-meeting-room", max_participants: 10)
puts(room)active_session_idcreated_atenable_recordingidmax_participantsrecord_typesessionsunique_nameupdated_atwebhook_event_failover_urlwebhook_event_urlwebhook_timeout_secsGET /rooms/{room_id}room = client.rooms.retrieve("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(room)active_session_idcreated_atenable_recordingidmax_participantsrecord_typesessionsunique_nameupdated_atwebhook_event_failover_urlwebhook_event_urlwebhook_timeout_secsPATCH /rooms/{room_id}enable_recordingmax_participantsunique_namewebhook_event_failover_urlwebhook_event_urlwebhook_timeout_secsroom = client.rooms.update("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(room)active_session_idcreated_atenable_recordingidmax_participantsrecord_typesessionsunique_nameupdated_atwebhook_event_failover_urlwebhook_event_urlwebhook_timeout_secsDELETE /rooms/{room_id}result = client.rooms.delete("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(result)token_ttl_secsrefresh_token_ttl_secsPOST /rooms/{room_id}/actions/generate_join_client_tokenrefresh_token_ttl_secstoken_ttl_secsresponse = client.rooms.actions.generate_join_client_token("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(response)refresh_tokenrefresh_token_expires_attokentoken_expires_attoken_ttl_secsPOST /rooms/{room_id}/actions/refresh_client_tokenrefresh_tokentoken_ttl_secsresponse = client.rooms.actions.refresh_client_token(
"0ccc7b54-4df3-4bca-a65a-3da1ecc777f0",
refresh_token: "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ0ZWxueXhfdGVsZXBob255IiwiZXhwIjoxNTkwMDEwMTQzLCJpYXQiOjE1ODc1OTA5NDMsImlzcyI6InRlbG55eF90ZWxlcGhvbnkiLCJqdGkiOiJiOGM3NDgzNy1kODllLTRhNjUtOWNmMi0zNGM3YTZmYTYwYzgiLCJuYmYiOjE1ODc1OTA5NDIsInN1YiI6IjVjN2FjN2QwLWRiNjUtNGYxMS05OGUxLWVlYzBkMWQ1YzZhZSIsInRlbF90b2tlbiI6InJqX1pra1pVT1pNeFpPZk9tTHBFVUIzc2lVN3U2UmpaRmVNOXMtZ2JfeENSNTZXRktGQUppTXlGMlQ2Q0JSbWxoX1N5MGlfbGZ5VDlBSThzRWlmOE1USUlzenl6U2xfYURuRzQ4YU81MHlhSEd1UlNZYlViU1ltOVdJaVEwZz09IiwidHlwIjoiYWNjZXNzIn0.gNEwzTow5MLLPLQENytca7pUN79PmPj6FyqZWW06ZeEmesxYpwKh0xRtA0TzLh6CDYIRHrI8seofOO0YFGDhpQ"
)
puts(response)tokentoken_expires_atGET /rooms/{room_id}/sessionspage = client.rooms.sessions.list_1("0ccc7b54-4df3-4bca-a65a-3da1ecc777f0")
puts(page)activecreated_atended_atidparticipantsrecord_typeroom_idupdated_at