2017-01-19 43 views
0

嗨當​​我通過unificationengine API在谷歌發送消息以及隨後我收到此錯誤unifcationengine不與谷歌合作+共享

stdClass Object 
(
    [Status] => stdClass Object 
     (
      [GP] => stdClass Object 
       (
        [status] => 504 
        [info] => 504 Connection Error: Post https://googleplus-v2connector.unificationengine 
.com/v2/message/send: EOF: 
       ) 

     ) 

    [URIs] => Array 
     (
     ) 

) 

unificationengine API做工精細與Facebook和Twitter,但它不是與工作GOOGLEPLUS

我的代碼是

$app = new UEApp("APP_KEY","APP_SECRATE"); 
$user = new UEUser("USER_KEY","USER_SECRET"); 
$connection = $user->add_connection('google', "googleplus", $access_token); 
$options = array(
    "receivers" => array(
     array(
       "name"=> "Me" 
     ) 
    ), 
    "message"=>array(
     "subject"=>"ABC", 
      "body"=> "", 
      "image"=>$shareImageUrl, 
      "link"=>array(
       "uri"=> $link, 
       "description"=> "", 
       "title"=>"Click here for view" 
      ) 
     ) 
    ); 
//Send the message and get their uris 
$uris = $connection->send_message($options); 
print_r($uris); 
$myArray = explode('/', $uris[0]); 
return $myArray[3]; 

回答

0

能否請你改變接收機一部分FOLL OWS和檢查是否可以發佈消息

「接收機」=>數組(

array(
"name"=> "page", 

"id"=> "PAGE_ID"// PAGE_ID is id of the page which you have to post message 
) 

+0

現在我收到的一些錯誤在FB和Twitter +共享和谷歌相同的加共享「捲曲錯誤28:手術後10000毫秒收到0字節超時」現在我不能夠分享FB上的任何消息,微博和谷歌 –

+0

現在我在其他工作API {「狀態」:504,「信息」:「504連接錯誤:發佈https://pinterest-v2connector.unificationengine.com/v2/test:撥號tcp 52.210.137.103:443:getsockopt:連接被拒絕「} –

+0

如何獲得PAGE_ID –

0

我可以能夠通過使用下面的示例代碼來發送。你可以試試這個嗎?

<?php 

    require 'vendor/autoload.php'; 
    use UnificationEngine\Models\UEUser; 

    $user = new UEUser("USER_ACCESSKEY","USER_ACCESSSECRET"); 

    $connection = $user->add_connection("google","googleplus","[email protected]/?id=PAGE_ID&refresh_token=REFRESH_TOKEN&is_profile=false"); 

    $options = array(
     "receivers" => array(
      array(
       "name"=> "page", 
       "id"=> "PAGE_ID"// page id in which page you have to send 
      ) 
     ), 
     "message"=>array(
      "subject"=>"ABC111", 
      "body"=> "", 
      "image"=>"http://politibits.blogs.tuscaloosanews.com/files/2010/07/sanford_big_dummy_navy_shirt.jpg", 
      "link"=>array(
       "uri"=> "http://google.com", 
       "description"=> "", 
       "title"=>"Click here for view" 
      ) 
     ) 
    ); 

    //Send the message and get their uris 
    $uris = $connection->send_message($options); 

    print_r($uris); 

?> 
+0

我使用相同的代碼時出現此錯誤。 tdClass對象 [狀態] => stdClass的對象( [谷歌] => stdClass的對象 ( [狀態] => 403 [信息] =>訪問未配置。Google+專頁API尚未在項目中使用的38616112478 前或者已停用,請訪問https://console.developers.google.com/apis/api/plusPages /overview?project = 38616112478然後重試,啓用該功能如果最近啓用了此API,請等待幾分鐘,以獲取 行動傳播到我們的系統和重試: ) –

+0

看起來像權限問題。請分享你給的範圍。 –

+0

我已經添加範圍:'scope'=> array('https://www.googleapis.com /auth/plus.stream.write','https://www.googleapis.c om/auth/plus.me','https://www.googleapis.com/auth/plus.login') –