I'm really struggling to figure out how to make this work. I can successfully get my job to fire off using the interactive API documentation, but when it comes to putting it in a python script I can't get it to work. I keep getting 400 errors. Below is my code:
import requests
import json
#URL provided by interactive API documentation with id and key removed for online question
URL = 'http://dminform:80/gallery/api/v1/workflows/<id>/jobs/?oauth_timestamp=1539784724&oauth_signature_method=HMAC-SHA1&oauth_consumer_key=<Key>&oauth_version=1.0&oauth_nonce=7Ck8g&oauth_signature=TC1bpIecwPsMPO2Ui1l5O/wEhzU='
#Response body provided by interactive API documentation
responseBody = {
"id": "<id>",
"appId": None,
"createDate": "2018-10-17T13:58:43.9759132Z",
"status": "Queued",
"disposition": "None",
"outputs": [],
"messages": [],
"priority": 0,
"workerTag": None
}
#Response header provided by interactive API documentation
responseHeaders = {
"Access-Control-Allow-Origin": "*",
"Date": "Wed, 17 Oct 2018 13:58:43 GMT",
"Access-Control-Max-Age": "1728000",
"Access-Control-Allow-Headers": "Content-Type, Accept, Authorization",
"Transfer-Encoding": "chunked",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
"Content-Type": "application/json"
}
r = requests.post(url = URL)
# r = requests.post(url = URL, headers = responseHeaders, data = json.dumps(responseBody))
# r = requests.post(url = URL, headers = responseHeaders, params = responseBody)
print(r)