How to use JSON connectors to pull data via 2 API calls with an Access Token
In order to make API calls to the endpoints, you must first obtain an access token using your
client_id and client_secret. These credentials are given when you create an API client inside the
shellyak application.
Once the access token has been obtained, it is used on subsequent calls to the API to verify your
access.
Authentication
Get Access Token
Request:
$ curl \
-H "Content-type: application/json" \
-d '{"grant_type": "client_credentials", "client_id": "XXXXXXXXXXXX",
"client_secret": "XXXXXXXXXXXX"}' \
https://auth.shellyak.com/oauth/token
Response:
{
"access_token": "{{ACCESS_TOKEN_VALUE}}",
"refresh_token": "{{REFRESH_TOKEN_VALUE}}",
"expires_in": 3600,
"token_type": "Bearer"
}
API Calls
Get All Locations
Request:
$ curl \
-H "Content-type: application/json" \
-H "Authorization: Bearer {{ACCESS_TOKEN_VALUE}}" \
https://app.shellyak.com/api/location
This is a two-step way to pull data. Any thoughts? Thanks!
I think I should use JSON No Code Connector twice. First, save the token, then use that to pull the actual data.
Best Answer
-
The JSON No Code OAuth connector can do this, when you create the connector account you should choose the Client Credentials flow, and Pass Client ID and Secret in Basic Authentication Header options. In the Access Token URL textbox paste in the URL that you use to get the access token.
0
Answers
-
I figured it out.
But I wonder if a JSON connector can programmatically grab an access token from a dataset and pass it into the header.
I will fiddle with the JSON No Code OAuth Connector because it might be useful.0 -
The JSON No Code OAuth connector can do this, when you create the connector account you should choose the Client Credentials flow, and Pass Client ID and Secret in Basic Authentication Header options. In the Access Token URL textbox paste in the URL that you use to get the access token.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 731 Beast Mode
- 55 App Studio
- 40 Variables
- 682 Automate
- 175 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 122 Manage
- 119 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 107 Community Announcements
- 4.8K Archive