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.
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.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 292 Workbench
- 4 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 95 SQL DataFlows
- 602 Datasets
- 2.1K Magic ETL
- 3.7K Visualize
- 2.4K Charting
- 695 Beast Mode
- 43 App Studio
- 39 Variables
- 658 Automate
- 170 Apps
- 441 APIs & Domo Developer
- 42 Workflows
- 5 DomoAI
- 32 Predict
- 12 Jupyter Workspaces
- 20 R & Python Tiles
- 386 Distribute
- 111 Domo Everywhere
- 269 Scheduled Reports
- 6 Software Integrations
- 113 Manage
- 110 Governance & Security
- 8 Domo University
- 30 Product Releases
- Community Forums
- 39 Getting Started
- 29 Community Member Introductions
- 98 Community Announcements
- Domo Community Gallery
- 4.8K Archive