ashwinks / PHP-LinkedIn-SDK

A PHP wrapper for the LinkedIn API
94 stars 74 forks source link

Tutorials / Examples #5

Closed ajtrichards closed 9 years ago

ajtrichards commented 10 years ago

Hi.

Are there any tutorials or examples on how to use this library? I've got it working so far as calling:

$linkedin -> fetch('/people/~/group-memberships'); but this only returns 10 groups. I'm guessing I add count = X to the payload parameter but that's just throwing an error.

Any ideas?

ashwinks commented 10 years ago

You would pretty much just follow LinkedIn's api docs. http://developer.linkedin.com/documents/groups-api

So for group memberships, this might work: $linkedin->fetch('/people/~/group-memberships', array('start' => 0, 'count' => 20));

I haven't tested the code above...

jelled commented 10 years ago

To get the above code to work you have to change line 302 as shown below. Otherwise there's no ampersand separating the access token and the start parameter.

$options[CURLOPT_URL] .= '&' . http_build_query($payload, '&');
ashwinks commented 10 years ago

Thanks for catching that jelled - code has been fixed. I also did some quick tests to make sure all is well. I will write the unit tests for this lib to make sure bugs like that don't exist. I've been neglecting this code haha, I apologize.

mxmauro commented 10 years ago

Hi,

A little fix, the code should be:

$options[CURLOPT_URL] .= '&' . http_build_query($payload, '', '&');

Regards, Mauro.