Media
Import or upload a media
Adds a file (multipart) or an https URL that Sofia fetches to the media library of an establishment. Needs a live application and an active subscription.
Authorizations
AuthorizationstringrequiredYour personal key or OAuth access token, sent as
Bearer <token>.
Headers
Idempotency-KeystringReplayed with the same body, the request returns the same response without a second import. It covers the form fields, not the file bytes.
Body
application/json, multipart/form-data
establishmentIdstringrequiredThe establishment whose media library receives the media
urlstringJSON: the
httpsaddress of the media, which Sofia fetches itself (no file)filestring<binary>multipart/form-data: the file (image or video), withouturl
Response
201application/json
The media added to the library.
idstringrequiredIdentifier of the media, to pass in
media[].idof a posttypestringrequiredKind of the media
Allowed values:
imagevideourlstringrequiredSigned address, valid for the current window
400
Malformed body.
401
The token is missing, unknown, expired or revoked.
402
subscription_required.
403
live_mode_required for a test application, or the media:write scope is missing.
404
Establishment outside the Workspace of the token.
413
payload_too_large: above the size limit of the app.
422
media_import_refused, with its reason: private_address, too_large, unsupported_media, unreachable, timeout, invalid_url, redirect_limit or removed_from_library. media_upload_refused for a file.
4XXapplication/json
Any other error, in the error envelope.