Skip to contentSkip to navigationSkip to topbar
On this page

PublishedTrack


The Published Track resource is a subresource of a Participant instance resource. It represents the Tracks a Participant is currently publishing to the Room.

Using the Published Track resource, you can query tracks published to a Room. You can also get a list of Tracks associated with a given Participant.


Published Track Instance Resource

published-track-instance-resource page anchor

Resource URI

resource-uri page anchor
1
/v1/Rooms/{RoomNameOrSid}/Participants/{ParticipantIdentityOrSid}/PublishedTracks/{TrackNameOrSid}
2

Resource Properties

resource-properties page anchor
Property nameTypeRequiredDescriptionChild properties
sidSID<MT>

Optional

Not PII

The unique string that we created to identify the RoomParticipantPublishedTrack resource.

Pattern: ^MT[0-9a-fA-F]{32}$Min length: 34Max length: 34

participant_sidSID<PA>

Optional

The SID of the Participant resource with the published track.

Pattern: ^PA[0-9a-fA-F]{32}$Min length: 34Max length: 34

room_sidSID<RM>

Optional

The SID of the Room resource where the track is published.

Pattern: ^RM[0-9a-fA-F]{32}$Min length: 34Max length: 34

namestring

Optional

The track name. Must be no more than 128 characters, and be unique among the participant's published tracks.


date_updatedstring<date-time>

Optional

The date and time in GMT when the resource was last updated specified in ISO 8601(link takes you to an external page) format.


enabledboolean

Optional

Whether the track is enabled.


kindenum<string>

Optional

The track type. Can be: audio, video or data.

Possible values:
audiovideodata

urlstring<uri>

Optional

The absolute URL of the resource.

Returns a single Track resource represented by TrackNameOrSid.

Retrieve a Track published to the Room by a Participant by TrackNameOrSid

retrieve-a-track-published-to-the-room-by-a-participant-by-tracknameorsid page anchor
Retrieve Track Published by a ParticipantLink to code sample: Retrieve Track Published by a Participant
1
// NOTE: This example uses the next generation Twilio helper library - for more
2
// information on how to download and install this version, visit
3
// https://www.twilio.com/docs/libraries/node
4
var apiKeySid = 'SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
5
var apiKeySecret = 'your_api_key_secret';
6
var accountSid = process.env.TWILIO_ACCOUNT_SID;
7
var Twilio = require('twilio');
8
9
var client = new Twilio(apiKeySid, apiKeySecret, {accountSid: accountSid});
10
11
client.video.rooms('DailyStandup').participants.get('Alice')
12
.publishedTracks.get('Camera')
13
.fetch()
14
.then(publishedTrack => {
15
console.log(publishedTrack.kind);
16
});

Output

1
{
2
"kind": "video",
3
"name": "Camera",
4
"date_updated": null,
5
"sid": "MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
6
"enabled": true,
7
"url": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/PublishedTracks/MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
8
"date_created": "2017-12-13T23:46:36Z",
9
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
10
"participant_sid": "PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
11
}

Not supported.


Published Track List Resource

published-track-list-resource page anchor
1
/v1/Rooms/{RoomNameOrSid}/Participants/{ParticipantIdentityOrSid}/PublishedTracks/
2

Returns a list of tracks associated with a given Participant. The list includes paging information. Only currently Published Tracks are in the list resource.

Note: No filters supported.

Retrieve Tracks published to the Room by a Participant

retrieve-tracks-published-to-the-room-by-a-participant page anchor
Retrieve Tracks Published by a ParticipantLink to code sample: Retrieve Tracks Published by a Participant
1
// NOTE: This example uses the next generation Twilio helper library - for more
2
// information on how to download and install this version, visit
3
// https://www.twilio.com/docs/libraries/node
4
var apiKeySid = 'SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
5
var apiKeySecret = 'your_api_key_secret';
6
var accountSid = process.env.TWILIO_ACCOUNT_SID;
7
var Twilio = require('twilio');
8
9
var client = new Twilio(apiKeySid, apiKeySecret, {accountSid: accountSid});
10
11
client.video.rooms('DailyStandup')
12
.participants.get('Alice')
13
.publishedTracks.list()
14
.then(publishedTracks => {
15
publishedTracks.forEach(publishedTrack => console.log(publishedTrack.sid))
16
});

Output

1
{
2
"meta": {
3
"page": 0,
4
"page_size": 50,
5
"first_page_url": "https://video.twilio.com/v1/Rooms/DailyStandup/Participants/ZestyYolandaZimmerman/PublishedTracks?PageSize=50&Page=0",
6
"previous_page_url": null,
7
"url": "https://video.twilio.com/v1/Rooms/DailyStandup/Participants/ZestyYolandaZimmerman/PublishedTracks?PageSize=50&Page=0",
8
"next_page_url": null,
9
"key": "published_tracks"
10
},
11
"published_tracks": [{
12
"kind": "audio",
13
"name": "moderator-audio",
14
"date_updated": null,
15
"sid": "MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
16
"enabled": true,
17
"url": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/PublishedTracks/MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
18
"date_created": "2017-12-13T23:46:36Z",
19
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
20
"participant_sid": "PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
21
}, {
22
"kind": "video",
23
"name": "moderator-camera",
24
"date_updated": null,
25
"sid": "MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
26
"enabled": true,
27
"url": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/PublishedTracks/MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
28
"date_created": "2017-12-13T23:46:36Z",
29
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
30
"participant_sid": "PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
31
}]
32
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.