Fetching channels
Channels can be created to make a collection of radio content items. The Channels API endpoint is part of the Content REST API.
The Channel object
{
"id": "a4452199a-24027-4071-ae22-ef4e2fca254a6",
"created_on": "2017-06-08T09:27:59+00:00",
"changed_on": "2017-08-25T08:14:49+00:00",
"label": "Channel",
"name": "WebApp",
"type": "site",
}
FIELD | DESCRIPTION |
---|---|
id | Unique identifier for each item. |
created_on | UTC time at which the channel was created. |
changed_on | UTC time at which the channel was last updated. |
label | Identifier for the object. |
name | Name of the channel. |
type | Can be "site" or "channel" |
Fetching all channels
If you want to fetch a collection of channels you can use the channels collection endpoint.
GET https://api.eu1.prepr.io/channels
{
"items": [
{
"id": "a4452199a-24027-4071-ae22-ef4e2fca254a6",
"created_on": "2017-06-08T09:27:59+00:00",
"changed_on": "2017-08-25T08:14:49+00:00",
"label": "Channel",
"name": "WebApp",
"type": "site",
"slug": null
}
],
"total": 1,
"after": "YWZ0ZXJfMjU=",
"before": "YmVmb3JlXzA=",
"skip": 0,
"limit": 25
}
Arguments
The following arguments are available or required when querying a collection:
argument | type | required | description |
---|---|---|---|
q | String | false | Search by name. |
sort | String | false | created_on , changed_on , name |
slug | String | false | -- |
Query by ID
Since IDs are unique in Prepr, you can find the channel you want using the id argument. Here is an example that demonstrates how to query a channel with the ID "535c1e-...":
GET https://api.eu1.prepr.io/channels/{id}
Was this article helpful?
We’d love to learn from your feedback