Skip to main content

Notifications

Community site session details

Community site session details

Session Id : GVK0ijCtITKuc9Mwj82lvM
Power Apps - Connector Development
Suggested answer

Issues with Custom Connector in Power Apps for LinkedIn Post Integration

Like (3) ShareShare
ReportReport
Posted on 4 Apr 2025 15:32:20 by 4
Hi Community,
 
I am learning how to post an article on LinkedIn using Power Automate. I created an Instant Cloud Flow with Power Virtual Agent (PVA) as the trigger. For the action, I selected a third-party service to post an article, filled in all the necessary details, and clicked save. Since I’m using PVA as the trigger, a custom connector is required to run the flow. I created an app in the Developer Portal to obtain the Client ID and Client Secret. I added products like Share on LinkedIn and Sign In with LinkedIn using OpenID Connect for the scope. Currently, we only have the w_member_social scope available, while r_liteprofile and r_emailaddress are missing and not available. However, while generating the access token, we can select scopes like openid, profile, w_member_social, and email. After that, I started creating the custom connector in Power Apps, following the six required steps:
 
1. General Information
Scheme: Selected HTTPS
Host: api.linkedin.com
Base URL: /
 
2. Security
Authentication Type: OAuth 2.0
OAuth 2.0 Settings:
Client ID: 1234567
Client Secret: xx667788
Authorization URL: https://www.linkedin.com/oauth/v2/authorization Token URL: https://www.linkedin.com/oauth/v2/accessToken Refresh URL: https://www.linkedin.com/oauth/v2/accessToken Scope: w_member_social
Redirect URL: https://global.consent.azure-apim.net/redirect/linkedinget-5f45760dxx (This URL is pasted under the Auth settings.)
 
3. Definition
Action:
Summary: LinkedInPost
Operation ID: LinkedInPost
Visibility: Selected None
Import from Sample (Request Tab):
Method: POST
URL: https://api.linkedin.com/v2/ugcPosts
Headers: Bearer Token: Bearer [Access Token] (I am unable to add extra headers here.)
Body:
{
"author": "urn:li:person:xxxxx",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": { "shareCommentary": {
"text": "Check out this insightful article on SQL best practices! #SQL #BestPractices"
},
"shareMediaCategory": "ARTICLE",
"media": [
{
"status": "READY",
"originalUrl": "https://www.geeksforgeeks.org/best-practices-for-sql-query-optimizations/",
"title": "SQL Best Practices",
"description": "Best practices for SQL query optimization."
}
]
}
},
"visibility": { "com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
 
4 & 5. (Skipped these steps for now)
 
6. Test
 
Clicked on "New Connection" and selected "Create".
A LinkedIn login window appeared; I logged in and clicked "Allow".
This redirected me to the connection page in Power Apps.
In the custom connector, I clicked "Edit" → "Test" tab → "Test Operations".
 
Issue:
 
I am encountering multiple errors when testing the operation: 400 (Bad Request) - Missing Version 401 (Unauthorized) - Token Revoked 422 (Unprocessable Entity) 404 (Not Found) - Resource Not Found I’m unsure if this is related to incorrect OAuth settings, missing scopes, or API configuration. Could you please review and guide me on how to resolve these issues.
Regards,
Sathya Sai.
Categories:
  • Suggested answer
    vipuljain03 Profile Picture
    464 on 27 Apr 2025 at 21:14:43
    Issues with Custom Connector in Power Apps for LinkedIn Post Integration
    Below corrections might be required in your custom connector configuration:
    1. LinkedIn API versioning is required in headers (X-Restli-Protocol-Version). Please have a look at this article - https://learn.microsoft.com/en-us/linkedin/shared/api-guide/concepts/protocol-version
      Authorization: Bearer {Access Token}
      X-Restli-Protocol-Version: 2.0.0
      LinkedIn-Version: 202310
      Content-Type: application/json
    2. Make sure the Access Token actually has the w_member_social permission when posting.
    3. 401 Unauthorized =>This might be possible that the token expired (tokens are short-lived unless refreshed) OR You used wrong redirect URL when authorizing.
    --------------------------------------------------------------------------
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too!
    Thanks,
    Vipul

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard

Featured topics

Loading started
Loading complete