I found right way:
1 step - take information from bot's index.js about the participants in the conversation with the bot and save it to yourself - this can be done by sending a request from the bot to your script
const axios = require('axios');
axios.get('
https://My_server/My_script.php', {
params: {
'context': context
}
})
.then(function (response) {
console.log(response);
})
2 step - get Bearer token via request
https://login.microsoftonline.com/common/oauth2/v2.0/tokenUse Application ID and secret key in parameters
Note - token's life is 1 day, will get new if need
3 step - with token to create new conversation with user send request
https://smba.trafficmanager.net/emea/v3/conversationsWARNING - look at the exact url in the data that you received from the bot in step 1 - it may differ!
with body (all parameters you should save in yours base in step 1) :
{
"bot": {
"id": "BotID",
"name": "NameBot"
},
"isGroup": false,
"members": [
{
"id": "UserID",
"name": "User Name"
}
],
"tenantId":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"topicName": "News Alert"
}
In answer you must get ID of new conversation - save it too
And finally - step 4 - send message to user with request
https://smba.trafficmanager.net/amer/v3/conversations/[CONFERSATION_ID]/activitiesWARNING - look at the exact url in the data that you received from the bot in step 1 - it may differ!
and body like this or others variants of fields (don't forget use token which you got in step 2)
{
"type": "message",
"channelId": "msteams",
"conversation": {"id": "CONVERSATION_ID"},
"from":{"id": "BotID","name": "NameBot"},
"recipient":{"id": "UserID",
"name": "UserName"
},
"text": "Hi userName! Welcome from API.",
"channelData": {
"notification": {
"alert": true
}
},
"textFormat":"plain"}
I hope this helps someone lose a little less time than it does me
🙂 .
@Chetana-MSFT , thank you for yours attention.