Get list of videos
Fetching video list
Listing videos is done by sending a GET request to the /videos endpoint.
curl -X GET https://app.ignitevideo.cloud/api/videos \
-H "Authorization: Bearer YOUR_TOKEN"Query Parameters
You can add the following URL query parameters to the request:
| Parameter | Type | Description |
|---|---|---|
page | number | The page number to fetch. |
limit | number | The number of videos to fetch per page. |
sortBy | string | The field to sort by. |
where | object | Custom query to filter the videos. |
Example
/api/videos?page=1&limit=10&sortBy=-createdAtAPI Response
The response is a JSON object with the following properties:
{
"docs": [...], // Array of video objects
"totalDocs": number,
"limit": number,
"totalPages": number,
"page": number,
"pagingCounter": number,
"hasPrevPage": boolean,
"hasNextPage": boolean,
"prevPage": number | null,
"nextPage": number | null
}Using custom queries
You can add custom queries to the list of videos by adding a where object to the query parameters.
?where[status][equals]=COMPLETEMore complex queries get unavoidably more difficult to write as query strings. For this reason, we recommend to use the extremely helpful and ubiquitous qs package to parse your JSON / object-formatted queries into query strings for use with the REST API.
const qs = require('qs');
const query = qs.stringify({
where: {
status: {
equals: 'COMPLETE'
}
and: [
{ visibility: { equals: 'private' } },
]
}
});Resulting query string:
/api/videos?where[status][equals]=COMPLETE&where[and][0][visibility][equals]=private