Cannot share on LinkedIn using LinkedIn API v. 2

linkedin share api
linkedin api v2 share example
linkedin share button
linkedin share api javascript example
linkedin ugc post
linkedin api permissions
share post on linkedin using linkedin api
share post on linkedin using linkedin api and php

I am having difficulty getting a share on LinkedIn. I am trying to post a LinkedIn share via LinkedIn API V2 and every time I make the post request I get a request timed out (status 504) answer from the server. Here is my code :

myPost = {
      'author': 'urn:li:person:' + this.uid,
      'lifecycleState': 'PUBLISHED',
      'specificContent': {
          'com.linkedin.ugc.ShareContent': {
              'shareCommentary': {
                  'text': 'Hello World! This is my first Share on LinkedIn!'
              },
              'shareMediaCategory': 'NONE'
          }
      },
      'visibility': {
          'com.linkedin.ugc.MemberNetworkVisibility': 'PUBLIC'
      }
  }

header = {
  'Content-Type': 'application/json',
  'X-Restli-Protocol-Version': '2.0.0',
  'Authorization': 'Bearer ' + token
};

this.http.post('https://api.linkedin.com/v2/ugcPosts', myPost, header).then(res => {
    alert(JSON.stringify(res));
  })
  .catch(err => {
    alert(JSON.stringify(err));
  });

And here is the error message :

{
    "message": "Request timed out",
    "status": 504
}

It's an angular-ionic project and I use the native cordova-plugin-advanced-http to make my post request. I had no issue to sign in with LinkedIn, get my access token and retrieve data from LinkedIn using the same native plugin and the LinkedIn API V2.

On my LinkedIn developer account, to the usage & limits page, I can see the API call to create method.

Timeouts related to POST endpoints in LinkedIn API v2 can happen if LinkedIn is unable to parse the request body. The solution to the example posted here is to turn myPost into a proper JSON string, eg. json.dumps(myPost).

The timeout can also happen if missing the 'Content-Type': 'application/json' header which just bit me while playing with their API using ruby.

Share API, Through the Share API, you can enable users take full advantage of this <title> LinkedIn Developers Documentation On Using the Share API</title> If your application can't provide all the metadata, LinkedIn will attempt to fetch the missing� Search for Linkedin search api at Teoma. See yourself. Linkedin search api in Los Angeles

helped for me with same issue on python

head = {
'Authorization': 'Bearer '+token, 'X-Restli-Protocol-Version': '2.0.0'
}

body = {
    "author": 'urn:li:person:'+ID,
    "lifecycleState": "PUBLISHED",
    "specificContent": {
        "com.linkedin.ugc.ShareContent": {
            "shareCommentary": {
                "text": "Hello World! This is my first Share on LinkedIn!"
            },
            "shareMediaCategory": "NONE"
        }
    },
    "visibility": {
        "com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
    }
}

requests.post('https://api.linkedin.com/v2/ugcPosts', data=json.dumps(body),headers=head)

Share API, LinkedIn documentation for the Shares API. Commonly due to using Restli 2.0 and not encoding URNs. 401, Member does not have author� Search Linkedin search api on Wheather. See yourself. Linkedin search api

There's really no reason to be using an obfuscated, js-lib plugin to just share a link on LinkedIn. All you need is:

https://www.linkedin.com/sharing/share-offsite/?url={url}

Source: Microsoft LinkedIn Share URL Documentation.

For example, this works for me:

https://www.linkedin.com/sharing/share-offsite/?url=http://www.wikipedia.org/

Works fine:

No authentication problem at all. Then just make your own button and hyperlink it. No problem.

If you are interested in a regularly maintained GitHub project that keeps track of this so you don't have to, check it out! Social Share URLs

Share on LinkedIn, LinkedIn recently announced to update all old APIs to the latest version 2.0 of API . We also Duration: 7:00 Posted: 7 Sep 2019 I'm trying to publish some content in a company page on Linkedin using api v2. Reading the docs I've found two ways to share content, using ugcPosts and shares API. I successfuly shared content on a USER page using the ugcPosts. But, I cannot share a content in a COMPANY page using the ugcPosts.

Share Post on LinkedIn using LinkedIn API and PHP, We'll use TSL Marketing's own LinkedIn company page in the examples below. LI 1. Want to Share Your Content Further and Faster? A company page, unlike a profile, cannot send connection requests, can't join or post� Share API. 07/17/2019; 21 minutes to read +2; In this article. Network updates serve as a core experience on LinkedIn, enabling members to share rich content to their professional network. Use the Share API in your application to allow members to take full advantage of the share functionality. Use the Share API for:

LinkedIn Company Pages Part 2, Here is a complete guide on linkedin API and few concepts related to offering an open API to all developers and found the said program not to be in the to share professional content to LinkedIn with the Company API. You will find this information alongside the documentation for each specific API call. Share on LinkedIn. 10/05/2018; 5 minutes to read; In this article Overview. LinkedIn is a powerful platform to share content with your social network. Ensure your content receives the professional audience it deserves using Share on LinkedIn. Use Share on LinkedIn to: Get your content in front of an audience of millions of professionals.

LinkedIn API - A Complete Guide, By default, you'll get the abilities to Share on LinkedIn and Sign In with LinkedIn. If your Auth0 domain name is not shown above and you are not using our Using the token, you can call LinkedIn's API following LinkedIn's documentation. I am trying to create a WordPress plugin for my our customers that will autoshare the posts to their LinkedIn company page. Do I need Marketing Developer Platform access to actually post to company

Comments
  • Hi, welcome to StackOverflow! It often helps to get an answer if you include what you have already tried and how it did not fit your needs. Also details about error messages you get when you attempt to perform your share would be useful to help diagnose the issue.
  • If you're still encountering timeout issues, please submit a ticket to linkedin.zendesk.com and include the response headers received from your POST request.
  • i get this issue " Error parsing request body to json Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: (com.linkedin.data.ByteString$ByteArrayVectorInputStream); line: 7, column: 249]" when my post has "-".