How to get "display name" and "device name" for Teams Device with Graph API/via api

Vivian Escalante 21 Reputation points
2024-06-12T07:08:26.2+00:00

Hello, I'm trying to get a device's display name and device name, but the endpoint I'm using doesn't seem to include these fields: https://learn.microsoft.com/en-us/graph/api/teamworkdevice-list?view=graph-rest-beta&tabs=http

Does anyone know how I can retrieve these field values? Thanks.Screenshot 2024-06-12 at 12.04.10 AM

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,603 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,404 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,059 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dinesh Rajagoni (Tata Consultancy Services Limi) 50 Reputation points Microsoft Vendor
    2024-06-13T11:52:09.1133333+00:00

    Hi Vivian Escalante - Thanks for raising the query. To retrieve a device's display name and device name using the Microsoft Graph API, follow these steps:

    1. API Endpoint: Use GET /teamwork/devices/{id}. See the Microsoft Graph API documentation for details.
    2. Permissions: Ensure your app has the TeamworkDevice.Read.All permission. Refer to the Microsoft Graph permissions reference.
    3. Request Headers: Include the authorization header: Authorization: Bearer {token}.
    4. Sample Request: Use cURL to make the request:
         curl -H "Authorization: Bearer {token}" -X GET
         https://graph.microsoft.com/v1.0/teamwork/devices/{id}
      
    5. Response: A successful response will return a 200 OK status with a teamworkDevice object containing the display name and device name.
    6. Microsoft Teams JavaScript Client Library: If building an app for Microsoft Teams, use the Microsoft Teams JavaScript client library to request permissions for device capabilities and update your app manifest accordingly.
    7. Additional Information: Note that APIs under the /beta version are subject to change. Check for availability in the v1.0 version.

    Following these steps will help you retrieve the display name and device name of a Microsoft Teams-enabled device.

    0 comments No comments