문제

How can I retrieve a specific post/discussion from a open group through LinkedIn API using PHP.

I was trying with the following API request as shown in here http://developer.linkedin.com/documents/groups-api#post :

https://api.linkedin.com/v1/posts/5835685921059532803:(id,type,category,creator,title,summary,creation-timestamp,relation-to-viewer:(is-following,is-liked,available-actions),likes,comments,attachment,site-group-post-url)

But this returns the following error:

Array
(
    [status_code] => 400
    [data] => stdClass Object
        (
            [errorCode] => 0
            [message] => Invalid Post.id String {5835685921059532803}
            [requestId] => XW2XMPBNKY
            [status] => 400
            [timestamp] => 1391441328953
        )

)

Now, what's the error I have made with this request? What should I do to get a specific discussion?

Thanks.

도움이 되었습니까?

해결책

I just solved the problem. The problem was while making the request. The discussion id (5835685921059532803) I was sending with URL was in wrong format. It should be like: g-GROUP_ID-S-DISCUSSION/POST_ID, for example: g-24405-S-5835685921059532803.

So the URL should be:

https://api.linkedin.com/v1/posts/g-24405-S-5835685921059532803:(id,type,category,creator,title,summary,creation-timestamp,relation-to-viewer:(is-following,is-liked,available-actions),likes,comments,attachment,site-group-post-url)

Hope this would save someone's valuable time.

다른 팁

You need An Api key and Secret key,to get an AUTHORIZATION_CODE,using that AUTHORIZATION_CODE,you will get an Access Token,and with that Access Token if you hit the url,then you will get the proper data, details http://developer.linkedin.com/documents/authentication

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top