Can anyone show me an example of calling the board api queries? I have am API user setup with a secrect key, and a query.
example. curl -X GET "http://p-p-board4/public/ARGDB/query/indexPricesNymex"
This Is what I get when pasting into CMD. {"message":"Authorization has been denied for this request."}
Hi @Mike Spagnolo,
if you are using Board public API on a recent version (Spring '22 onward) make sure you properly configured the authorization:
Are you able to provide a full example of the process and API call? I assume its something like this.
POST to https://your-subscription-hub-url/connect/authorize
(please show what the body object and headers should be)
2. Get Access Token
POST to URL: https://your-subscription-hub-url/connect/token
3. Get the Data from Endpoint
GET to URL: https://your-subscription-hub-url/endpoint/<token>
(please show what the URI should look like for adding the token)
Hi Mike,
here are the CURL command, hopefully they can help you.
POST Request to get the Access Token
curl --data "grant_type=client_credentials&scope=public-api&client_id=<your_API_client_user>&client_secret=<your_API_client_password>" http://p-p-board4/identity/connect/token
GET Request to get API Query data
curl -H "Authorization: Bearer <access_token>" http://p-p-board4/public/ARGDB/query/indexPricesNymex
As for the API Client user, please refer to this page https://www.boardmanual.com/2021/summer/administration/Subscription_Hub/1_Users/Client_API.htm
Andrea
I am unable to get the token. When I run
POST curl --data "grant_type=client_credentials&scope=public-api&client_id=<your_API_client_user>&client_secret=<your_API_client_password>" http://p-p-board4/identity/connect/token
I get an error {"error":"unauthorized_client"}. I have setup the api user in board with the name "boardpublicapiclient" and the secret key that was referenced in the documentation.
I suggest you to open a case on our support portal support.board.com so we can take a look at this in detail and keep track of the analysis.
Thanks!
Hi @Andrea Duò
According to a recent discussion with the support team, it looks like the is a mistake on the following
/identity is not needed
thanks
Hi Nicolas,
You are right the "identity" in the Access Token url is not required since your Board environment is on cloud and has a subscription hub.
Just pointing out the parameters required to obtain the authorization token for two different installations/scenarios here:
When the Board environment is in the cloud and has a subscription hub (idp)
When the Board environment is on-premises or is on cloud without a subscription hub (idp)
Thanks, Samson.
Thanks @Samson Sunny!
@Nicolas BENDONGUE, the same explanation of the difference between Board on-premise and cloud for the token URL can be found on this page
https://www.boardmanual.com/2023/summer/release-notes/board-2022-spring-release-release-notes/release-notes/main-features/rest-apis.htm