簡體   English   中英

統一引擎不適用於pinterest

[英]unificationengine not working for pinterest

當我以pinterest通過UnificationEngine發送消息時,出現了很多錯誤,主要錯誤是:

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];

統一可以與Twitter和Facebook正常工作,但不能與其他人一起工作

上面的卷曲中的圖像鏈接已損壞/不存在。 請嘗試使用有效的圖片網址並進行檢查。

我可以使用以下示例代碼進行發送。 你可以試一下嗎?

<?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);
    ?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM