Building Applications and Solutions with Microsoft 365 Core Services (legacy) — Question 9
You are developing an application that will track changes to the UserPrincipalName attribute of Microsoft 365 accounts.
You need to use a REST request to retrieve the information by using Microsoft Graph. The solution must minimize the amount of data retrieved.
What should you do?
Answer options
- A. Use GET https://graph.microsoft.com/v1.0/users/delta for the first call. Use the state token in subsequent calls.
- B. Use GET https://graph.microsoft.com/v1.0/users/delta?$select=UserPrincipalName for the first call. Use the state token in subsequent calls.
- C. Use GET https://graph.microsoft.com/v1.0/users$select=UserPrincipalName for the calls and track the changes.
- D. Use GET https://graph.microsoft.com/v1.0/users for the calls and track the changes.
Correct answer: B
Explanation
The correct answer is B because using the $select query parameter allows you to specify that only the UserPrincipalName attribute should be returned, thus minimizing data retrieval. Option A retrieves all attributes, while options C and D do not utilize the delta function correctly and also do not limit the fields returned.