curl --request POST \
--url http://{defaultHost}/api/v2/platform/digitals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form digital[attachment]='@example-file' \
--form 'digital[variant_id]=123'{
"data": {
"id": "24",
"type": "digital",
"attributes": {
"url": "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBLUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--6cac9cd14eb0139474e42d68585bead023589c85/icon_256x256.jpg",
"content_type": "image/png",
"filename": "icon_256x256.jpg",
"byte_size": 818
},
"relationships": {
"variant": {
"data": {
"id": "94",
"type": "variant"
}
}
}
}
}Creates a Digital Asset
curl --request POST \
--url http://{defaultHost}/api/v2/platform/digitals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form digital[attachment]='@example-file' \
--form 'digital[variant_id]=123'{
"data": {
"id": "24",
"type": "digital",
"attributes": {
"url": "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBLUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--6cac9cd14eb0139474e42d68585bead023589c85/icon_256x256.jpg",
"content_type": "image/png",
"filename": "icon_256x256.jpg",
"byte_size": 818
},
"relationships": {
"variant": {
"data": {
"id": "94",
"type": "variant"
}
}
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes
Record created
Show child attributes
Was this page helpful?