How to create signed URL via the API
Hi,
I'm trying to follow this API guide: https://techdocs.akamai.com/linode-api/reference/post-object-storage-object-url
to create a signed URL for one of the files stored in a bucket, but when I send
POST https://api.linode.com/v4/object-storage/buckets/my_clusterId/my_bucket/object-url
Content-Type: "application/json"
Authorization: Bearer my_token
{
"method": "GET",
"name": "my_file",
"expires_in": 3600
}
I'm getting an "Invalid JSON" error. I think my JSON looks exactly like the example, and even the JSON validators find it valid. Could someone provide some insight why this is happening? Thanks.
1 Reply
Ok, so I had "-s around the application/json in the Content-Type header. Removing those the request started working. Why that would generate an Invalid JSON response though is unknown to me.
So the correct request is:
POST https://api.linode.com/v4/object-storage/buckets/my_clusterId/my_bucket/object-url
Content-Type: application/json
Authorization: Bearer my_token
{
"method": "GET",
"name": "my_file",
"expires_in": 3600
}