Hello Tommy Le,
The graph query is correct but 400 bad request usually happens in case of authorization failures because of insufficient permissions. Since you mentioned you are using app registration, try the following,
- Create a fresh app registration in Entra
- Provide delegated and application permissions required for the kind of actions you want to do. For example, the graph call you are working on requires the following permissions, DeviceManagementApps.Read.All
- Under Authentication – Platform configurations – Add a platform, select Mobile and desktop applications.
- Select the default URIs and add the below URI
urn:ietf:wg:oauth:2.0:oob
- In total there would be 4, as per the screenshot below and save the settings.
Now use this app ID and secret to make the graph call. Hope that helps.
If you found the information above helpful, please Click Yes. This will assist others in the community who encounter a similar issue, enabling them to quickly find the solution and benefit from the guidance provided.