Developers

REST API

Everything here describes itself: send OPTIONS to a route for its arguments and schema. The tables below come from the same registration code.

The track on media

Every audio and video item in wp/v2/media carries riff_track: The file as a track the player reads; null for files that are not audio or video. It is read only, and null for any other file. Its shape is the track schema.

GET /wp-json/wp/v2/media/123?_fields=id,riff_track

Routes

GET /riff/v1/library

riff-library

Arguments

NameTypeDescription
pageintegerPage of the library. Default 1.

Response

PropertyTypeDescription
itemsarray
items[].idintegerPost ID.
items[].titlestringPost title.
items[].urlstringPermalink.
items[].artiststringThe artist every track shares, or empty.
items[].artarrayArtwork, smallest first.
items[].art[].srcstring
items[].art[].sizesstring
items[].countintegerNumber of tracks.
items[].metastringA one-line byline for the post, written by a feature that knows how to say it in the language.
items[].durationnumberTotal length in seconds, 0 when unknown.
pageinteger
pagesinteger
totalinteger

GET /riff/v1/library/{id}

riff-library-post

Arguments

NameTypeDescription
idinteger RequiredPost ID.

Response

PropertyTypeDescription
idintegerPost ID.
titlestringPost title.
urlstringPermalink.
artiststringThe artist every track shares, or empty.
artarrayArtwork, smallest first.
art[].srcstring
art[].sizesstring
countintegerNumber of tracks.
metastringA one-line byline for the post, written by a feature that knows how to say it in the language.
durationnumberTotal length in seconds, 0 when unknown.
tracksarrayThe tracks, in order, as the player reads them.
htmlstringThe media blocks rendered as the post renders them.

WPGraphQL

When WPGraphQL is active, Riff adds these fields and types.

FieldDescription
MediaItem.riffTrackRiffTrackThe file as a track, for audio and video.
Post.riffTracks[RiffTrack]The tracks in the post, in order.

RiffArt

One size of a track's artwork.

FieldType
srcString
sizesString

RiffVideo

The video version of an audio track.

FieldType
srcString
posterString

RiffPost

The post a track appears in.

FieldType
idInt
titleString
urlString

RiffTrack

A file as a track the Riff player reads.

FieldType
idString
srcString
typeString
titleString
artistString
albumString
durationFloat
formatString
bitrateInt
losslessBoolean
bitsInt
rateInt
levelsString
art[RiffArt]
videoRiffVideo
postRiffPost