Connections through the data API are used to link objects with each others.
Some objects can only be accessed and/or created through connections since they have no point in existing on their own.
Here is the list of connections available through the playlist object.
Filters | Description |
|---|---|
| List of videos contained in this playlist (in the order defined by its owner). This connection joins an object of type playlist with a list of video objects. |
videos
videosList of videos contained in this playlist (in the order defined by its owner), this connection joins an object of type playlist with a list of video objects.
Read the playlist's videos connection
You can retrieve the list of videos connected to a playlist object - Trigger a GET request to /playlist/<PLAYLIST_ID>/videos.
You can specify the list of fields from the video objects to be returned using the fields parameter.
You can also see if any video is connected to an existing playlist object - Trigger a GET request to /playlist/<PLAYLIST_ID>/videos/<VIDEO_ID>.
This will return a list containing only the connected video object or an empty list if it is not connected.
Create a playlist's videos connection
You can connect videos to an existing playlist object one by one by issuing multiple POST requests to /playlist/<PLAYLIST_ID>/videos/<VIDEO_ID>.
You can connect multiple videos to an existing playlist object at once by issuing one POST request to /playlist/<PLAYLIST_ID>/videos?ids=<VIDEO_ID>,...,<VIDEO_ID>.
Note that the order of the identifiers is saved.
Delete a playlist's videos connection
You can disconnect videos from a playlist object by issuing DELETE requests to /playlist/<PLAYLIST_ID>/videos/<VIDEO_ID>.
You can also disconnect all videos at once by issuing a POST request to /playlist/<PLAYLIST_ID>/videos with an empty ids query-string parameter.
