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.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive