0
votes

I am developing a bot in Ms Teams using nodejs sdk v4, which fetches the list of all the team members using getPagedTeamMembers() and then for each member I want to get their conversation Id with the bot. I have found a way using api call to "serviceUrl/in/v3/conversations" but i don't know how to get the bearer auth-token for this api call.

1

1 Answers

1
votes

You send a POST request to the /token identity platform endpoint to acquire an access token:

POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token

Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded

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

You will get access Token in response

{
  "token_type": "Bearer",
  "expires_in": 3599,
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBP..."
}

Please take a look at Get access token