4
votes

I want to create a skype bot and am referring to https://developer.microsoft.com/en-us/skype/bots/docs/api/chat , for authorization the doc refers to https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-protocols-oauth-code/ but it is unclear about the scope to be mentioned for using skype bot apis.

So can anybody tell me how to obtain authorization token for making skype bot rest api calls.

2

2 Answers

7
votes

try this

curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'client_id=<your-app-id>&client_secret=<your-app-secret>&grant_type=client_credentials&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default' 'https://login.microsoftonline.com/common/oauth2/v2.0/token'
0
votes

I'm trying to try token access to the skype bot. I have also tried the above mentioned cURL function in "POSTMAN" but I have this return message:

{
    "error": "invalid_request",
    "error_description": "AADSTS90014: The request body must contain the following parameter: 'grant_type'.\r\nTrace ID: 53dcaec0-...\r\nCorrelation ID: d6d650ec...\r\nTimestamp: 2018-01-15 09:53:04Z",
    "error_codes": [
        90014
    ],
    "timestamp": "2018-01-15 09:53:04Z",
    "trace_id": "53dcaec0-...",
    "correlation_id": "d6d650ec-..."
}

The following is a header and body structure in POSTMAN:

HEADER Content_type: application/x-www-url-form-urlencoded Cache-Control: no-cache

BODY client_id=&client_secret=&grant_type=client_credentials&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default

In BODY I replace the fields client_id and client_secret with the correct codes provided during registration. Thanks to the availability...