Is the botId that I receive in the webhook only bot scope or is it unique across all the bots found?
Is it permanent or can it be changed?
By botId I mean the id in recipient.id and replyToId that you fill in send message request to endpoint https://smba.trafficmanager.net/apis/v3/conversations/{{skype.idRecipient}}/activities:
{
"text": "God help us!",
"type": "message",
"from": {
"id": "{{skype.idBot}}",
"name": "bot"
},
"recipient": {
"id": "{{skype.idRecipient}}",
"name": "user"
},
"replyToId": "{{skype.idBot}}"
}
The ID you are talking about is unique only in the current channel (Skype/Facebook/Slack...) as it is the ID of ChannelAccount.
Here are some statements from documentation:
Every bot and user has an account within each channel. The account
contains an identifier (id) and other informative bot non-structural
data, like an optional name.
Also
Channel accounts have meaning only within their associated channel
So it's not excluded that id may be repeated on another channels.
And what about permanency, it depends on the channel you use as stated in documentation again:
The stability of associations between IDs, accounts, mailboxes, and
people depends on the channel
But if you want it to be "unique across all the bots found" then you can create an id by combining AppID, ChannelID and User ID.
Also here is a quite informative guide about IDs in Bot Framework which may be helpful to you
Related
In the Google Calendar api there's the ability to request that a conferencing link be created when an event is created.
My current setup is that I have an account that is creating google calendar events whenever someone schedules a meeting on my app. The problem is that when someone outside of my organization tries to join the meeting it says "ask to join" which isn't possible since nobody from my organization will be in the meeing. Are there are parameters to let me turn off the waiting room feature or at least have a list of approved emails that are allowed to enter the meeting. The request body looks like this right now:
{
"end": {
"dateTime": "2020-08-30T05:27:35.206Z"
},
"start": {
"dateTime": "2020-08-29T05:27:35.206Z"
},
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": "12345"
}
},
"summary": "Test event with meets 2",
"attendees": [
{
"email": "****#gmail.com"
}
]
}
The attendee I added still has to request to join the meeting.
This appears to be a bug!
I have taken the liberty of reporting this on Google's Issue Tracker for you, detailing the behaviour:
User from outside of G Suite domain required to ask to join a Meeting from a Calendar event they are invited to
You can hit the ☆ next to the issue number in the top left on the page which lets Google know more people are encountering this and so it is more likely to be seen to faster.
I am trying to get the bot_id value for a bot when it has no conversation history.
According to the documentation:
the bot_id fields appear in bot_message message event subtypes and in
the response of methods like conversations.history.
This makes sense and works.
But is it possible to get this bot_id value, when a bot has no conversation history?
For example, say the channel between Slackbot and my bot has no conversation history. The response of a conversations.history request to this channel is the following, which does not include the bot_id value.
{
"ok": true,
"channel": {
"id": "DC6N8Q1BK",
"created": 1534129098,
"is_im": true,
"is_org_shared": false,
"user": "USLACKBOT",
"last_read": "0000000000.000000",
"latest": null,
"unread_count": 0,
"unread_count_display": 0,
"is_open": true,
"priority": 0
}
}
Any other way to get the bot_id value?
If there is a bot user, you can get it from the normal userlist with users.list. But that will not include other apps.
Then there is the unofficial API method bots.list. That will give you a list of all bots, but its not officially supported and you will need a legacy token to use as with many undocumented methods.
How do I get the url/team name from a bot framework activity/context? Currently I can get the TeamId but can that be translated into the text string for the teams name?
For example testteam.slack.com, how can I extract the "testteam" part from bot framework messages?
As already mentioned you can call the Slack API method team.info to get the domain name for a team. However, that requires your token to have specific scopes, which you might not have.
It's therefore better to call auth.test, because it does not require any special scopes (except the bot scope for a bot token, but that is implicit). This API method will return the full URL of the Slack team along with other basic info for the provided Slack token.
Note that you need a Slack token corresponding with the team you want to get the info for. The team ID alone is not sufficient to get info about a team. (same for team.info btw). I am not familiar with the botframework, but since it works with Slack it must have a method to retrieve the current Slack token.
Example output:
{
"ok": true,
"url": "https:\/\/subarachnoid.slack.com\/",
"team": "Subarachnoid Workspace",
"user": "grace",
"team_id": "T12345678",
"user_id": "W12345678"
}
You are looking for team.info method in Slack API, that you can query with your Bot User OAuth Access Token (visible in OAuth & Permissions menu, and also available in each bot message in the ChannelData, property named ApiToken).
You can get details about this method here: https://api.slack.com/methods/team.info
In particular, have a look to domain field in the response sample:
{
"ok": true,
"team": {
"id": "Txxxxxx",
"name": "BotDemoCompany",
"domain": "botdemocompany",
"email_domain": "xxxxxxx.com",
"icon": {
"image_34": "https:\/\/a.slack-edge.com\/xxx.png",
"image_44": "https:\/\/a.slack-edge.com\/xxx.png",
"image_68": "https:\/\/a.slack-edge.com\xxx.png",
"image_88": "https:\/\/a.slack-edge.com\/xxx.png",
"image_102": "https:\/\/a.slack-edge.com\/xxx.png",
"image_132": "https:\/\/a.slack-edge.com\/xxx.png",
"image_230": "https:\/\/a.slack-edge.com\/xxx.png",
"image_default": true
}
}
}
I am trying to test my bot by sending a message to my skype account. I can't find a way how to contact myself what is the members.id id suppossed to be? I tried Skype Name but can't find any other id suitable and the docs are not very helpful.
I started a conversation:
{
"bot": {
"id": "2",
"name": "bot's name"
},
"isGroup": false,
"members": [
{
"id": "123", <----------------- WHAT SHALL BE HERE?
"name": "My Account"
}
],
"topicName": "News Alert"
}
The id for the conversation is { "id": "123" }.
I could find the bot from the Skype app but I never receive anything.
You can get the ID of user by checking the Activity.From.Id property when s/he sends a message.
Also please note that in case of Skype and Facebook user IDs are altered for each user.
So each user has different ID for each Bot, and that ID is not the Skype (or Facebook) ID, as mentioned in documentation
We want to build a BoT and want to target 3 channels Webchat, Teams and Email. For these channels can we capture the logged in user.
Don’t think we can do in Web Chat channel.
In teams -- can we capture the email id of the logged in user chatting with BoT?
in email channel -- can we capture the sender email id who has emailed to our BoT?
any sample code?
The IDs are included in the JSON sent to your bot when it receives a message (see "From"). Here is an example (from an email received by a bot):
{
"type": "message",
"id": "AAMkAD....",
"timestamp": "2017-01-09T21:18:06.113698Z",
"serviceUrl": "https://email.azurewebsites.net/",
"channelId": "email",
"from": {
"id": "**EMAIL HERE**",
"name": "**USER NAME HERE**"
},