Trying to set expiration for a key using API via curl, but no luck, the key gets created but it does not get deleted after the expiration… anyone care to enlighten me with the right working code…
the current curl that I tried is below…
curl --request PUT
–url https://api.cloudflare.com/client/v4/accounts/{accountid}/storage/kv/namespaces/{namespaceid}/values/hello
–header ‘Content-Type: multipart/form-data’
–header ‘Authorization: Bearer ’
–form metadata=‘{“expiration_ttl” : 120}’
–form value=‘world’
–form expiration_ttl=120
This is the output but the key does not get deleted after 2 minutes
{
“result”: null,
“success”: true,
“errors”: ,
“messages”:
}