I'm using botbuilder package in a nodejs application and I need to get the user information from the Skype for Business channel, so that I can authorize against my custom authentication system - the username would work too.
Using session storage or anything like this doesn't work for my use case, so I need the actual user information.
How can I get this information?
In Skype for Business channel, you will found the user email in the id field of the user.
In Node.js: session.message.address.user.id field
In C#: activity.From.Id field
It has the following format: sip:mymail#mydomain.com
Related
I am trying to create a website that checks if the current logged-in user is subscribed to a specific youtube channel. This is meant to restrict the user if they haven't yet. Is something like this even possible?
You would need the user to login via google identity services to be able to access data like that via the api. The api gives you access to the channels the user is subscribed to if the user allows this
I am trying to send a notification to a specific user using FCM, but I haven't found a way. I have a mobile app and a node server running.
I want to be able to send a notification when the shipment status changes. I have already a function for it in my server I just have to send the notification to the user. Is it possible to achieve this using nodejs or is there a way to implement it in flutter?
I found this code
var FCM = require('fcm-node')
var serverKey = require('path/to/privatekey.json') //put the generated private key path here
var fcm = new FCM(serverKey)
var message = { //this may vary according to the message type (single recipient, multicast, topic, et cetera)
to: 'registration_token',
collapse_key: 'your_collapse_key',
notification: {
title: 'Title of your push notification',
body: 'Body of your push notification'
},
data: { //you can send only notification or only data(or include both)
my_key: 'my value',
my_another_key: 'my another value'
}
}
fcm.send(message, function(err, response){
if (err) {
console.log("Something has gone wrong!")
} else {
console.log("Successfully sent with response: ", response)
this is a npm package taht lets send a notification but it asks for a registration token.
I hope you can help me. Thanks in advance!
Firebase Cloud Messaging has no concept of a user. Instead it can send messages to:
Specific app instances (so your specific app as installed on one specific device), as identified by an FCM/device token.
A group of app instances/tokens, as defined by your application logic.
A specific topic, to which app instances can then subscribe.
It's up to your application logic to decide how to map from your user ID to one of these options. The most common are to:
Store the device token(s) and your user ID in your own database, then look up the device token(s) for a user when needed and fill them in to the API call you already have.
Use a specific topic for each user ID, subscribe the application to that when it starts, and then send a message to that topic when needed. Note that anyone can subscribe to any topic though, so this approach would allow folks to receive message for anyone whose user ID they know.
I'm making a slack bot (A) that responses to a message from another slack bot (incoming-webhook) (B).
I'd like to know the user_id of B so that its message will be a trigger for A, where I have some problem getting it.
I tried users.list method (https://slack.com/api/users.list?token=blabla) but the B didn't appear in a result.
Do you have an idea about what method to take to know the user_id of B?
Incoming webhooks appear as apps, not as bot users on Slack. So you won't find a bot user ID in the user list as you would for normal bot users.
Apps have a bot ID, but unfortunately there is no official API method to get the list of bots / apps in a workspace. But if you have control over a workspace and can generate a legacy token you can use the unofficial API method bots.list.
There also is the official bots.info method, if you already have the bot ID and just want to know which app it belongs to.
To create a legacy token for your workspace make sure you are logged in and then go to this page.
I am using Microsoft Bot Framework. How to get user name of user when they are chatting with Microsoft Bot on Microsoft Teams.I am using bot builder and node.js
You can probably get the name of the person using:
session.message.address.user.name
Though you may have to check that, as different channel exposes different kind of data to the framework. Also you can have a look in the channelData field as well. It contains data specific to the channel. You can find channel data using:
session.message.source
I am trying to implement a Bot which can get all the Direct Message Channels, all the workspace Users and send Direct Messages to them.
If I work with my development workspace everything works as expected but when I try with my company workspace, my Bot is only capable to retrieve the Direct Message Channel it is belonging to.
Any idea on how to fix by production Bot.
You can't. Due to the security architecture of Slack one can only see the messages of channels he is part of. Its the same even for the "super admin" of a Slack team (the primary owner). Bots and apps inherit that right from the user who installed it (= authed the access token).
The reason it works on your development Slack, is that your user has probably created all private channels on Slack, and/or is the same that authed the access token your app uses.
Thanks to Slack support I got my answer:
The OAuth Token issued is specific to the user who has installed your app and represents the permission(s) to perform actions on behalf of the user. More detailed information here - https://api.slack.com/docs/oauth.
The token can only perform the same actions as the user who installed the app i.e If the user can’t view or post in the channel, they can’t grant permission to something they do not have.