Open zakir-hyder opened 10 years ago
Hey @zakir-hyder , did you manage to make it work? I'm able to GET, but not to POST.
@ndamnjanovic i could not make it work. I used curl instead.
@zakir-hyder ok, thanks for response!
@zakir-hyder $params doesn't need to be an array, just a string variable will do. You may use the json format also ( i prefer it on my end ).
$share = array( 'comment' => 'YOUR COMMENT GOES HERE' 'content' => array( 'title' => 'CONTENT TITLE GOES HERE', 'submittedUrl' => 'CONTENT URL GOES HERE', 'submittedImageUrl' => 'CONTENT IMAGE URL GOES HERE' ), 'visibility' => array( 'code' => 'anyone' ) );
$headers = array( 'Content-Type' => 'application/json' );
$result = (array) simplexml_load_string($linkedin_service->request('https://api.linkedin.com/v1/people/~/shares', 'POST', json_encode($share), $headers));
if(isset($result['update-key']) && isset($result['update-url'])) return true; else return false;
PS: The response is always in xml format. Your request content type (xml or json) doesn't matter anymore.
@elegisandi i will check. have you successfully shared with application/json content type? I tried to share with application/json last january. it did not work.
@zakir-hyder yes it is working on my end. actually im using this one in my current project :) just make sure you have an access token :D
Hi Guys, I used LinkedIn API for posting, but posts not show on timeline, only on user activity, why It so
Hi. My problem is $linkedinService = OAuth::consumer( 'Linkedin' ); $share = array( 'comment' => Input::get('content'), 'content' => array( 'title' => 'LinkedIn Developers Resources', 'description' => 'Leverage LinkedIn\'s APIs to maximize engagement', 'submitted-url' => 'https://developer.linkedin.com', 'submitted-image-url' => 'https://example.com/logo.png' ), 'visibility' => array( 'code' => 'anyone' ) );
$headers = array(
'Content-Type' => 'application/json',
'x-li-format' => 'json',
);
$result = json_decode( $linkedinService->request('/people/~/shares?format=json', 'POST', json_encode($share), $headers),true );
in linkedin the sharing is successful but in my return in codes it is always returning a tokenresponseexception
@sergiuseg are you referring to linkedin share? if so, you must use this url, https://api.linkedin.com/v1/people/~/shares, in your request.
@carlxaeron 'submitted-url' and 'submitted-image-url' must be in camel-cased, see my comment above or click this link (https://github.com/artdarek/oauth-4-laravel/issues/33#issuecomment-65385782). if still ain't working, please comment the Exception on this thread.
I am trying to post status in Linkedin . Here is my code
I can post using curl with the same access_token. So I am not sure what I am doing wrong.