REST/URL API Query - where to enter?
Hi,
I have a JSON API query for our database which is working in Klipfolio and in Postman but I can't work out where to enter the address, headers and body to create a new Domo datasource. I've had a look at workbench and at developer.domo.com and keep getting stuck. I assume this must be a fairly simple thing to do though?
We have a custom connector but its only pulling 20 of the 200+ rows for some of the API calls.
Thanks,
Josh
This is a sample of the raw working api call from postman:
POST /api/v1/xxx
Host: xxx
Authorization: Bearer xxx
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
Postman-Token: xxx
{
"VendorId":80,
"TimeFrame": "AddMonths(-3)",
"Language": "en-US",
"MetricValue": "launches",
"BreakdownValue": "3",
"StatusValue": "All",
"RunByValue": "RunByAll",
"CountryFilters": [],
"GridVendorCampaignFilters": [],
"GridVendorCampaignPlayLanguageFilters": [],
"SourceFilters": null,
"PartnerFilters": []
}
Best Answer
-
Hi, I solved this through a workaround...
I created a python script to call the API multiple times and turn the results into .csv's saved on my local HDD. I then used task scheduler to run the .py script daily and used Domo Workbench to import the data daily into Domo. It's been working fine so far although it was a bit of a hassle to setup. Here are the basics of the .py script:
#API Query
payload = {
parameters go here
}
#API URL
url = "https://url goes here"
#API Authorization key
headers = {headers go here}#Calling the API parsing the json and finally saving as .csv
jsonname = requests.post(url, data=json.dumps(payload), headers=headers)
dfname = pd.read_json(jsonname.content)dfname.to_csv('C:/file location here',index=False,encoding='utf-8')
0
Answers
-
Could someone help out with this?
0 -
Bump,
I have tried escalating this question via the Domo sales reps and have not gotten any response, so I'd really appreciate if anyone can lend a hand.
As I understand it you can make an API call through the JSON advanced connector, but no matter the format of these requests it inevitably fails.
Thanks,
Josh
0 -
Is there any solution to this, I'm also failing to use the JSON over REST connector
0 -
Hi, I solved this through a workaround...
I created a python script to call the API multiple times and turn the results into .csv's saved on my local HDD. I then used task scheduler to run the .py script daily and used Domo Workbench to import the data daily into Domo. It's been working fine so far although it was a bit of a hassle to setup. Here are the basics of the .py script:
#API Query
payload = {
parameters go here
}
#API URL
url = "https://url goes here"
#API Authorization key
headers = {headers go here}#Calling the API parsing the json and finally saving as .csv
jsonname = requests.post(url, data=json.dumps(payload), headers=headers)
dfname = pd.read_json(jsonname.content)dfname.to_csv('C:/file location here',index=False,encoding='utf-8')
0 -
Thanks for your tenacity and persistence on this one. I will bring your solution to the Education team to see if we can make this an official article.
Regards,
0
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 294 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 97 SQL DataFlows
- 607 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.4K Charting
- 707 Beast Mode
- 49 App Studio
- 39 Variables
- 667 Automate
- 170 Apps
- 446 APIs & Domo Developer
- 44 Workflows
- 7 DomoAI
- 33 Predict
- 13 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 115 Manage
- 112 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 103 Community Announcements
- 4.8K Archive