ckan / ckan

CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.
https://ckan.org/
Other
4.43k stars 1.98k forks source link

Not able to list the api tokens #7792

Closed flaviofrancisco closed 1 year ago

flaviofrancisco commented 1 year ago

CKAN version

2.10.1-dev

Describe the bug

I am trying to fetch the API Token from a user:

curl --location 'http://localhost:4201//api/3/action/api_token_list' \ --header 'Authorization: *****' \ --data ''

Expected behavior

List of available tokens

Additional details

The token used in my Authorization is from the ckan_admin account.

But I am having the following error:

{ "help": "http://localhost:4201/api/3/action/help_show?name=api_token_list", "error": { "user": [ "Missing value" ], "__type": "Validation Error" }, "success": false }

flaviofrancisco commented 1 year ago

I was doing an wrong request. It should be:

curl --location 'http://localhost:4201//api/3/action/api_token_list?user=7bb6' \ --header 'Authorization:**' \ --data ''

The parameter: 'user' was missing.