[Power BI + LinkedIn API] Error integrating Community Management API with Power BI
Hello, I am developing an integration between the LinkedIn Community Management API and Power BI to automate the extraction of post and engagement data from a LinkedIn page.
Context
- My app has been approved, and I have access to the Community Management API (Standard Tier).
- I have already generated the Access Token using OAuth 2.0 with the necessary permissions.
- Use Case: Internal analytics dashboard to track Company Page metrics (engagement, followers, post performance) and analyze them in Power BI.
What I have done so far
In Power BI, I tried to connect via "Get Data" > "Web" (Advanced Mode).
I set up the API endpoint, for example:
:li:anization:{anizationId}?edgeType=CompanyFollowedByMember
In the HTTP headers, I tried adding the Access Token as follows:
Authorization: Bearer {MY_ACCESS_TOKEN} Accept: application/json
However, Power BI does not allow adding the
Authorization
header through the UI, returning this error:Expression.Error: The 'Authorization' header is only supported when using anonymous authentication.
In the Power Query Advanced Editor, I attempted to add the token manually:
let Token = "Bearer YOUR_ACCESS_TOKEN_HERE", Source = Json.Document(Web.Contents("/...", [ Headers = [ #"Authorization" = Token, #"Accept" = "application/json" ] ] )) in Source
However, when trying to authenticate, I receive an error stating that authentication with the provided credentials failed.
7.Tried requests via Postman and direct cURL
Successful authorization via browser:
text
;client_id=myid&redirect_uri=;scope=r_anization_social&state=123456
→ Returns valid code parameter (e.g., AQQgbFgrP4q57eC2...)
Failed token exchange:
http
POST
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&code=[code]
&redirect_uri=
&client_id=myid
&client_secret=[current_secret]
→ Consistently returns:
json
Copy
{
"error": "invalid_request",
"error_description": "Unable to retrieve access token: appid/redirect uri/code verifier does not match authorization code..."
}
Tried Different Authentication Methods
- Anonymous Access → API requires authentication.
- Web API Authentication → Power BI rejects the request.
- OAuth Token in M Query → Not accepted.
Issues encountered
- Power BI does not allow adding Authorization via the UI.
- Attempting to authenticate via "Web API" in Power BI does not work.
- Even when manually adding the token in M code, authentication fails.
- Error: "Authentication with the provided credentials failed."
Questions
- What is the correct way to integrate the LinkedIn API with Power BI?
- Is there any workaround to use OAuth 2.0 in Power BI without creating a custom connector?
- Does LinkedIn API block requests coming directly from Power BI?
I appreciate any guidance or solutions that might help!