Facebook Graph API Search Multiple Parameters Queries

Facebook Graph API Search Multiple Parameters Queries

In this Post We Will Explain About is Facebook Graph API Search Multiple Parameters Queries With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Optimizing request queries to the Facebook Graph APIExample

In this post we will show you Best way to implement How to pass parameters to facebook Graph Search Api, hear for Multiple Parameters in Graph User query searchwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck! as wll as How to get more or lots of data from the simple auto Facebook Graph API with just one request using search queries.

Facebook Graph API search limit & offset

GET graph.facebook.com/me?fields=id,name,picture

Ordering

GET graph.facebook.com
  /{myimg-id}?
    fields=comments.order(reverse_chronological)

Multiple Parameters in Graph User query search

/* simple make the API call using Javascript */
FB.api(
    "/{user-id}",
    function (response) {
      if (response && !response.error) {
        /* handle simple the result */
      }
    }
);

we can perform a simple POST request to the List of the following edges from this simple node like as a.

/{user_id}/videos   // get particuler user videos
/{user_id}/live_videos // get particuler user live_videos
/{user_id}/photos  // get particuler user photos
/{user_id}/albums // get particuler user albums
/{user_id}/favorite_requests // get particuler user favorite_requests
/{user_id}/paymentaccountemails // get particuler user paymentaccountemails
/{user_id}/paymentaccountphones // get particuler user paymentaccountphones
/{user_id}/notifications // get particuler user notifications
/{user_id}/moments_link_invite // get par ticuler user moments_link_invite
/{user_id}/moments_link_invite_convert // get particuler user moments_link_invite_convert
/{user_id}/moments_universal_link_invite // get particuler user moments_universal_link_invite

list of facebook graph search queries

GET /me?fields=id,name,email
GET /me/myimgs?limit=5
GET /me/likes?limit=3

Fields

GET /1337?fields=id,name,description

Nested requests syntax

/<node-id>?fields=<first-level>{<second-level>}

Nested requests Example
GET /me?fields=id,name,email,myimgs{id,name,source},likes{id,name}

Authenticating and Extended Parameters

config.php

require_once 'library/facebook.php';

$app_id = "LiveAppID";
$app_secret = "Liveyourappsecretkey";

$facebook = new Facebook(array(
        'appId' => $app_id,
        'secret' => $app_secret,
        'cookie' => true
));

if(is_null($facebook->getUser()))
{
        header("Location:{$facebook->getLoginUrl(array('req_perms' => 'user_status,publish_stream,user_myimgs'))}");
        exit;
}

user.php

require_once 'config.php';
$me = $facebook->api('/me');
print_r($me);

Get Status Posts Example

status.php

require_once 'config.php';

//Devloped By Pakainfo.com : show statuses Example
$statuses = $facebook->api('/me/statuses');
foreach($statuses['data'] as $status)
{
        echo $status["message"], "<br />";
}

Add New Status Example

status_add.php

require_once 'config.php';

//Devloped By Pakainfo.com : add a status message Example
$status = $facebook->api('/me/feed', 'POST', array('message' => 'This Pakainfo.com post simple came from my app.'));

print_r($status);

View Photos From Albums Example

myimgs.php

require_once 'config.php';

//Devloped By Pakainfo.com : get albums Example
$albums = $facebook->api('/me/albums');

foreach($albums['data'] as $album)
{
        // get all myimgs for album Example
        $myimgs = $facebook->api("/{$album['id']}/myimgs");

        foreach($myimgs['data'] as $myimg)
        {
                echo "<img src='{$myimg['source']}' />", "<br />";
        }
}

Add Photo Example

myimgs_add.php

require_once 'config.php';

$img = realpath("C:\\Pakainfo.com\\api\\file.jpg");

//Devloped By Pakainfo.com : allow uploads Example
$facebook->setFileUploadSupport("http://" . $_SERVER['SERVER_NAME']);

// Devloped By Pakainfo.com : add a status message Example
$myimg = $facebook->api('/me/myimgs', 'POST',
        array(
                'source' => '@' . $img,
                'message' => 'This Pakainfo.com myimg came from my app.'
        )
);

print_r($myimg);

Example

I hope you have Got What is list of facebook graph search queries And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

Leave a Reply

Your email address will not be published. Required fields are marked *