Hello,
I’m having an issue with API calls with OAuth2. During the very first execution of a service node and user does not have access(i.e. expired token), I’m expecting it to process the “Standard question ‘User needs to authorize or re-authorize’ identified” flow, but it does not. Instead it returns 401 and proceeds to the next node.
Is my expectation that the bot will process this standard question and send a link for me to login correct?
If Yes, why does it proceed to the next node even though it is unauthorized?
Please note that this only happens during the very first time a service node is called. If it’s called again, it will correctly send a link for me to login.
I have actually made two workarounds for this:
First - call a subdialog in which the only thing it will do is call the same service node - this time the bot will send a link for me to login.
Second is a failed workaround:
1 - GetSomething service node is called but returns 401.
2 - I have a script to check if context.GetSomething exists, if not call GetSomething again.
3 - GetSomething service node is called again but this time the debug log shows ‘Error in service execution’ with this message. I am not able to proceed here because the service node has an error which I don’t know how to catch. Also note that our APIs does not seem to respond with this error when executed in Postman, so I’m not sure if it’s Kore.ai that returns this.