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.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive