In comm script can I use auth=paramsDict instead of auth=self.auth

45 views
Skip to first unread message

David Friday

unread,
Jun 5, 2021, 6:04:45 PM6/5/21
to Bots Open Source EDI Translator
I'm currently trying to post orders but url requires a Bearer token and I've tried many different ways but I keep getting the error 
r = auth(self)
TypeError: 'dict' object is not callable 

In debug below the response is 401 so its not currently accepting what I'm sending when trying 
DEBUG:urllib3.connectionpool:https://www.nextra.net:443 "POST /api/Order/SubmitOrders HTTP/1.1" 401 61

Is there a way that I can add  auth=paramsDict instead of auth=self.auth or any ideas is appreciated.

Thanks,

David

David Friday

unread,
Jun 5, 2021, 6:57:34 PM6/5/21
to Bots Open Source EDI Translator
Disregard now working:

    access_token = 'Bearer ' + token
#    print access_token
    if os.path.exists(filename):
paramsDict = {
'uri': '/api/v2/Order/SubmitOrders',
'mode': 'https',
'type': 'body',
'header': {
'authorization': 'Bearer ' + token, 'Content-Type': 'application/json'
},
}
 

Henk-Jan Ebbers

unread,
Jun 6, 2021, 9:34:55 AM6/6/21
to bots...@googlegroups.com
cool!

kind regards,
Henk-Jan Ebbers
www.ebbersconsult.com
t: +31 6 14612879

Bots Open Source EDI Translator: http://bots.sourceforge.net
Connect edi-partners at lower costs by smarter testing: www.edi-testrobot.com


--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/botsmail/bce97c8f-dbaf-416f-8214-3f24092f8864n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages