Closed aCodeAlchemist closed 9 years ago
Try this
if(isset($_GET['code'])) { $_REQUEST['code'] = $_GET['code']; $token = $li->getAccessToken($_REQUEST['code']); $token_expires = $li->getAccessTokenExpiration();
$sComentario = $modelPublicacionLinkedin->sTitulo; $sContenido = array('title' => $modelPublicacionLinkedin->sTitulo, 'description' => $modelPublicacionLinkedin->sMensaje, 'submitted_url' => $_SESSION['img2']); $sVisiblePara = 'anyone'; $sVisible = array('code' => $sVisiblePara);
$json = array('comment' => $sComentario ,
'content' => $sContenido,
'visibility' => $sVisible);
$PostShare_People = $li->post('/people/~/shares', $json); echo '
' . print_r($PostShare_People,1) . '';
Marcelo Jáuregui
On Fri, Feb 20, 2015 at 2:18 AM, Jay Shah notifications@github.com wrote:
I try to share using `$ln->post()' method. but browser goes round and round after authorization. It doesn't do anything? any idea what am I doing wrong?
$li = new LinkedIn( array( 'api_key' => 'myKey', 'api_secret' => 'mySecret', 'callback_url' => 'http://180.211.99.162:9051/widgetapi/oauth/linkedin' ) );
if(isset($_REQUEST['code'])) { $token = $li->getAccessToken($_REQUEST['code']); $result = $li->post("/people/~/shares", array( "comment"=>"Check out developer.linkedin.com! http://linkd.in/1FC2PyG", "visibility" => array("code" => "anyone") ) ); debug($result); } else { $loginUrl = $li->getLoginUrl(array( LinkedIn::SCOPE_WRITE_SHARE ) ); $this->redirect($loginUrl); }
}
— Reply to this email directly or view it on GitHub https://github.com/ashwinks/PHP-LinkedIn-SDK/issues/11.
And use LinkedIn::SCOPE_READ_WRTIE_UPDATES,
Marcelo Jáuregui
On Sat, Feb 21, 2015 at 12:53 PM, Marcelo Jauregui < MarceloJauregui@gmail.com> wrote:
Try this
if(isset($_GET['code'])) { $_REQUEST['code'] = $_GET['code']; $token = $li->getAccessToken($_REQUEST['code']); $token_expires = $li->getAccessTokenExpiration();
$sComentario = $modelPublicacionLinkedin->sTitulo; $sContenido = array('title' => $modelPublicacionLinkedin->sTitulo, 'description' => $modelPublicacionLinkedin->sMensaje, 'submitted_url' => $_SESSION['img2']); $sVisiblePara = 'anyone'; $sVisible = array('code' => $sVisiblePara);
$json = array('comment' => $sComentario , 'content' => $sContenido, 'visibility' => $sVisible);
$PostShare_People = $li->post('/people/~/shares', $json); echo '
' . print_r($PostShare_People,1) . '';Marcelo Jáuregui
On Fri, Feb 20, 2015 at 2:18 AM, Jay Shah notifications@github.com wrote:
I try to share using `$ln->post()' method. but browser goes round and round after authorization. It doesn't do anything? any idea what am I doing wrong?
$li = new LinkedIn( array( 'api_key' => 'myKey', 'api_secret' => 'mySecret', 'callback_url' => 'http://180.211.99.162:9051/widgetapi/oauth/linkedin' ) );
if(isset($_REQUEST['code'])) { $token = $li->getAccessToken($_REQUEST['code']); $result = $li->post("/people/~/shares", array( "comment"=>"Check out developer.linkedin.com! http://linkd.in/1FC2PyG", "visibility" => array("code" => "anyone") ) ); debug($result); } else { $loginUrl = $li->getLoginUrl(array( LinkedIn::SCOPE_WRITE_SHARE ) ); $this->redirect($loginUrl); }
}
— Reply to this email directly or view it on GitHub https://github.com/ashwinks/PHP-LinkedIn-SDK/issues/11.
@marceloj Not working! Sorry!
I try to share using
$li->post()
method. but browser goes round and round after authorization. It doesn't do anything? any idea what am I doing wrong?I debugged curl options and I got following parameters. And everything looks alright. but dont know why this is not working.