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.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