API Response not what expected
I'm making an API req in a Python method:
I'm expecting that the response should contain the information requested like ReturnPrintSummary, ReturnPrintData etc. But it doesn't. It only contains a couple of keys like KeepStatusMinutes, Status, SubmittedBy...Querying the ID just created also doesn't help, it also only contains the information in the response JSON returned by the request.
Am I understanding this right? Should the info req be in the res? Is it not working maybe with JSON only YAML?
Thanks!
...
def BartenderPrint(self, MyHost: str, MyDataBin: dict) -> str:
MyHeaders = {'Content-Type': 'application/json;charset=utf-8', 'accept': 'application/json'}
MyPayload = {
"PrintBTWAction": {
"DocumentFile": "...label.btw",
"Printer": "...",
"SaveAfterPrint": False,
"VerifyPrintJobIsComplete": True,
"ReturnPrintSummary": True,
"ReturnPrintData": True,
"NamedDataSources": {
"productName": MyDataBin.get('name'),
...
}
}
}
MyAuth = HttpNtlmAuth(username=os.getenv("USER"), password=os.getenv("PASS"))
res = requests.post('http://' + MyHost + ':5159/api/actions?MessageCount=200', auth=MyAuth, json=MyPayload, headers=MyHeaders, verify=False)
print('Full Response:', json.dumps(res.json(), indent=4))
...
0
Please sign in to leave a comment.
Comments
0 comments