Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Partha_Kar
New Member

Getting 401-Unauthorized response while trying to Refresh Power BI Dataset using Postman API call!

Hello Experts,

 

I need an urgent help on one of the issues I am facing while trying to refresh the Power BI Dataset using POSTMAN.

Issue description -

1. Getting the Bearer Token -
This part is successful using the client id, tenant id, group id, dataset id and client secret I have been provided by the Admin team.
To generate the token I have used this URL : POST https://login.microsoftonline.com/{tenentId}/oauth2/token
Headers: Content-Type: application/x-www-form-urlencoded
Body:
client_id={clientId}
&client_secret={clientSecret}
&scope=https://analysis.windows.net/powerbi/api/.default
&grant_type=client_credentials

-> I am getting the token with no issues.

 

2. Refreshing the Dataset -
This part is giving me headaches!
Method: POST
url: https://api.powerbi.com/v1.0/myorg/datasets/{dataset-id}/refreshes
Headers Authorization: Bearer {token}
Body:
{
"type": "full",
"commitMode": "transactional",
"objects": [
{
"table": "TEST PO and Requisition"
}
],
"applyRefreshPolicy": "true"
}

But after applying all these, I am only getting - 401 Unauthorized!

Please help me in this or guide me if there is any workaround for achieving this refresh from a third party client.

 

Thanks in advance!

Regards,
PK

3 REPLIES 3
R1k91
Super User
Super User

  1. open app.powerbi.com
  2. navigate to the workspace containing the dataset to refresh
  3. press "access"
  4. check if service princal has access

 

 


--
Riccardo Perico
BI Architect @ Lucient Italia | Microsoft MVP

Blog | GitHub

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
R1k91
Super User
Super User

has your service principal access to the pbi workspace?


--
Riccardo Perico
BI Architect @ Lucient Italia | Microsoft MVP

Blog | GitHub

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @R1k91 , 
Sorry for the late response.

I am quite new to Power BI.. so, it would be really helpful if you could share with me How & Where to check whether - the Service Princiapl has access to access OCI object Storage?

 

Regards,

Partha

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.