Assets

Getting a list of assets

Endpoint

GET /v1/spaces/:space_id/assets

Request

cURL

curl "https://api.storyblok.com/v1/spaces/1098/assets" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyMDI4LCJ0aW1lc3RhbXAiOjE1MTU1MzA4Mzh9.3BdlItbqVHqyfxpsmMBpVfhOrb3Z4XXQ4VnrrGVoaW0" \

Response

Body

{
  "assets": [

  ]
}

Get a single asset

Endpoint

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

Request

cURL

curl "https://api.storyblok.com/v1/spaces/1097/assets/59" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyMDI3LCJ0aW1lc3RhbXAiOjE1MTU1MzA4Mzh9._Jqr9Ri9Alx6nRANkSNzxLFHAzMS3R0378O1aaCHyYI" \

Response

Body

{
  "id": 59,
  "filename": "ad-nihil",
  "space_id": 1097,
  "created_at": "2018-01-02T20:47:18.322Z",
  "updated_at": "2018-01-02T20:47:18.322Z",
  "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/1095/assets" -d '{"filename":"test 2%2231.jpg"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyMDI1LCJ0aW1lc3RhbXAiOjE1MTU1MzA4Mzh9.c7m2BfdCJGPm8rdsW2wY2_PK8GC81_gguLiawpP3ljA" \

Response

Body

{
  "pretty_url": "//a.storyblok.com/f/1095/64c88758d1/test-2-2231.jpg",
  "public_url": "https://s3.amazonaws.com/a.storyblok.com/f/1095/64c88758d1/test-2-2231.jpg",
  "fields": {
    "key": "f/1095/64c88758d1/test-2-2231.jpg",
    "acl": "public-read",
    "Expires": "Wed, 02 Jan 2019 20:47:18 GMT",
    "Cache-Control": "public; max-age=31536000",
    "Content-Type": "image/jpeg",
    "policy": "eyJleHBpcmF0aW9uIjoiMjAxOC0wMS0wMlQyMDo1NzoxOFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJhLnN0b3J5Ymxvay5jb20ifSx7ImtleSI6ImYvMTA5NS82NGM4ODc1OGQxL3Rlc3QtMi0yMjMxLmpwZyJ9LHsiYWNsIjoicHVibGljLXJlYWQifSx7IkV4cGlyZXMiOiJXZWQsIDAyIEphbiAyMDE5IDIwOjQ3OjE4IEdNVCJ9LHsiQ2FjaGUtQ29udHJvbCI6InB1YmxpYzsgbWF4LWFnZT0zMTUzNjAwMCJ9LHsiQ29udGVudC1UeXBlIjoiaW1hZ2UvanBlZyJ9LFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLDEsMjA5NzE1MTldLHsieC1hbXotY3JlZGVudGlhbCI6IkFLSUFJVTYyN0VOVVFUNFJXMjNBLzIwMTgwMTAyL3VzLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSx7IngtYW16LWFsZ29yaXRobSI6IkFXUzQtSE1BQy1TSEEyNTYifSx7IngtYW16LWRhdGUiOiIyMDE4MDEwMlQyMDQ3MThaIn1dfQ==",
    "x-amz-credential": "AKIAIU627ENUQT4RW23A/20180102/us-east-1/s3/aws4_request",
    "x-amz-algorithm": "AWS4-HMAC-SHA256",
    "x-amz-date": "20180102T204718Z",
    "x-amz-signature": "39d968c6d029daffbb490f95bcfededacf9f878717b85e4e68f9a19895ecfc9b"
  },
  "post_url": "https://s3.amazonaws.com/a.storyblok.com"
}

Documentation