{
"method": "get",
"url": "https://api.edufocal.net/videos/upload?extension=mp4&metadata[name]=foo&metadata[height]=100&metadata[width]=100",
"headers":{
"Authentication": bearer ...
}
}
Output will look something similar to
{
"url": "https://edufocal-dev-whale.nyc3.digitaloceanspaces.com/content/video/f79040ee-ce74-4093-806b-f11997dc745b.mp4?x-amz-meta-client=api&x-amz-meta-identifier=&x-amz-meta-name=content%2Fvideo%2Ff79040ee-ce74-4093-806b-f11997dc745b.mp4&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=S7GLITG7YM35CCAGQ6YL%2F20210602%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20210602T194607Z&X-Amz-SignedHeaders=host%3Bx-amz-meta-client%3Bx-amz-meta-identifier%3Bx-amz-meta-name&X-Amz-Expires=600&X-Amz-Signature=a46c664be455280f78c00eb8a0f131400d31f0ffc83f494f7efe6fcf6bf0eb48",
"headers": {
"x-amz-meta-client": "api",
"x-amz-meta-identifier": 1,
"x-amz-meta-name": "foo",
"x-amz-meta-height": 100,
"x-amz-meta-width": 100,
}
}
Now to upload we do
url = response["url"];
//Headers needed to be passed along with `PUT` request
headers = response["headers"];
fetch(url, {
method:"PUT",
headers: headers
...
}).then((res)=> res.json())
.then((res){
console.log("success")
})
Spaces expects that all custom metadata created be passed along with yourPUT
requests.
The /videos/upload/
endpoint returns an array of headers to be passed when uploading