Media API

Media API

/media

GET

Requests description of all media available in the current context.

Query Parameters

limit number  default: 100 The amount of items that should be returned.
offset number  default: 0 Define an offset for getting the items starting at this number.

Responses

200 OK

Lists the media descriptions, sorted by their ID descending.

Example:

{
  "total": 695,
  "limit": 3,
  "offset": 0,
  "data": [{
    "id": "59030cf2e4b04bb1e8e848f3",
    "ownerID": "57b70544e4b02dce08bd7201",
    "ownerType": "user",
    "publicID": "47BBeDRiKxCB1olYblWvLKTWbO6TSna87jtEM6G3CduaOeUlfi6mAnqCVzvCwgSE0qCwuSI0DH8pTV2ZdRp63rT6lLDVn0aYMxq2LylMinxVWNwvm7IkowpcaMYa6FTEFXliZry5zllk7HlWSockIe3mhp3OZbvAh1zESsDpo9iMD2PrnRldjsMW26dx5L0t/oceans.mp4",
    "resourceInfo": {
      "type": "video",
      "bytes": 19448241,
      "width": 640,
      "height": 266,
      "url": "https://cdn.eyo.net/production/video/upload/v1493372148/47BBeDRiKxCB1olYblWvLKTWbO6TSna87jtEM6G3CduaOeUlfi6mAnqCVzvCwgSE0qCwuSI0DH8pTV2ZdRp63rT6lLDVn0aYMxq2LylMinxVWNwvm7IkowpcaMYa6FTEFXliZry5zllk7HlWSockIe3mhp3OZbvAh1zESsDpo9iMD2PrnRldjsMW26dx5L0t/oceans.mp4",
      "format": "mp4",
      "mimeType": "video/mp4",
      "duration": 46.5465
    },
    "transformations": {
      "t_preview": {
        "transformationString": "t_preview",
        "status": "FINISHED",
        "resourceInfo": {
          "type": "image",
          "bytes": 16424,
          "width": 640,
          "height": 266,
          "url": "https://cdn.eyo.net/production/image/upload/t_preview/v1493372148/47BBeDRiKxCB1olYblWvLKTWbO6TSna87jtEM6G3CduaOeUlfi6mAnqCVzvCwgSE0qCwuSI0DH8pTV2ZdRp63rT6lLDVn0aYMxq2LylMinxVWNwvm7IkowpcaMYa6FTEFXliZry5zllk7HlWSockIe3mhp3OZbvAh1zESsDpo9iMD2PrnRldjsMW26dx5L0t/oceans.jpeg",
          "format": "jpeg",
          "mimeType": "image/jpeg"
        }
      }
    },
    "fileName": "oceans.mp4",
    "entityType": "medium"
  }, {
    "id": "59030b4ce4b04bb1e8e848e6",
    "ownerID": "57b70544e4b02dce08bd7201",
    "ownerType": "user",
    "publicID": "RVVfBoIDk0gFWL12SyzFZqLgJfGoTQwp12Kc8NPF4wM8ZI9j9Og55xlS6uMW7FatQQzOg1Trx1zeWfBAOv3kzFbBHWauV0HgysBsg6NHqFkLQZjjO1cbd0KaqrooeueyHEXqh1QQZ2vjbAMBLfJpIctSDY4X1RywwETYzpKZ64jnVXdIYGBjhCJ1rci29QvQ/g",
    "resourceInfo": {
      "type": "pdf",
      "bytes": 9726,
      "url": "https://cdn.eyo.net/production/raw/upload/v1493371724/RVVfBoIDk0gFWL12SyzFZqLgJfGoTQwp12Kc8NPF4wM8ZI9j9Og55xlS6uMW7FatQQzOg1Trx1zeWfBAOv3kzFbBHWauV0HgysBsg6NHqFkLQZjjO1cbd0KaqrooeueyHEXqh1QQZ2vjbAMBLfJpIctSDY4X1RywwETYzpKZ64jnVXdIYGBjhCJ1rci29QvQ/g.pdf",
      "format": "pdf",
      "mimeType": "application/pdf"
    },
    "transformations": {
      "t_preview": {
        "transformationString": "t_preview",
        "status": "FINISHED",
        "resourceInfo": {
          "type": "image",
          "bytes": 68145,
          "width": 707,
          "height": 1000,
          "url": "https://cdn.eyo.net/production/image/upload/t_preview/v1493371724/RVVfBoIDk0gFWL12SyzFZqLgJfGoTQwp12Kc8NPF4wM8ZI9j9Og55xlS6uMW7FatQQzOg1Trx1zeWfBAOv3kzFbBHWauV0HgysBsg6NHqFkLQZjjO1cbd0KaqrooeueyHEXqh1QQZ2vjbAMBLfJpIctSDY4X1RywwETYzpKZ64jnVXdIYGBjhCJ1rci29QvQ/g.jpeg",
          "format": "jpeg",
          "mimeType": "image/jpeg"
        }
      }
    },
    "fileName": "g.pdf",
    "entityType": "medium"
  }, {
    "id": "59030a3fe4b04bb1e8e848e1",
    "ownerID": "57b70544e4b02dce08bd7201",
    "ownerType": "user",
    "publicID": "cryAOqaNrAjK0GQRZysRqVsLno4t8qehfSWwLqjJqdzf3ujzI6waTEJP3s2IJGCq6D1ZUxKLud7xb6CmW1VMYaIA4iG0n4GSQbmUUHe61YBg0z7VkvyxD7lJ11RHtbWqzhkBGmyo0NPva0JbPS5hx8x36HIrbGpkmQo4y2WOdNzVWW3R4zYbw6YQGUPJLKZt/Auswahl_110",
    "resourceInfo": {
      "type": "image",
      "bytes": 32387,
      "width": 545,
      "height": 335,
      "url": "https://cdn.eyo.net/production/image/upload/v1493371455/cryAOqaNrAjK0GQRZysRqVsLno4t8qehfSWwLqjJqdzf3ujzI6waTEJP3s2IJGCq6D1ZUxKLud7xb6CmW1VMYaIA4iG0n4GSQbmUUHe61YBg0z7VkvyxD7lJ11RHtbWqzhkBGmyo0NPva0JbPS5hx8x36HIrbGpkmQo4y2WOdNzVWW3R4zYbw6YQGUPJLKZt/Auswahl_110.png",
      "format": "png",
      "mimeType": "image/png"
    },
    "transformations": {
      "t_preview": {
        "transformationString": "t_preview",
        "status": "FINISHED",
        "resourceInfo": {
          "type": "image",
          "bytes": 32785,
          "width": 545,
          "height": 335,
          "url": "https://cdn.eyo.net/production/image/upload/t_preview/v1493371455/cryAOqaNrAjK0GQRZysRqVsLno4t8qehfSWwLqjJqdzf3ujzI6waTEJP3s2IJGCq6D1ZUxKLud7xb6CmW1VMYaIA4iG0n4GSQbmUUHe61YBg0z7VkvyxD7lJ11RHtbWqzhkBGmyo0NPva0JbPS5hx8x36HIrbGpkmQo4y2WOdNzVWW3R4zYbw6YQGUPJLKZt/Auswahl_110.png",
          "format": "png",
          "mimeType": "image/png"
        }
      }
    },
    "fileName": "Auswahl_110.png",
    "entityType": "medium"
  }]
}
401 Unauthorized

This may occur when a valid token is missing.

Example:

{
  "identifier": 40102,
  "statusCode": 401,
  "message": "This end point requires authentication.",
  "type": "NotLoggedInException"
}

POST

Starts a new upload.

Body

Content-type: multipart/form-data

Properties
  • metaData (object)The type of the upload, maybe ‘image’, ‘video’, ‘pdf’ or ‘raw’. The type is merely a hint to trigger additional preprocessing for the file.

    Example:

    {
      "type": "video"
    }
    
  • file (file)Some arbitrary file. You can give it a name by specifying the file’s name within the content disposition.

Responses

200 OK

We always try to extract a preview image, independently of the existence and/or the content of the metaData part in the request. You may find the preview image in the transformations object that is part of the response to this request. The value for the key ‘t_preview’ describes the preview image (for images, videos and PDF uploads). If ‘t_preview’ is absent, we were unable to extract a preview for the uploaded file. If there are no pre-rendered transformations available, the “transformations” field may be completely absent in the response.

Example:

{
   "id": "59087db9e4b0fe32823e90d7",
   "ownerID": "57b70544e4b02dce08bd7201",
   "ownerType": "user",
   "publicID": "DUwyQadOFvesniFtbYejtFS464F7nV5QbhGreZGE6dcFjFSVHkwIqfH2hgKkWoMuKSszjvCf6nH0s5YcvWHQykKrh70V0wDWErCb1fuTjjHY3DJGxx1semVLnetwxMimx2Jnmd053PZUawKGiF8k98b88fP44jaxH4D7a6BV9ZM1oH0S5mK7G7f9UM19KozD/oceans.mp4",
   "resourceInfo": {
      "type": "video",
      "bytes": 19448241,
      "width": 640,
      "height": 266,
      "url": "https://cdn.eyo.net/production/video/upload/v1493728699/DUwyQadOFvesniFtbYejtFS464F7nV5QbhGreZGE6dcFjFSVHkwIqfH2hgKkWoMuKSszjvCf6nH0s5YcvWHQykKrh70V0wDWErCb1fuTjjHY3DJGxx1semVLnetwxMimx2Jnmd053PZUawKGiF8k98b88fP44jaxH4D7a6BV9ZM1oH0S5mK7G7f9UM19KozD/oceans.mp4",
      "format": "mp4",
      "mimeType": "video/mp4",
      "duration": 46.5465
   },
   "transformations": {
      "t_preview": {
	 "transformationString": "t_preview",
	 "status": "FINISHED",
	 "resourceInfo": {
	    "type": "image",
	    "bytes": 16424,
	    "width": 640,
	    "height": 266,
	    "url": "https://cdn.eyo.net/production/image/upload/t_preview/v1493728699/DUwyQadOFvesniFtbYejtFS464F7nV5QbhGreZGE6dcFjFSVHkwIqfH2hgKkWoMuKSszjvCf6nH0s5YcvWHQykKrh70V0wDWErCb1fuTjjHY3DJGxx1semVLnetwxMimx2Jnmd053PZUawKGiF8k98b88fP44jaxH4D7a6BV9ZM1oH0S5mK7G7f9UM19KozD/oceans.jpeg",
	    "format": "jpeg",
	    "mimeType": "image/jpeg"
	 }
      }
   },
   "fileName": "oceans.mp4",
   "entityType": "medium"
}
401 Unauthorized

This may occur when a valid token is missing.

Example:

{
  "identifier": 40102,
  "statusCode": 401,
  "message": "This end point requires authentication.",
  "type": "NotLoggedInException"
}

/media/{mediumID}

GET

URI Parameters

mediumID string  required The ID of the requested medium.
Body

Content-type: application/json

Example:

{
  "id": "59030cf2e4b04bb1e8e848f3",
  "ownerID": "57b70544e4b02dce08bd7201",
  "ownerType": "user",
  "publicID": "47BBeDRiKxCB1olYblWvLKTWbO6TSna87jtEM6G3CduaOeUlfi6mAnqCVzvCwgSE0qCwuSI0DH8pTV2ZdRp63rT6lLDVn0aYMxq2LylMinxVWNwvm7IkowpcaMYa6FTEFXliZry5zllk7HlWSockIe3mhp3OZbvAh1zESsDpo9iMD2PrnRldjsMW26dx5L0t/oceans.mp4",
  "resourceInfo": {
    "type": "video",
    "bytes": 19448241,
    "width": 640,
    "height": 266,
    "url": "https://cdn.eyo.net/production/video/upload/v1493372148/47BBeDRiKxCB1olYblWvLKTWbO6TSna87jtEM6G3CduaOeUlfi6mAnqCVzvCwgSE0qCwuSI0DH8pTV2ZdRp63rT6lLDVn0aYMxq2LylMinxVWNwvm7IkowpcaMYa6FTEFXliZry5zllk7HlWSockIe3mhp3OZbvAh1zESsDpo9iMD2PrnRldjsMW26dx5L0t/oceans.mp4",
    "format": "mp4",
    "mimeType": "video/mp4",
    "duration": 46.5465
  },
  "transformations": {
    "t_preview": {
      "transformationString": "t_preview",
      "status": "FINISHED",
      "resourceInfo": {
        "type": "image",
        "bytes": 16424,
        "width": 640,
        "height": 266,
        "url": "https://cdn.eyo.net/production/image/upload/t_preview/v1493372148/47BBeDRiKxCB1olYblWvLKTWbO6TSna87jtEM6G3CduaOeUlfi6mAnqCVzvCwgSE0qCwuSI0DH8pTV2ZdRp63rT6lLDVn0aYMxq2LylMinxVWNwvm7IkowpcaMYa6FTEFXliZry5zllk7HlWSockIe3mhp3OZbvAh1zESsDpo9iMD2PrnRldjsMW26dx5L0t/oceans.jpeg",
        "format": "jpeg",
        "mimeType": "image/jpeg"
      }
    }
  },
  "fileName": "oceans.mp4",
  "entityType": "medium"
}

Responses

401 Unauthorized

Example:

{
  "identifier": 40102,
  "statusCode": 401,
  "message": "This end point requires authentication.",
  "type": "NotLoggedInException"
}
404 Not found

Example:

{
  "identifier": 40408,
  "statusCode": 404,
  "message": "User '5791e3ffd4c61f21c3df8b9' could not be found.",
  "type": "NotFoundException"
}

DELETE

Deletes the medium by its ID. While this will immediately remove the resource from our servers, the CDN may still deliver the content via the URL stated in resourceInfo.url  until CDN invalidation.

URI Parameters

mediumID string  required The ID of the requested medium.

Responses

401 Unauthorized

This may occur when a valid token is missing.

Example:

{
  "identifier": 40102,
  "statusCode": 401,
  "message": "This end point requires authentication.",
  "type": "NotLoggedInException"
}
403 Forbidden

This may occur when the used token has not the required permissions to perform this action.

Example:

{
  "identifier": 40308,
  "statusCode": 403,
  "message": "Access to branch 'null' is restricted.",
  "type": "AccessDeniedException"
}
404 Not found

This may occur when the requested resource does not exist.

Example:

{
  "identifier": 40408,
  "statusCode": 404,
  "message": "User '5791e3ffd4c61f21c3df8b9' could not be found.",
  "type": "NotFoundException"
}