I am trying to import a friend from my LinkedIn profile. Therefore, I use the LinkedIn API at this link https://developer.linkedin.com/documents/code-samples .
I use my API key and secret key here.
I get my name when I log in with my LinkedIn credentials. However, when I try to import my connection by changing a parameter, I get an error.
The code I use to import:
$user = fetch('GET', '/v1/people/~/connections:(headline,first-name,last-name)'); print_r($user);
The error I am getting is:
Warning: file_get_contents ( https://api.linkedin.com/v1/people/~/connections:(headline,first-name,last-name)?oauth2_access_token=AQWccNaOhPHIcKr_pdkQjvz3Ri_ZF2goNdVdaXJgDDO3PIbyvIQ2MEDqtKMP6szRbbzVG003v5ALE198H7J8TDLnuVFOe5MGetOBdNxrOFrk4KKeFsi3Lf5SLuVGtMA2YSj7hQ-h5QA7ZaDGbt95bpfHOL7nMDyIxd69yFG2BYA9CWesCVw&format=json )[function.file-get-contents]: Could not open stream:HTTP request failed!HTTP / 1.0 403 Forbidden in / opt / lampp / htdocs / open -inviter / api.php on line 111
Warning: file_get_contents ( https://api.linkedin.com/v1/people/~/connections:(headline,first-name,last-name)?oauth2_access_token=AQWccNaOhPHIcKr_pdkQjvz3Ri_ZF2goNdVdaXJgDDO3PIbyvIQ2MEDqtKMP6szRbbzVG003v5ALE198H7J8TDLnuVFOe5MGetOBdNxrOFrk4KKeFsi3Lf5SLuVGtMA2YSj7hQ-h5QA7ZaDGbt95bpfHOL7nMDyIxd69yFG2BYA9CWesCVw&format=json )
[function.file-get-contents]: Could not open stream:HTTP request failed!HTTP / 1.0 403 Forbidden in / opt / lampp / htdocs / open -inviter / api.php on line 111
Any hint or help.
, . . 'r_network' define ('SCOPE', 'r_fullprofile r_emailaddress rw_nus r_network');. :)