API referenceMediaObject
Uploads an image for an order's content.
Send multipart/form-data with file, an image of at most 5 MB and at least 100×100 px, and order, the id of the order it belongs to. The client uploads for its own orders, the publisher for orders it works on. The answer's @id is /api/media_objects/{id}. To show the image in the article, put <img src="https://<API host>/api/media_objects/{id}"> with the full URL into contentRevision.body (PATCH /api/orders/{id}/update-content). A wrong file or an unknown order is answered 422 with the reason.
POST
/api/media_objectscurl -X POST "/api/media_objects" \
-H "apikey: $MEDIALISTER_CLIENT_API_KEY" \
-H "Content-Type: multipart/form-data" \
-d '{"order":"18b08a1d-81b5-440b-a858-b8a0951fd3fa"}'Authorization
apikeystringheaderrequiredValue for the apikey header parameter.
Body
multipart/form-data
The new MediaObject resource
filestring<binary>orderstring
Response
application/ld+json
MediaObject resource created
@contextone of@idstringrequired@typestringrequiredcontentUrlstring | nullfilePathstring
{
"@context": "string",
"@id": "string",
"@type": "string",
"contentUrl": "string",
"filePath": "string"
}