I learn about linkedin api
so for start i need to know how i Request an Authorization Code ?
i try so many question with this type here, but i still understand.
From the docs is said to :
"Simple call" :
https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=123456789&redirect_uri=https%3A%2F%2Fwww.example.com%2Fauth%2Flinkedin&state=987654321&scope=r_basicprofile
But i need to know how perform that call with php
.
I try :
$response = file_get_contents("https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=123456789&redirect_uri=https%3A%2F%2Fwww.example.com%2Fauth%2Flinkedin&state=987654321&scope=r_basicprofile");
$response = json_decode($response);
var_dump($response);
From this answer but my return is : NULL.
Edit
My oAuth2.0 end point authorized is http://localhost
, i dont know if that made problem or are possible.
I put curl
tag too, becouse the teaching for this purpose is very welcome.
sorry my english