Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6612585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:06:57+00:00 2026-05-25T20:06:57+00:00

In the documentation for batch requests with the graph api there are no examples

  • 0

In the documentation for batch requests with the graph api there are no examples of using a search query for the relative url. It should work just like other api calls but I’m getting an error and wondering if Facebook lets you batch search queries. So I’m batching some api calls using the php sdk like

$queries = array(
array('method' => 'GET', 'relative_url' => '/67226614422'),
array('method' => 'GET', 'relative_url' => '/140959058191'),
);
$this->test(json_encode($queries));

$objs = $fb->api('/?batch='.json_encode($queries), 'POST');

Which works great. But if i try to use search?q=QUERY&type=page as the relative url like below

$queries = array(
array('method' => 'post', 'relative_url' => '/search?q=cornell&type=page'),
array('method' => 'GET', 'relative_url' => '/67226614422'),
array('method' => 'GET', 'relative_url' => '/140959058191'),
);

the sdk throws an error

Uncaught Exception: batch parameter must be a JSON array thrown in .../facebook.php

this is the encoded json:

[{"method":"post","relative_url":"\/search?q=cornell&type=page"},{"method":"GET","relative_url":"\/67226614422"},{"method":"GET","relative_url":"\/140959058191"}]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:06:58+00:00Added an answer on May 25, 2026 at 8:06 pm

    You need to url encode the relative_url if it has an ampersand in it.

    Same goes if you are doing a POST request, and you have more than one parameter in the body you are sending.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using batch insertion of nodes and relationships into Neo4j graph database. Everything works,
Is there some nice documentation for Windows batch scripting I can download and refer
I am using Graph API https://developers.facebook.com/docs/reference/api/#publishing with PHP SDK and I would like to
I am attempting to access the Google Search Appliance API: http://code.google.com/apis/searchappliance/documentation/612/gdata/acapi_protocol.html In order to
This is probably batch scripting 101, but I can't find any clear explanation/documentation on
The documentation with the module itself is pretty thin, and just tends to point
I am trying to do a batch build of a project using IAR tools.
I would like to do a batch put of entities with pre-defined keys using
i read about Batch insertion and deletion of rows in the apple documentation,but didnt
I am having trouble finding clear documentation on how to set up a batch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.