How to get DeviceId for new enrolled Android devices inside EMM through Android Management APIs without pubsub? - android-management-api

Want deviceId for enrolled devices through AMA API. Enrolling group of devices through same token id. How do we get deviceId's?

You can use the enterprises.devices.list to get the list of devices for a given enterprise. It returns a JSON of device resources that contains the deviceID.
The deviceID can be found in the name field of the device resource.
E.g. name: enterprises/{enterpriseId}/devices/{deviceId}
Sample JSON response:
{
"name": "enterprises/LCqwe1231/devices/123qwe1231",
"managementMode": "DEVICE_OWNER",
"state": "ACTIVE",
"appliedState": "ACTIVE",
"policyCompliant": true,
}
Note: The previous DeviceIDs enrolled are still in the enterprise. If you get a list of DeviceIDs, get the ID that is in the uppermost part of the list. If you want to delete previous devices, you can use enterprises.devices.delete.

Related

Add bot (ms-botbuilder) to the MS Teams Team/Channel programmatically

I'm looking to find a way to add a bot to a team that this bot just created.
Was able to create a group via MS Graph by the bot
JS-SDK
graphClient.api("/groups").post({
displayName: "Some Name",
mailNickname: "Name without Spaces",
description: "Some Description",
visibility: "Private",
groupTypes: ["Unified"],
mailEnabled: true,
securityEnabled: false,
"members#odata.bind": members, // array of url strings of members
"owners#odata.bind": owners,
});
members and owners arrays of strings representing users:
https://graph.microsoft.com/v1.0/users/{user-id}. Found them via /users search
then added a team to this group
(source: https://learn.microsoft.com/en-us/graph/api/team-put-teams?view=graph-rest-beta&tabs=javascript) like that:
graphClient.api(`/groups/${group-id}/team`).put({});
and channel - graphClient.api(`/teams/${group-id}/channels`).post(channel);
Couldn't find a way to add the bot to the team or channel that was just created.
Maybe there is a way to locate it guid or some kind of app-id and add it to the group?
So remember that a Bot is not a regular user, it's an App. As a result, to add it to a Team, you would use the Add app to team operation against the Graph. To do so, you need to use the app Id from List the published apps from the Microsoft Teams app catalog.
Once you do this, your bot is part of the entire Team, and can be accessed from any Channel. As a result, you don't need to also add your bot to a Channel per se after installing it to the Team (you can see this because the only way to remove the bot from a "channel" is by removing it from the App tab for the entire Team). It's kind of like a user in this regard - adding the user to the Team gives them access to all channels. However, if your app includes a tab as well, the tab can be added automatically to an individual channel - see add tab to channel.

Persistent Skype user ID across individual and group chat.

When a bot chat with a user individually or in a group, the API returns different user ids. How can I know it's the same person?
Skype user's information fields looks like the following "from": { "id": "29:1DwlGVzj.....", "name": "My Skype Name" } (and bot's id is "28:appId").
This user id is a specific to your bot, it is a hash but the way it is generated is not known (not open-source). But this id is identidical for a unique user when talking individually with the bot or inside a group conversation with the same bot.
See sample here, I just checked:
Direct message between user and bot:
Group conversation including same user and same bot:
I've hidden some characters of the id in case of... but I confirm they are exactly the same values.
See also questions around the same problems:
For more details about the different channels and the ID format: Authenticate user across channels in Microsoft bot Framework
Get Skype ID from Activity object Bot Framework V3
Getting Skype Identity In Bot Framework?

How can I start a conversation with user data like user name, user domain ID

I need to develop enhancements to an existing app which will interact with a bot developed using MS bot framework. For this, I am thinking of utilising the Direct Channel. However, I dont understand, how I can pass on user specific information from the app to the bot.
In documentation available at https://learn.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-direct-line-3-0-send-activity,
It is mentioned that the payload of the REST request would be
{
"type": "message",
"from": {
"id": "user1"
},
"text": "hello"
}
Where should I pass on the user specific or sessions information like user first name, last name, email id or Login id or initiating app or location from where the user is initiating the chat or anything else here ?
Any guidance will help.
How can I start a conversation with user data like user name, user domain ID
As NicolasR pointed, it does not enable us to attach/specify user information when starting a conversation on Direct Line Channel.
how I can pass on user specific information from the app to the bot
If you’d like to send activity and pass user information (firstname, lastname etc) to your bot by using the Direct Line API, as you see in that documentation, to send an activity to the bot, the client must create an Activity object to define the activity. You can refer to the following example request to contains the user information in from field of your request JSON payload.
In my bot app code (c#), I can extract user information from Activity object using the following code snippet.
if (activity.From.Properties["firstname"] != null)
{
var fname = activity.From.Properties["firstname"].ToString();
}

Is it possible to get Information about Chromecast device from receiver app

I am developing an app for Chromecast and I need something specific about that particular device. (MAC Address, ID, something like that) in order to generate an unique deviceID.
I need to access the information from the receiver app.
If it's not possible, how can I generate the same unique deviceID at startup?
There is no API on the receiver to return the MAC address or any other unique identifier; you need to create and manage that yourself.

List of Devices Registered on GCM

I am using Google Cloud Messaging APIs.
On the server side i want to get the list of all the devices that are registered on a Project ID that is given by Google Cloud Messaging .So could i get the all list of the devices so that i can store all of them into the database.Please provide me the suggestion on this how can we do this.Thanks
You must be registering a device on client side by getting the registration ID. So, as soon the user's device gets a registration ID, send the ID to your own server. At your server, you can store all the registration ID's this way. You'll have the list of all the devices that are registered to your SENDER ID.

Resources