Hi, I have been trying to get the /dataset/csv endpoint to work.
I've tried the following:
curl --location --request POST 'https://metbase-domain.example.com/api/dataset/csv' \
--header 'X-Metabase-Session: GENERATED_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{
"query": "{\"database\":1,\"type\":\"native\",\"native\":{\"query\":\"SELECT * FROM users LIMIT 10\"}}"
}'
Which returned:
"errors": {
"query": "value must be a valid JSON string."
}
and
curl --location --request POST 'https://metbase-domain.example.com/api/dataset/csv' \
--header 'X-Metabase-Session: GENERATED_TOKEN_HERE' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'query={"database":1,"type":"native","native":{"query":"SELECT * FROM users LIMIT 10"}}'
Which returned 403 "You don't have permissions to do that."
What am I missing here?