Assets

Getting a list of assets

Endpoint

GET /v1/spaces/:space_id/assets

Request

cURL

curl "https://api.storyblok.com/v1/spaces/1018/assets" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxNTY5LCJ0aW1lc3RhbXAiOjE1MTEwNzk1MTJ9.k4jixJBb4RezVRS0ReY4tvCswXqJybJSsvogZrI7Xfw" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Body

{
  "assets": [

  ]
}

Get a single asset

Endpoint

GET /v1/spaces/:space_id/assets/:id

Request

cURL

curl "https://api.storyblok.com/v1/spaces/1017/assets/43" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxNTY4LCJ0aW1lc3RhbXAiOjE1MTEwNzk1MTJ9.um81C_h-QYQIGO66sFNJhlkVBQVkDqhxBWlNfJKtMS0" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Body

{
  "id": 43,
  "filename": "deserunt_rerum",
  "space_id": 1017,
  "created_at": "2017-11-12T08:18:32.520Z",
  "updated_at": "2017-11-12T08:18:32.520Z",
  "file": {
    "url": null
  },
  "asset_folder_id": null,
  "deleted_at": null
}

Sign asset

Endpoint

POST /v1/spaces/:space_id/assets

Parameters

Name Description
filename required filename

Request

cURL

curl "https://api.storyblok.com/v1/spaces/1015/assets" -d '{"filename":"test 2%2231.jpg"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxNTY2LCJ0aW1lc3RhbXAiOjE1MTEwNzk1MTJ9.fNfBXB5PA13HY3zgClYnqjHrSctxFLo2SC7HL_CuHM0" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Body

{
  "pretty_url": "//a.storyblok.com/f/1015/157a56b269/test-2-2231.jpg",
  "public_url": "https://s3.amazonaws.com/a.storyblok.com/f/1015/157a56b269/test-2-2231.jpg",
  "fields": {
    "key": "f/1015/157a56b269/test-2-2231.jpg",
    "acl": "public-read",
    "Expires": "Mon, 12 Nov 2018 08:18:32 GMT",
    "Cache-Control": "public; max-age=31536000",
    "Content-Type": "image/jpeg",
    "policy": "eyJleHBpcmF0aW9uIjoiMjAxNy0xMS0xMlQwODoyODozMloiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJhLnN0b3J5Ymxvay5jb20ifSx7ImtleSI6ImYvMTAxNS8xNTdhNTZiMjY5L3Rlc3QtMi0yMjMxLmpwZyJ9LHsiYWNsIjoicHVibGljLXJlYWQifSx7IkV4cGlyZXMiOiJNb24sIDEyIE5vdiAyMDE4IDA4OjE4OjMyIEdNVCJ9LHsiQ2FjaGUtQ29udHJvbCI6InB1YmxpYzsgbWF4LWFnZT0zMTUzNjAwMCJ9LHsiQ29udGVudC1UeXBlIjoiaW1hZ2UvanBlZyJ9LFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLDEsMjA5NzE1MTldLHsieC1hbXotY3JlZGVudGlhbCI6IkFLSUFJVTYyN0VOVVFUNFJXMjNBLzIwMTcxMTEyL3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSx7IngtYW16LWFsZ29yaXRobSI6IkFXUzQtSE1BQy1TSEEyNTYifSx7IngtYW16LWRhdGUiOiIyMDE3MTExMlQwODE4MzJaIn1dfQ==",
    "x-amz-credential": "AKIAIU627ENUQT4RW23A/20171112/us-east-1/s3/aws4_request",
    "x-amz-algorithm": "AWS4-HMAC-SHA256",
    "x-amz-date": "20171112T081832Z",
    "x-amz-signature": "ed4e4d74e4e1411944f674e4add081f307034a55f5aba961ab630140faa316de"
  },
  "post_url": "https://s3.amazonaws.com/a.storyblok.com"
}

Documentation