Graph API Beta: How to get "teamworkPeripheral" resource referenced by "teamworkPeripheralHealth" resource?

Alexey Trusov 10 Reputation points
2023-11-26T10:26:58.0066667+00:00

If I get teamworkDeviceHealth resource by teamwork device ID then it has field "peripheralsHealth" that contains a teamworkPeripheralsHealth resource that is a container for several teamworkPeripheralHealth resources. Each teamworkPeripheralHealth resource has a reference to the teamworkPeripheral resource and has a field "peripheral" for that reference. It's all described on the Graph API Beta reference pages: https://learn.microsoft.com/en-us/graph/api/resources/teamworkdevicehealth?view=graph-rest-beta

But I don't see any way to get teamworkPeripheral resource referenced by teamworkPeripheralHealth. If I get teamworkDeviceHealth resource then I get nested teamworkPeripheralHealth resources without teamworkPeripheral resources provided. Suppose it needs $expand option used somehow like:

GET /teamwork/devices/{teamworkDeviceId}/health?$select=peripheralsHealth($select=microphoneHealth($expand=peripheral))

But it doesn't work because teamworkPeripheralsHealth resource doesn't support $select option.

Is there any way to get teamworkPeripheral resource referenced by teamworkPeripheralHealth resource?

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alexey Trusov 10 Reputation points
    2023-11-26T11:05:47.7866667+00:00

    Looks like I found what I do wrong.

    GET /teamwork/devices/{teamworkDeviceId}/health?$expand=peripheralsHealth/microphoneHealth/peripheral
    

    works fine.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.