Hi there,
I’m trying to send a basic render-job via python to the webservice, but I’m getting a 500 error:
Web Service - Error: Unexpected character encountered while parsing number: N. Path '', line 1, position 1. (Newtonsoft.Json.JsonReaderException)
Here is my code:
import requests
import json
url = 'http://10.29.144.112:8082/api/jobs'
myDictObj = {"1Name": "Untitled",
"Jobinfo":{
'UserName':'goetzmoritz',
'Region':'',
'Frames':'0',
'Group':'gpu',
'Pool':'gpu',
'Blacklist':'',
'PostJobScript':'/mnt/deadline/scripts/myscripts/report.py',
'ScheduledStartDateTime':'07/05/2020 15:52',
'OverrideTaskExtraInfoNames':'False',
'MachineName':'MBP',
'Plugin':'Redshift',
'OutputDirectory0':'/Users/test/Downloads/out.exr',
'EventOptIns':''
},
'PluginInfo':{
'Version':'1',
'SceneFile':'/home/test/temp/temp.rs',
'RenderOptionsFile':'',
'GPUsPerTask':'0',
'SelectGPUDevices':'',
'TextureCacheBudget':'0',
'ImageOutputDirectory':'/home/test/temp/out.exr',
'OverrideResolution':'false',
'Width':'800',
'Height':'600'
},
'AuxFiles':{
},
'IdOnly': False
}
serialized= json.dumps(myDictObj, sort_keys=False, indent=0)
print(serialized)
json_data=json.loads(serialized)
Headers = {'Content-type': 'application/json'}
r = requests.post(url, data=json_data, headers=Headers)
print(r)
Any help on that issue and how to submit a very basic job like that would be great.
Thanks!