MediaList media

Media

List media

Lists the media library of an establishment, newest first, page by page, with URLs signed for the current window. Works in test and live.

GEThttps://api.sofia-post.com/api/v1/media
GET/v1/media
curl -X GET 'https://api.sofia-post.com/api/v1/media' \
  -H "Authorization: Bearer $SOFIA_API_KEY"

Authorizations

  • Authorizationstringrequired

    Your personal key or OAuth access token, sent as Bearer <token>.

Query parameters

  • establishmentIdstringrequired

    The establishment whose media library is read.

  • cursorstring

    The nextCursor of the previous page.

  • limitnumber

    Page size, from 1 to 100 (default 20).

Response

200application/json

A page of media, with nextCursor when more follow.

  • dataobject[]required

    The media of the page

    Show child attributes
    • idstringrequired

      Identifier of the media, to pass in media[].id of a post

    • typestringrequired

      Kind of the media

      Allowed values: imagevideo

    • urlstringrequired

      Signed address, valid for the current window

    • fileNamestringrequired

      Name of the file

    • contentTypestringrequired

      MIME type of the file

    • sizenumberrequired

      Size in bytes

    • createdAtstring<date-time>required

      When the media was added

    • thumbnailUrlstring

      Signed thumbnail (poster of a video, square of an image)

  • nextCursorstring

    Pass it as ?cursor= for the next page; absent at the end

400

invalid_cursor, or invalid_request.

404

establishment_not_found: out of reach of the token.

4XXapplication/json

Any other error, in the error envelope.