Trying to retrieve assets for deletion to free up storage but getting a Forbidden error.
As we understand, deletion of a render with a given RENDER ID from the Shotstack CDN involves retrieving all the IDs of all the assets stored for the render in the CDN, therefore we tried retrieving the asset IDs for the known render IDs using Shotscack API programmatically, however, we get 403 Forbidden response from the Shotstack API on all our requests.
[403] Client error: GET https://api.shotstack.io/serve/v1/assets/render/b****5-40d0-47e3-9**d-6*******7 resulted in a 403 Forbidden response: {“message”:“Forbidden”}
Perhaps, Shotstack API denies all our calls for the same reason - no more storage available in their CDN?
First off, are you using your API key in the x-api-key header? Like all other calls, you need to provide the API key. Also make sure you are using the correct for the correct stage. It looks like you are calling v1, so use your v1/production/prod key.
Next, you need to get the asset ID by looking up all the assets created for a known render ID. It sounds like this is where you are stuck.
As you can see from our previous message, we have been trying to retrieve ID’s of all the assets related to our render b701a9e5-40d0-47e3-9e8c-68f95df540a7:
However, we got the {“message”:“Forbidden”} response, and therefore we are unable to retrieve the asset id (or asset ids, if there are multiple) by the render id from ShotStack API.
You suggest that we send a DELETE HTTP request. Sure we tried that, but when we send a DELETE HTTP request we get another {“message”:“Forbidden”} response:
Again, we have the render id and it is b701a9e5-40d0-47e3-9e8c-68f95df540a7, but we do not have the asset id (or ids) and the API responds with {“message”:“Forbidden”} when we are trying to retrieve them
If you want to delete all files in your account we can do that for you. Send us a message here with your API Key ids (not the keys) and we can do that for you: Talk to Sales | Shotstack