最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

authentication - Power BI + LinkedIn API - Error integrating Community Management API with Power BI - Stack Overflow

programmeradmin1浏览0评论

[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

  1. In Power BI, I tried to connect via "Get Data" > "Web" (Advanced Mode).

  2. I set up the API endpoint, for example:

    :li:anization:{anizationId}?edgeType=CompanyFollowedByMember
    
  3. In the HTTP headers, I tried adding the Access Token as follows:

    Authorization: Bearer {MY_ACCESS_TOKEN}
    Accept: application/json
    
  4. 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.
    
  5. 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
    
  6. 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!

发布评论

评论列表(0)

  1. 暂无评论