Python Script help

Following up. Is there anyone who can help me with this please?
4 Replies
shikharTS
shikharTS10mo ago
Hi Jeff you can use something like this :
import requests
import json api_url = "https://{ip}/api/rest/2.0/metadata/delete'" data = { "metadata": [ { "identifier": "$id" } ], "delete_disabled_objects": false } headers = {"Content-Type":"application/json", "Authorization": "Bearer x"} response = requests.post(api_url, data=json.dumps(data), headers=headers) response.json() There might be some issues, but those should be solvable
Jeff
JeffOP10mo ago
Thank you @shikharTS I used to write a request URL inside a python script like this using Version 1.. You think this request URL will work in DELETE api? https://{ip}/callosum/v1/tspublic/v1/metadata/delete?type=QUESTION_ANSWER_BOOK&id=["GUID here"]
shikharTS
shikharTS10mo ago
I am not sure if adding as url params would work. Can you pass it as data to the API. But if a curl of this url works. This should work in the python script as well.
Jeff
JeffOP10mo ago
Thank you @shikharTS , will try your suggested script

Did you find this page helpful?