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.1K Product Ideas
- 1.1K Ideas Exchange
- 1.2K Connect
- 969 Connectors
- 256 Workbench
- Cloud Amplifier
- 1 Federated
- 2.4K Transform
- 76 SQL DataFlows
- 500 Datasets
- 1.8K Magic ETL
- 2.7K Visualize
- 2.2K Charting
- 373 Beast Mode
- 20 Variables
- 484 Automate
- 102 Apps
- 378 APIs & Domo Developer
- 6 Workflows
- 22 Predict
- 6 Jupyter Workspaces
- 16 R & Python Tiles
- 316 Distribute
- 64 Domo Everywhere
- 252 Scheduled Reports
- 59 Manage
- 59 Governance & Security
- 1 Product Release Questions
- 5K Community Forums
- 37 Getting Started
- 23 Community Member Introductions
- 63 Community Announcements
- 4.8K Archive