Forum Discussion
Querying Fabric's API for GraphQL in Postman
- Anonymous1 year ago
Hi clearyj3
I struggled 3 hours and finally made it. Here are my settings:
1. Create a Microsoft Entra App in Azure Portal. Follow steps in this article and modify the following settings:
Authentication:
- Add a platform, select Mobile and desktop application. It generates some Redirect URIs automatically. I choose the first one. This will be used in Postman later.
- Allow public client flows: Yes
API Permissions:
2. In Postman, create a request and set up its Authorization like below:
- Callback URL: the Redirect URI of the Microsoft Entra App in previous step
- Auth URL: https://login.microsoftonline.com/{your tenant id}/oauth2/v2.0/authorize
- Access Token URL: https://login.microsoftonline.com/{your tenant id}/oauth2/v2.0/token
- Client ID: the client id of the Microsoft Entra App in previous step
- Scope: https://api.fabric.microsoft.com/.default
Then click "Get New Access Token" to get the token. It pops up browser windows for you to log in your account. After authentication completes, it will display token value. You can copy it or click "Use the token" to use it in the request.
3. Set up the body part and sent the POST request to GraphQL API:
I forgot to mention that my GraphQL API is created with SSO authentication option and I use my UPN to query the API. My account is the admin of the workspace where the GraphQL API is located. I haven't tested other scenarios.
Hope this would be helpful.
Reference:
Create and add data to an API for GraphQL - Microsoft Fabric | Microsoft Learn
Connect applications to Fabric API for GraphQL - Microsoft Fabric | Microsoft Learn
How to send graphql query by postman? - Stack Overflow
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Hi clearyj3
I struggled 3 hours and finally made it. Here are my settings:
1. Create a Microsoft Entra App in Azure Portal. Follow steps in this article and modify the following settings:
Authentication:
- Add a platform, select Mobile and desktop application. It generates some Redirect URIs automatically. I choose the first one. This will be used in Postman later.
- Allow public client flows: Yes
API Permissions:
2. In Postman, create a request and set up its Authorization like below:
- Callback URL: the Redirect URI of the Microsoft Entra App in previous step
- Auth URL: https://login.microsoftonline.com/{your tenant id}/oauth2/v2.0/authorize
- Access Token URL: https://login.microsoftonline.com/{your tenant id}/oauth2/v2.0/token
- Client ID: the client id of the Microsoft Entra App in previous step
- Scope: https://api.fabric.microsoft.com/.default
Then click "Get New Access Token" to get the token. It pops up browser windows for you to log in your account. After authentication completes, it will display token value. You can copy it or click "Use the token" to use it in the request.
3. Set up the body part and sent the POST request to GraphQL API:
I forgot to mention that my GraphQL API is created with SSO authentication option and I use my UPN to query the API. My account is the admin of the workspace where the GraphQL API is located. I haven't tested other scenarios.
Hope this would be helpful.
Reference:
Create and add data to an API for GraphQL - Microsoft Fabric | Microsoft Learn
Connect applications to Fabric API for GraphQL - Microsoft Fabric | Microsoft Learn
How to send graphql query by postman? - Stack Overflow
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!