Please take the following image into consideration, as it will assist in my explanation (please note the red section):
The REST service inserts a new record into an Azure storage queue. Once in the queue, the rest of the flow happens as indicated in the diagram above. This all works perfectly, except for the following scenario.
No messages have been send to the bot for a day or two. I initiate the action in the REST API that triggers a new message in the queue. All goes well up until the direct line endpoint, where it receives an Unauthorized
exception.
Then, directly after that, I send a message from Skype, to the bot. Then for a second time I send a message through the REST API, only that this time it goes through.
I have inspected the conversation reference on both calls, they are exactly the same. So I'm not really sure why the Unauthorized
exception. Is it because some expiration on a token or cookie?