L
L
lleaf2013-04-25 17:14:09
PHP
lleaf, 2013-04-25 17:14:09

Facebook. Like groups/urls via API (PHP)?

Hello!
There was a need to like a group in FB, through the API.
At the moment I'm just sharing links:

<?
require 'lib/facebook.php';
$facebook = new Facebook(
  array(
    'appId' => "0",
    'secret' => "0",
    'cookie' => false
  )
);
$login_url = null;
$user = $facebook->getUser();
$text = "Hello Kitty!";

if (!empty($user)) {
  try { $user_profile = $facebook->api('/me'); }
  catch (FacebookApiException $e) {
    error_log($e);
    $user = null;
  }
} else $login_url = $facebook->getLoginUrl($params = array('scope' => 'manage_pages,offline_access,publish_stream,read_stream'));

if ( $user ){
  try { $message = $facebook->api("/{$user}/feed", "post", array("message"=>$text)); }
  catch (FacebookApiException $e) {
    error_log($e);
  }
}

All sorts of attempts failed:
POST /object_id/likes - does not like pages
POST /me/og.likes?object= site-url.com - writes (#3506) The action type likes:Like does not exist or is not approved , so app [app_id] can only publish to administrators, developers, and testers of the app. User [user_id] is not one of those roles.
THOSE. A third-party user cannot like the page =/
I would like to make the implementation through PHP - has anyone come across it?
Why doesn't option 2 work?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question