0

Followed Steps.

Linkedin developer Console -> created App -> with client ID and Secret.

Now I am making API calls to linked in with following access token.

{"access_token":"AQWI0-2W3sRsKjQ6WiKuiTEn0sCkIcDdsfscqYXXAoqb3IDI0Ab4zvzzUoqiYalRcr7e6x8_JjjptYupSDMktgKrS_zjxOKGj7tysWody43yG3U_iKTAiyHLAAgYAspVdfds1DrlPh_5OvUammbAwTGSBN21Af-wc7527dpATUeslmLtesdfkxuvL9noEE","expires_in":5184000}

I want to retrieve Post and comments and likes from linkedin account.

I am using the official documentation of linkedin provided Here

that call should be on URL

https://api.linkedin.com/v1/people/~/shares?format=json

is there should be:

https://api.linkedin.com/v1/people/~/shares?format=json&access_token="AQWI0-2W3sRsKjQ6WiKuiTEn0sCkIcDdsfscqYXXAoqb3IDI0Ab4zvzzUoqiYalRcr7e6x8_JjjptYupSDMktgKrS_zjxOKGj7tysWody43yG3U_iKTAiyHLAAgYAspVdfds1DrlPh_5OvUammbAwTGSBN21Af-wc7527dpATUeslmLtesdfkxuvL9noEE"

Or anything else? Please suggest.

2
  • What is the issue you are facing?
    – Saroj Bera
    Commented Oct 24, 2016 at 11:39
  • MAM i am facing issue of below error. Commented Oct 24, 2016 at 11:51

2 Answers 2

0

You are using the following URL : https://api.linkedin.com/v1/people/~/shares?format=json&access_token="AQWI0-2W3sRsKjQ6WiKuiTEn0sCkIcDdsfscqYXXAoqb3IDI0Ab4zvzzUoqiYalRcr7e6x8_JjjptYupSDMktgKrS_zjxOKGj7tysWody43yG3U_iKTAiyHLAAgYAspVdfds1DrlPh_5OvUammbAwTGSBN21Af-wc7527dpATUeslmLtesdfkxuvL9noEE"

It should work fine repacing '~' with '%7E'

Please mark this as resolved if this resolves your issue.

Thanks, Vipul

11
  • { "errorCode": 0, "message": "Unsupported POST target {/v1/people/%7E/shares}", "requestId": "494ONL7LQD", "status": 405, "timestamp": 1477309430969 } Commented Oct 24, 2016 at 11:44
  • Thanks for ans. vipul . my POST request was :- api.linkedin.com/v1/people/%7E/… Commented Oct 24, 2016 at 11:48
  • api.linkedin.com/v1/people/%7E/shares?format=json&access_token=AQWI0-2W3sRsKjQ6WiKuiTEn0sCkIcDdsfscqYXXAoqb3IDI0Ab4zvzzUoqiYalRcr7e6x8_JjjptYupSDMktgKrS_zjxOKGj7tysWody43yG3U_iKTAiyHLAAgYAspVdfds1DrlPh_5OvUammbAwTGSBN21Af-wc7527dpATUeslmLtesdfkxuvL9noEE Commented Oct 24, 2016 at 11:48
  • Have you tried like this : Http h = new Http(); String postParam =''; String method = 'POST'; string sharequery='api.linkedin.com/v1/people/~/network/updates/…'; HttpRequest sharequery_req= new HttpRequest(); sharequery_req.setMethod(method); sharequery_req.setBody(body); sharequery_req.setEndpoint(sharequery.replace('~','%7E')); sharequery_req.setHeader('Content-Type', 'text/xml');
    – Vipul Goel
    Commented Oct 25, 2016 at 6:31
  • Error:- Access to shares denied Commented Oct 25, 2016 at 8:00
0

You could test the REST API URLs in the REST Console for LinkedIn at: https://developer.linkedin.com/rest-console

This is what I use for LinkedIn integration

<script type="text/javascript" src="//platform.linkedin.com/in.js">
  api_key:   ******
  onLoad:    onLinkedInLoad, OnLinkedInAuth
  authorize: true
  lang:      en_US
</script>

<script>
  function OnLinkedInAuth() {
    IN.API.Profile("me").fields(["firstName","headline","positions:(id,title,summary,start-date,end-date,is-current,company:(id,name,type,size,industry,ticker))","educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes)"])
    .result(function(result) {
       console.log(result)
    })
    IN.API.Raw("/people/~/shares").result(callback);
  }

  function callback(){}
</script>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .