TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Invalid Json API Error – client.cer not included

Forums › TWAIN Direct › Invalid Json API Error – client.cer not included

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • September 17, 2020 at 10:32 am #52522 Reply
    htanmsa
    • Topics - 93
    • Replies - 183
    • Total Posts - 276

    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)

    https://ibb.co/qFChqhs

    Capture

  • Author
    Posts
Viewing 1 post (of 1 total)
Reply To: Invalid Json API Error – client.cer not included
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.