0

When I am sending a message by UnificationEngine in pinterest then getting so many errors main errors is:

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

Getting this error:

{
  "Status": {
    "pinterest": {
      "status": 404,
      "info": "Not Found: "
    }
  },
  "URIs": [

  ]
}

PHP SAME CODE

    //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 working fine with twitter and facebook but not working with others

Kuldeep Raj
  • 791
  • 1
  • 7
  • 29

2 Answers2

0

The image link in the above curl is broken/doesn't exist. Please try with a valid image url and check.

AMT.in
  • 391
  • 1
  • 5
  • Thanks in advance I have used so many ways for this problem unificationegine working fine for facebook, twitter, linkedin but its not working for pinterest and google+ its my problem. after that I will implement some other sharing. – Kuldeep Raj Jan 24 '17 at 10:30
  • I have used same message provided by unificationegine in php testing. this is working fine for twitter and facebook but it not working for like: pinterest. "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" ) ) – Kuldeep Raj Jan 24 '17 at 12:54
  • Please provide the sample code that you have tried. Whether the image link is an existing one? – AMT.in Jan 25 '17 at 05:00
  • I have added code in Question please check now 'PHP SAME CODE' – Kuldeep Raj Jan 25 '17 at 06:09
  • For sending google plus page and pinterest board you have modify the "receivers" code like google plus page "receivers" => array( array( "name"=> "page", "id"=> "PAGE_ID" // page id in which page you have to send ) ) pinterest board "receivers" => array( array( "name"=> "page", "id"=> "BOARD_NAME" // board name in which the pin that you have to send ) ) – AMT.in Jan 25 '17 at 09:29
  • I have used same for pinterest but getting 404 error, stdClass Object ( [Status] => stdClass Object ( [PR] => stdClass Object ( [status] => 404 [info] => Not Found: ) ) [URIs] => Array ( ) ) code is "receivers" => array( array( "name"=> "page", "id"=>"785807834952023449" ) ), – Kuldeep Raj Jan 25 '17 at 09:46
  • Please give pinterest board name say "test". I think this (785807834952023449) is not a board name. – AMT.in Jan 25 '17 at 10:11
  • I have used BOARD_NAME as per my testing pinterest account URL is https://in.pinterest.com/learnwithpk/testingunification/ and name is testingunification and I have used so many way for this but getting same error like array( "name"=> "page", "id"=> "testingunification" ) this is very problem thanks for giving me some time – Kuldeep Raj Jan 25 '17 at 10:40
0

I could able to send by using following sample code. Can you please try with this?

<?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);
    ?>
AMT.in
  • 391
  • 1
  • 5
  • its giving me problem "Authentication required!" – Kuldeep Raj Jan 25 '17 at 13:35
  • $connection = $user->add_connection("pinterestBoard", "pinterest", "Ael1zA0FBgr4GDl2tSMcdHkV9Y-HFJ0H4mP240NDuPqfKIBHeQAAAAA@pinterest.com/?id=785807903670958622&is_profile=false&username=learnwithpk&profile_id=785807834952023961&connection_id=pinterest&board_name=testingunification"); Using this and getting this error ErrorException in UEUser.php line 73: Trying to get property of non-object – Kuldeep Raj Jan 25 '17 at 14:41
  • Please provide me solution of this problem:: http://stackoverflow.com/questions/41741241/unifcationengine-not-working-with-google-sharing – Kuldeep Raj Jan 25 '17 at 14:49