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 6693643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:00:27+00:00 2026-05-26T06:00:27+00:00

I am using Graph API https://developers.facebook.com/docs/reference/api/#publishing with PHP SDK and I would like to

  • 0

I am using Graph API https://developers.facebook.com/docs/reference/api/#publishing with PHP SDK and I would like to send some data via HTTP POST method, as it’s mentioned in documentation (e.g. add comment).

At https://developers.facebook.com/docs/reference/api/batch/ they say I should encode the body of HTTP POST request as …should be formatted as a raw HTTP POST body string, similar to a URL query string. I can’t get the combination of PHP functions to get this to work. In the example they claim following should work:

"body": "message=Test status update"

Well, that works. But what if I need to add other params? And how should be this string encoded? E.g. I have this:

$data = array('name' => 'Gargamel', 'occupation' => 'Freelancing Smurf Hunter');

How should I process it to get required format? Following does NOT work:

$batch = array();
$query = array(
    'method' => 'POST',
    'relative_url' => '/forrest/full/of/smurfs',
    'body' => urldecode(http_build_query($data)),
);
$batch[] = $query;
$responses = $this->api('/?batch=' . json_encode($batch, JSON_HEX_AMP), 'POST');

I explored half of the Internet, but I can’t find any more specific information about the format than the one mentioned above (raw HTTP POST similar to a URL query string).

Thanks for any suggestions!

  • 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-26T06:00:27+00:00Added an answer on May 26, 2026 at 6:00 am

    using this: http://forum.developers.facebook.net/viewtopic.php?pid=331343#p331343

        $batch_array[] = array(
            'method' => 'POST',
            'relative_url' => 'Relative url',
            'body' => 'message=' . 'Your message' . '%26data=' . 'Your data' ,
    
        ); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried to update the status using the Facebook graph API with Android http://developers.facebook.com/docs/reference/api/status/
We're using the facebook graph API http://developers.facebook.com/docs/reference/api/post/ and adding the picture parameter. Our picture
I am using the PHP library for the Graph API ( http://github.com/facebook/php-sdk ) but
Using the link to my events automatically generated in the docs here: http://developers.facebook.com/docs/reference/api/ (Events:
I can make a search query using these tokens here: http://developers.facebook.com/docs/api#search in the links:
I would like to post data to a Facebook Page using Graph API even
Using the old REST API, you could do call https://api.facebook.com/method/pages.isAdmin to know if a
Assume a page, http://foo.com , has the Facebook comment social plugin http://developers.facebook.com/docs/reference/plugins/comments/ ) on
I want to create a Login through Facebook on a website using Graph API
What's the difference between accessing user data with the Facebook Graph API ( http://graph.facebook.com/btaylor

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.