Poster /poster

Warning

This endpoint is in develop and it could be completely changed or removed in next versions.

Use it with caution.

Get the image representation of object object_id as thumbnail url

GET /poster/(object_id)

Get the thumbnail url of an image representation of the object object_id. The thumbnail returned depends from the object type of object_id and from its relations, in particular:

  1. if object object_id has a ‘poster’ relation with an image object then it returns a thumbnail of that image
  2. else if the object is an image then it returns a thumbnail of the object
  3. else if the object has an ‘attach’ relation with an image object then it returns a thumbnail of that image
Request Headers:
 
Parameters:
  • object_id (int|string) – identify a BEdita object. It can be the object id or the object unique name (nickname)
Query Parameters:
 
  • width (int) – the thumbnail width
  • height (int) – the thumbnail height
Response Headers:
 
Status Codes:
  • 200 OK – Success
  • 401 Unauthorized – The object object_id is protected and the request is not authorized
  • 403 Forbidden – The request is authorized but without sufficient permission to access object object_id
  • 404 Not Found – Object object_id not found

Example request:

GET /poster/5 HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json

Example response:

HTTP/1.1 200 Success
Host: example.com
Accept: application/json, text/javascript
Content-Type: application/json

{
 "api": "poster",
 "data": {
   "id": 5,
   "uri": "https://media.server/path/to/thumb/thumbnail.jpg"
 },
 "method": "get",
 "params": [],
 "url": "https://example.com/api/poster/5"
}