Forum Discussion
roxane_cz
5 years agoFrequent Visitor
Power BI REST API Authentication with Postman
Hello, CONTEXT I am trying to get the lineage data, user data through PowerBI REST API, to be able to manage the usage of the tool and of the objects (reports, datasets, dataflows, ...) basical...
- 5 years ago
I'm not sure if I can help but check this post seems similar:
Thanks,
Kasia
- 5 years ago
all good now 🙂
using the app client id and the client secret value and all is working well 🙂
kalluu91
1 year agoRegular Visitor
If you are using C#, the request to get access token would be as following:
var clientHandler = new HttpClientHandler
{
UseCookies = false,
};
var client = new HttpClient(clientHandler);
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://login.microsoftonline.com/<your_tenant_id>/oauth2/v2.0/token"),
Content = new FormUrlEncodedContent(new Dictionary<string, string>
{
{ "client_id", "<your_client_id>" },
{ "scope", "https://analysis.windows.net/powerbi/api/.default" },
{ "client_secret", "<your_client_secret>" },
{ "grant_type", "client_credentials" },
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
To get more details, see: https://kalcancode.wordpress.com/2025/02/18/powerbiclient-how-to-get-access-token/