No error, but no change when using “Change Dataset Properties” API

I’m running into an issue running the “Change Dataset Properties” API, however. Running the code below should update the dataset name from “DataBricks Product Dataset” to “Databricks Testing”. I get a 200 status back and the response object returns the properties object as expected, but no change takes place either in the application or in the response object. With no error and a 200 response, I’m scratching my head on why nothing updates. I wanted to see if you maybe had any ideas on this. This is the first “PUT” method API call I’ve used with DOMO.
<code>
# Change dataset properties
importrequests
importos
importjson
token=os.environ.get('domo_access_token')
dataset='cc06eb69-e6ed-4ca2-9c42-a12a725368fe'
reqObj= {
"method": "PUT",
"url": "https://packsize.domo.com/api/data/v3/datasources/"+dataset+"/properties",
"headers": {
"X-DOMO-Developer-Token": token,
"Content-Type": "application/json"
},
"body": {
"name": "Databricks Testing
}
r=requests.put(reqObj.get("url"), headers=reqObj.get("headers"), json=reqObj.get("body"))
# Format Response
res=r.content
my_json=res.decode('utf8').replace("'", '"')
print(my_json)
data=json.loads(my_json)
s=json.dumps(data, indent=2, sort_keys=True)
print('-'*50)
print(s)
</code>
Answers
-
Since you're usign Python I'd recommend utilizing the pydomo package which has examples on how to rename datasets.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Categories
- All Categories
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 305 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3K Transform
- 107 SQL DataFlows
- 648 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 774 Beast Mode
- 75 App Studio
- 43 Variables
- 733 Automate
- 186 Apps
- 471 APIs & Domo Developer
- 62 Workflows
- 14 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 403 Distribute
- 117 Domo Everywhere
- 277 Scheduled Reports
- 9 Software Integrations
- 137 Manage
- 134 Governance & Security
- 8 Domo Community Gallery
- 44 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 113 Community Announcements
- 4.8K Archive