Home › Forums › TWAIN Direct › Invalid Json API Error – client.cer not included
- This topic is empty.
- AuthorPosts
- htanmsa
I am trying to call Twain direct API using python to see how it performs but I am not sure where the fault lies. Anyone any help please ?
I did have windows .cer installed in my PC(root and hope that we dont need to include .cer in API call for https communication Local) in calling the API on Twain Bridge installed PC.called info command
‘{“version”:”1.0″,”name”:”TWAIN2 FreeImage Software Scanner”,”description”:”twain_test”,”url”:”https://twain.hazybits.com/api”,”type”:”twaindirect”,”id”:”ebfbf2ac-deec-4d58-b408-b8f691ce7567″,”device_state”:”idle”,”connection_state”:”offline”,”manufacturer”:”TWAIN Working Group”,”model”:”TWAIN2 FreeImage Software Scanner”,”serial_number”:”X”,”firmware”:”2.1:2.2″,”uptime”:”4280″,”setup_url”:””,”support_url”:””,”update_url”:””,”x-privet-token”:”mHqkkMdlaYobPrvoGtpLqm8/wso=:637350323496385812″,”api”:[“/privet/twaindirect/session”],”semantic_state”:””}’
{“kind”:”twainlocalscanner”,”commandId”:””,”method”:””,”results”:{“success”:false,”code”:”invalidJson”,”characterOffset”:0}}then used it on session create the token but gettting invalid json error
url=’https://laptop-81umpbdj.local:34034/privet/twaindirect/session’
dat={
“kind”: “twainlocalscanner”,
“commandId”: “0ac07a52-3127-4876-bebe-6ecd2351f641”,
“method”: “createSession”
}headers={
“Content-Type”:”application/json; charset=UTF-8″,
“Content-Length”: “2048”,
“X-Privet-Token”: “mHqkkMdlaYobPrvoGtpLqm8/wso=:637350323496385812”
}x = requests.post(url, headers = headers, data=dat, verify = False)
print(x.text)
- AuthorPosts