Using the API [Risolto]

Pubblicazioni di 5 • visto 293 volte

Hi, I'm wondering if anyone can tell me if I'm missing a step.  I'm trying to use the API to get a list of my own collection as a start.  From the documentation, I can get a temporary token for my own key using grant_type=client_credentials.

 

I did this with PostMan software to confirm it was working:

I included my own API key in the header:

This worked since I got an OAuth token back.  I understand the token is good for about 10 minutes.

The subsequent call failed.  I used the Bearer token header and my own API key:

… and got

I guess my question is whether I'm using “client_credentials” and the resulting token correctly.  I made these requests around 6:51pm EST, that's Z-5:00 (North America).  The example python script uses some of the old deprecated methods, so maybe I'm getting confused.  Any help would be appreciated.

 

Thanks!

Da5id

Hello,

It looks like you are missing the parameter scope=view_collection when generating the OAuth token. Hopefully it will work with this parameter.

Probably I should define a dedicated error message for this insufficient authorization scope.

By the way, your OAuth token is valid for 7200 seconds (2 hours) as seen in the API response.

I also fixed and enhanced the documentation: https://en.numista.com/api/doc/index.php

Thanks Xavier, I will try it out tonight!

It worked perfectly.  Thanks for the help, Xavier!

Stato cambiato a Risolto (ZacUK, 18 Nov 2022, 20:50)

» Politica del Forum

Il fuso orario utilizzato è UTC+2:00.
L'ora attuale è 04:26.