Sites & Organisation

Media

A Media represents a file uploaded to Trybe.

The Media object

Attributes

  • iduuidrequired

    Unique identifier of the uploaded media item, returned from createMedia. Pass this ID into any field that accepts a media reference (logos, hero images, product images, etc.).

  • file_namestringrequired

    Original filename of the uploaded asset, preserved as provided at upload time. Used for display in the media library and as a hint when serving downloads.

  • mime_typestringrequired

    The mime type of the media item.

  • original_urlstringrequired

    The url of the media resource.

  • sizeintegerrequired

    The size of the media item in bytes.

  • urlstringrequired

    The url of the converted media resource.

{
  "id": "00000000-0000-0000-0000-000000000000",
  "file_name": "super-cool-photo.jpg",
  "mime_type": "image/jpeg",
  "original_url": "https://example.com/media/super-cool-photo.jpg",
  "size": 84256,
  "url": "https://example.com/media/super-cool-photo-thumbnail@2x.jpg"
}
post/shop/media

Stores a media object

createMedia

Uploads some Media and returns a Media object.

Request body

  • filebinaryoptional

    The binary of the uploaded asset.

  • imagebinaryoptional

    The binary of the uploaded asset.

  • organisation_iduuidoptional

    Identifier of the organisation to upload this media item against. Media is scoped per organisation so each customer's library is isolated. The caller's API key must have access to this organisation.

  • collectionstringoptional

    The collection which this media should be categorised under.

    Possible values:library

Responses

  • 200

    The media was successfully uploaded.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

get/shop/media/{mediaId}

Retrieve a media object

getMedia

Retrieves details about the given Media object

Path parameters

  • mediaIduuidrequired

    The ID of the Media resource

Responses

  • 200

    The media was successfully retrieved

  • 401

    The user is unauthenticated

  • 404

    The resource couldn't be found