dimanche 19 avril 2015

LinkedIn REST API - Internal server error

I'm using the LinkedIn REST API to post updates to a users timeline. Since a few days I get an Internal server error response from LinkedIn but the code worked before.


PHP:



$postTitle = "hello";
$postDesc = "world ";
$submitted-url = "http://example.com";
$submitted-image-url = "http://ift.tt/1DMrQo6";
$comment = "foobar";

$postData = array('visibility' => array('code' => 'connections-only'),
'content' => array('title' => $postTitle,'description' => $postDesc,'submitted-url' => $postURL,'submitted-image-url' => $postImage), 'comment' => $postComment);

$ch = curl_init('http://ift.tt/1c7LsJ4'.$oauthToken.'&format=json'
);

curl_setopt_array($ch, array(
CURLOPT_POST => TRUE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HTTPHEADER => array('x-li-format: json', "Content-Type: application/json"),
CURLOPT_POSTFIELDS => json_encode($postData)
));

$response = curl_exec($ch);


How to fix that error?


Aucun commentaire:

Enregistrer un commentaire