Skip to content

Join or leave channels

PUT
/api/v1/audience/channels
curl --request PUT \
--url http://localhost:11044/api/v1/audience/channels \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "channels": [ "example" ] }'

The whole set, not a delta — a client that sends what it displays cannot drift from it. Names are normalised, so what an author wrote and what a user picked are the same channel.

Every channel the user should be in afterwards. A channel left out is left; an empty list leaves them all.

Media typeapplication/json

Body of PUT /audience/channels: the complete set of channels the user should be in afterwards.

object
channels
required

Every channel the user should be in afterwards, replacing the current set. Names are trimmed and lowercased, and blank ones dropped; empty or absent leaves every channel

Array<string>

Example generated

{
"channels": [
"example"
]
}

OK

Media typeapplication/json

The audience channels this world offers and the ones the acting user has joined. Answered by GET /audience/channels and, after the change, by PUT /audience/channels.

object
joined
required

The channels the acting user has joined, sorted by name; may include channels nothing currently declares

Array<string>
offered
required

Every channel a view or app in this world declares, whether or not anybody has joined it, sorted by name. Empty when the world could not be loaded

Array<object>

One audience channel this world’s content declares, and how much content joining it would reach.

object
apps
required

Number of apps in this world that declare the channel

integer format: int32
channel
required

Channel name, normalised to trimmed lowercase

string
views
required

Number of saved views in this world that declare the channel

integer format: int32

Example generated

{
"joined": [
"example"
],
"offered": [
{
"apps": 1,
"channel": "example",
"views": 1
}
]
}