2017-01-19 103 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') –