Search for a station and start playing it.
POST/station
Station search: find a station matching one or more queries and create a play from it in a single call.
Failures are reported the same way as everywhere else on this surface,
so this endpoint answers with the usual HTTP statuses: a validation
error is a 400, a placement or station that could not be found is a 404,
and an unexpected failure is a 500. As everywhere
else, the errors whose mnemonics carry no status of their own —
noMoreMusic (9) and formatUnavailable (24) — still arrive as HTTP
200 with success: false, so keep checking success rather than
relying on the status line alone.
How the search runs:
qis an ordered array of queries. They are tried in order, and each query's matching stations are tried in turn; the first station that yields a playable track wins and the search stops there. A station that fails while creating a play (for example a sample station that isforbidden) is skipped rather than failing the request.- An empty
q: []is legal and means "give me the first playable station". - Each query's
type, when present, must be one ofradio,first_playorreplay. - Each query's
at, when present, must be a non-negative number. - Each query's
filterselects on the station'sname,uuidandoptions, and combines conditions with$and/$or; seeStationSearchQueryfor the grammar. Theqfilter onGET /stationreads the same grammar, but its field names resolve againstoptionsalone.
On success, play.station is the full station object, not the
minimal one returned by POST /play.
The returned play is reserved exactly as one from POST /play would
be. Play it as the station's first song: call
POST /play/{play_id}/start when its audio begins, without calling
POST /play first. Like any reserved play, it stops being valid once a
different play is started.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 500
- default
A created play, or one of the two failures that carry no HTTP
status of their own. Check success before reading anything else.
On success the body carries the created play (with the full
station) and the placement it came from.
On failure the body is a FeedErrorPayload with one of:
noMoreMusic(9) — stations matched but none of them had a track left to play.formatUnavailable(24) — no audio file matched the requestedformats/max_bitrate.
Neither mnemonic has an HTTP status of its own, so both default to
200. A request that passes force200 also lands here whatever the
failure, with the real status in error.status.
missingParameter (code 16) — Missing client id. The client id is
resolved before the search runs, so a request without one never
reaches the search itself.
invalidParameter (code 15) — the body is not a JSON object, q is
not an array, an entry of q is not a plain object, type is not
one of radio/first_play/replay, or at is not a non-negative
number.
Credentials were missing or invalid. The response carries
WWW-Authenticate: Basic realm="Feed.fm".
Response Headers
The authentication challenge. Always Basic realm="Feed.fm".
Basic realm="Feed.fm"forbidden (code 6) — Missing client credentials. The request
carried no usable consumer credentials.
A station that raises forbidden while creating a play — a sample
station, say — is skipped so the search can try the next candidate,
and does not surface here.
missingObject (code 17) — No matching station was found, or
Could not find any streaming music associated with this application when the credentials have no default placement.
internalError (code 18) — an unexpected failure while searching,
one that maps to none of the documented error codes. The cause is
logged server-side and is not reflected in the body.
An error occurred.