GET secret REST API returns `{"errors":[]}`

Hi, I’m trying to retrieve a secret from Vault and I’m able to do that from the CLI. However, when I tried to do that through the REST API, I got the response {"errors":[]}.

Here is the command I used to retrieve the secret from CLI. This command returns the right secrets I need.

vault kv get secret/flink/twitter

Here is the command I used to retrieve the secret from the REST API.

# curl \
    --header "X-Vault-Token: ..." \
    --header "Content-Type: application/json" \
    -X GET \
    http://vault2:8200/v1/secret/data/secret/flink/twitter

This command returns {"errors":[]}.

Any suggestion how I can further debug this? Thanks.

Try changing your URL to http://vault2:8200/v1/secret/data/flink/twitter.

The secret between v1 and data is the mount. In your case here the mount is being defined twice and resulting in a path, equivalent to vault kv get secret/secret/flink/twitter, that likely doesn’t exist.

1 Like

Thank you so much! This worked!