grant_type needs further explanation and guides should always include full examples
Please further explain grant_type in this doc: what is it, where do we find it? It would also be very helpful to provide a fully complete example, including screenshots of the configured App Registration, fields needed for the POST, the sample POST, and the sample Response.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 6c30758f-e4a0-9673-b531-5447c0cfee0e
- Version Independent ID: 935b5097-6ca8-4a3d-5fca-4b4ac4c27a41
- Content: How to use REST APIs for Microsoft Purview Data Planes - Microsoft Purview
- Content Source: articles/purview/tutorial-using-rest-apis.md
- Service: purview
- Sub-service: purview-data-catalog
- GitHub Login: @nayenama
- Microsoft Alias: nayenama
@KyferEz - The value you will need to pass for the grant_type parameter is "client_credentials".
I'll work on adding a screenshot for the example here! As a team we're working on better documentation/samples for the REST API in general as well, so keep an eye out for those in the new year.
@KyferEz
Thanks for your feedback! We will investigate and update as appropriate.
@KyferEz - I am adding the following PowerShell example to the documentation to make this clearer.
$tenantID = "12a345bc-67d1-ef89-abcd-efg12345abcde"
$url = "https://login.microsoftonline.com/$tenantID/oauth2/token" $params = @{ client_id = "a1234bcd-5678-9012-abcd-abcd1234abcd"; client_secret = "abcd~a1234bcd56789012abcdabcd1234abcd"; grant_type = "client_credentials"; resource = ‘https://purview.azure.net’ }
Invoke-WebRequest $url -Method Post -Body $params -UseBasicParsing | ConvertFrom-Json
Replacing the tenantID, client_id, and client_secret values with your own information will return the expected JSON response.
I have also added some screenshots of the app registration and where you can find the client id. You should see these changes in the document later this evening, or tomorrow at the latest.
Thanks for your feedback!
#please-close