unificationengine

How to add a Skype connection using Unification Engine?


I am writing a bot that can receive messages from multiple chat platforms, and hence trying out UE using Skype first. But I am not able to proceed very far.

What I did till now:

a. Created a Skype Bot and got an App Id and password.

b. Created an UE App and got UE App Id, App Key and App Secret.

c. Added a Skype connector to my UE App.

d. Created a user using the user/create endpoint.

Now I want to connect the UE App with Skype.

Questions:

  1. When creating my Skype connector, what should I use for App Key, App Secret? Should I use the Skype Bot App Id for App Key, and Skype Bot password as App Secret?

  2. What exactly should be the body of the connection/add endpoint?

    • What should be the uri?

      From the documentation it seems it should be something like:

      "uri":"skype://access_token@skype.com?id=BotId","name":"skype"

    • Is this understanding correct? What should I put as the access_token?


Solution

    1. Yes, you can use your Skype Bot App Id as App Key, and Skype Bot password as App Secret.

    2. To communicate with the Bot Connector service, you must specify an access token in the Authorization header of each API request. You can obtain the access token for your bot by issuing an API request. To request an access token that can be used to authenticate requests to the Bot service, issue the following request, replacing MICROSOFT-APP-ID and MICROSOFT-APP-PASSWORD with the App ID and password that you obtained when you registered your bot with the Bot Framework.

      POST https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token Host: login.microsoftonline.com Content-Type: application/x-www-form-urlencoded

      grant_type=client_credentials&client_id=MICROSOFT-APP-ID&client_secret=MICROSOFT-APP-PASSWORD&scope=https%3A%2F%2Fapi.botframework.com%2F.default

      If the request succeeds, you will receive an HTTP 200 response that specifies the access token and information about its expiration.

      Normally the access token expires within 1 hr. When your access token expires, you can call the refresh route to get the new access token.