0

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?

dbikash
  • 345
  • 2
  • 12

1 Answers1

0
  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.

AMT.in
  • 391
  • 1
  • 5
  • Thanks. The Add connection endpoint was successful. The List connections endpoint showed this connection. However, the Test connection returned exception with message 200 ok. When I tried to send a message, I got a 417 error "504: Connector not available". Please advise. – dbikash Jul 14 '17 at 12:45
  • I am now really confused. I used the endpoint https://apiv2.unificationengine.com/v2/connection/test but later I also another endpoint https://CONNECTOR_KEY: CONNECTOR_SECRET@CONNECTOR ENDPOINT/v2/test for testing connection. Which one should I use? If I use the second one, what are the CONNECTOR ENDPOINT, SERVICE_ACCESSSECRET, SERVICE_OAUTH_KEY and SERVICE_OAUTH _SECRET? – dbikash Jul 14 '17 at 12:51
  • Sorry to make another post: What should be the format for sending a message. I am getting a 410 No receiver specified, but I did specify a receiver (my skype user name and skype id). Also there is no example for Skype in the UE documentation – dbikash Jul 14 '17 at 13:15
  • 1. For Add Connection for Unification Engine You should use the below command for adding connection, curl -XPOST https://apiv2.unificationengine.com/v2/connection/add -u USER_ACCESS_KEY:USER_SECRET --data '{"uri":"SCHEME://ACCESS_TOKEN@skype.com","name":"$UNIQUE_CONNECTION_IDENTIFIER"} replace USER_ACCESS_KEY,USER_SECRET,$UNIQUE_CONNECTION_IDENTIFIER,ACCESS_TOKEN and SCHEME with your credentials. – AMT.in Jul 17 '17 at 05:28
  • 2. For Sending Message For sending message to your bot, you should know the ID(conversationId) between you and the Bot. You can get the $RECEIVER_ADDRESS from the webhook url, when you send a message to the bot. curl -XPOST https://apiv2.unificationengine.com/v2/connection/send -u USER_ACCESS_KEY:USER_SECRET --data "{ \"message\": { \"receivers\": [{\"address\": \"$RECEIVER_ADDRESS\" , \"Connector\": \"$UNIQUE_CONNECTION_IDENTIFIER\" }] ,\"parts\": [{\"id\": \"1\",\"contentType\": \"text/plain\", \"data\":\"$CONTENT\" ,\"size\": 100,\"type\": \"body\",\"sort\":0}]}}" -k – AMT.in Jul 17 '17 at 05:30
  • Replace USER_ACCESS_KEY,USER_SECRET,$UNIQUE_CONNECTION_IDENTIFIER,$RECEIVER_ADDRESS and $CONTENT with your credentials. – AMT.in Jul 17 '17 at 05:31