Php unificationengine不适用于pinterest
当我在pinterest中通过UnificationEngine发送消息时,收到的错误太多,主要错误是:Php unificationengine不适用于pinterest,php,unificationengine,Php,Unificationengine,当我在pinterest中通过UnificationEngine发送消息时,收到的错误太多,主要错误是: vagrant@homestead:~/Code/laravel$ curl -XPOST https://apiv2.unificationengine.c om/v2/message/send --data "{ \"message\": { \"receivers\": [{\"name\": \"Me\", \"address\": \"test.test\" , \"
vagrant@homestead:~/Code/laravel$ curl -XPOST https://apiv2.unificationengine.c
om/v2/message/send --data "{ \"message\": { \"receivers\": [{\"name\": \"Me\",
\"address\": \"test.test\" , \"Connector\": \"pinterest\" }],\"subject\":\"tes
t\",\"parts\": [{\"id\": \"0\", \"contentType\": \"binary\" , \"size\": 2211,\"
type\": \"image_link\", \"name\":\"file name\",\"data\":\"http://www.hd-wallpap
ersdownload.com/upload/bulk-upload/desktop-pictures-of-cute-kittens-and-cats-wa
llpaper.jpg\",\"sort\":1},{\"id\": \"1\",\"contentType\": \"text/plain\", \"dat
a\":\"test\" ,\"size\": 100,\"type\": \"body\",\"sort\":0}, {\"id\": \"2\",\"co
ntentType\": \"text/plain\", \"data\":\"description2\" ,\"size\": 100,\"type\":
\"link_description\",\"sort\":2},{\"id\": \"3\",\"contentType\": \"text/plain\"
, \"data\":\"title2\" ,\"size\": 100,\"type\": \"link_title\",\"sort\":3},{\"id
\": \"4\",\"contentType\": \"text/plain\", \"data\":\"http://www.amt.in\" ,\"si
ze\": 100,\"type\": \"link\",\"sort\":4}]}}" -u USER_ACCESSKEY:USER_ACCESSSECRET
获取此错误:
{
"Status": {
"pinterest": {
"status": 404,
"info": "Not Found: "
}
},
"URIs": [
]
}
PHP相同的代码
//its working fine
$connection = $user->add_connection('FB', "facebook", $request->access_token);
//its working fine
$tokens = $oauth_token . ':' . $oauth_token_secret;
$connection = $user->add_connection('TW', "twitter", $tokens);
// not working
$connection = $user->add_connection('GP', "googleplus", $request->access_token);
// not working
$connection = $user->add_connection("PT", "pinterest", $request->access_token);
$options = array(
"receivers" => array(
array(
"name"=> "Me" //its working fine with twitter and fb
)
),
"message"=>array(
"subject"=>"test",
"body"=> "ABC",
"image"=>"http://politibits.blogs.tuscaloosanews.com/files/2010/07/sanford_big_dummy_navy_shirt.jpg",
"link"=>array(
"uri"=> "http://google.com",
"description"=> "link desc",
"title"=>"link title"
)
)
);
//Send the message and get their uris
$uris = $connection->send_message($options);
return ['label' => $uris];
Unification与twitter和facebook配合良好,但与其他人不配合上述卷曲中的图像链接已断开/不存在。
请尝试使用有效的图像url并检查。我可以使用以下示例代码发送。你能试试这个吗
<?php
require 'vendor/autoload.php';
use UnificationEngine\Models\UEUser;
$user = new UEUser("USER_ACCESSKEY","USER_ACCESSSECRET");
$connection = $user->add_connection("pinterestBoard","pinterest","ACCESS_TOKEN@pinterest.com/?id=BOARD_ID&is_profile=false&username=USER_NAME&profile_id=PROFILE_ID&connection_id=PINTEREST_PROFILE_CONNECTION_NAME&board_name=BOARD_NAME");
$options = array(
"receivers" => array(
array(
"name"=> "page",
"id"=> "BOARD_NAME"// for pinterest board name in which the pin that you have to send
)
),
"message"=>array(
"subject"=>"ABC111",
"body"=> "test",
"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);
?>
提前感谢我用了很多方法来解决这个问题,unificationegine对facebook、twitter、linkedin都很好,但对pinterest和google不起作用+这是我的问题。之后,我将实现一些其他共享。我在php测试中使用了unificationegine提供的相同消息。这在twitter和facebook上运行良好,但在pinterest上却不起作用。“消息”=>数组(“主题”=>“测试”、“正文”=>“ABC”、“图像”=>”、“链接”=>数组(“uri”=>”、“描述”=>“链接描述”、“标题”=>“链接标题”))请提供您尝试过的示例代码。图像链接是否是现有的?我已经添加了有问题的代码,请现在检查发送google plus页面和pinterest板的“PHP相同代码”,您已经修改了“接收者”代码,如google plus页面“接收者”=>数组(数组(“name”=>“page”,“id”=>“page\u id”//page id,您必须发送的页面))pinterest board“receivers”=>数组(数组(“名称”=>“页面”,“id”=>“board\u name”//board name,其中您必须发送pin))其给我的问题是“需要身份验证!”$connection=$user->add\u connection(“pinterest board”,“pinterest”,“AEL1ZA0FBGR4GDL2TSCMDHKV9Y-HFJ0H4mP240NDuPqfKIBHeQAAAAA@pinterest.com/id=785807903670958622&is_profile=false&username=learnwithpk&profile_id=785807834952023961&connection_id=pinterest&board_name=testingunification);在UEUser.php第73行中使用此项并获取此错误ErrorException:尝试获取非对象的属性请为我提供此问题的解决方案::