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

  • SEARCH
  • Home
  • 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 7749831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:08:10+00:00 2026-06-01T11:08:10+00:00

To begin, Ive spent several hours looking for an answer and have come CLOSE

  • 0

To begin, Ive spent several hours looking for an answer and have come CLOSE but havent found a full answer.

So Im trying to publish actions using Facebook’s Graph API and want to send parameters in the URL when initially calling it with the Facebook Javascript SDK.

Here is a call that WORKS:

  function postNewAction()
  {
          passString = '&object=http://mysite.com/appnamespace/object.php';

          FB.api('/me/APP_NAMESPACE:ACTION' + passString,'post',
             function(response) {
                  if (!response || response.error) {
                      alert(response.error.message);
                  } 
                  else {
                      alert('Post was successful! Action ID: ' + response.id);
                  } 
              }
          );    
   }

With object.php looking like so:

  <head xmlns:enemysearch="http://apps.facebook.com/APP_NAMESPACE/ns#">
    <meta property="fb:app_id" content="APP_ID" /> 
    <meta property="og:type" content="APP_NAMESPACE:object" /> 
    <meta property="og:title" content="some title" />
    <meta property="og:description" content="some description"/> 
    <meta property="og:locale" content="en_US" />
    <meta property="og:url" content="http://www.mysite.com/appnamespace/object.php"/>
  </head>

So obviously the above will post some sort of action to Facebook that will be the same every time object.php is called.

This is not ideal for my purposes.

So I took a look at this thread and it helped but as you will see, doesnt answer everything.

So if I change object.php to include dynamically generated meta tags by using content from either GET or POST and use the Object Debugger with a matching URL format to the one provided in og:url, the debugger shows everything as working as I would expect with now warnings. Here is what the dynamically generated object.php looks like:

   <?php
      if(count($_GET) > 0) {
     $userName = (int)$_GET['userName'];
      }
      else {
     $userName = (int)$_POST['userName'];
      }
   ?>
  <head xmlns:enemysearch="http://apps.facebook.com/APP_NAMESPACE/ns#">
    <meta property="fb:app_id" content="APP_ID" /> 
    <meta property="og:type" content="APP_NAMESPACE:object" /> 
    <meta property="og:title" content=" <?php echo $userName; ?>" />
    <meta property="og:description" content="Click to view more from <?php echo $userName; ?>"/> 
    <meta property="og:locale" content="en_US" />
    <meta property="og:url" content="http://mysite.com/appnamespace/object.php?userName=<?php echo $userName; ?>"/>
  </head>

SO, what I need to know is how to send url parameters in the initial call. If I use the debugger and enter something to the effect of http://mysite.com/appnamespace/object.php?userName=Brad everything works fine and the meta tags return content with that name inside of them. However if I try to pass the same url in the Javascript Call, it returns an error saying that my meta property og:type needs to be ‘APP_NAMESPACE:object’ (which as you see above, is what I have) instead of ‘website’ (which as you can see above, is something I am not using). Here is what that broken call would look like:

  function postNewAction(userName)
  {
      passString = '&object=http://mysite.com/appnamespace/object.php?userName=' + userName;

      FB.api('/me/APP_NAMESPACE:ACTION' + passString,'post',
         function(response) {
              if (!response || response.error) {
                  alert(response.error.message);
              } 
              else {
                  alert('Post was successful! Action ID: ' + response.id);
              } 
          }
      );    
  }

To be clear, the userName variable is only for example.

Any thoughts?

  • 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-06-01T11:08:11+00:00Added an answer on June 1, 2026 at 11:08 am

    I’ve not tested it but i see something different from the code examples in this link

    http://developers.facebook.com/docs/opengraph/tutorial/#publish

    In your code passString should start with ? as is the very beginning of the query string.

    // so this :
    passString = '&object=http://mysite.com/appnamespace/object.php?userName=' + userName;
    // should be :
    passString = '?object=http://mysite.com/appnamespace/object.php?userName=' + userName;
    
      FB.api('/me/APP_NAMESPACE:ACTION' + passString,'post',
         function(response) {
              if (!response || response.error) {
                  alert(response.error.message);
              } 
              else {
                  alert('Post was successful! Action ID: ' + response.id);
              } 
          }
      );    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have spent almost 24hours trying to figure out what I'm doing wrong, but
this is so basic i can't believe ive spent a full day on it
I've spent the better part of my day trying to solve this message while
Ive got a contact form that isnt sending but is outputting that the message
I have been trying for some time to create a class/series of classes that,
I have a situation where I have several many-to-many associations. In the upwards of
I really have almost no idea how I can even begin to do this
I've spent the last couple hours researching every layout method I can think of
I've spent hours on this. Seems like our job on Linux is to debug
I'm trying to move a fairly slow function off of the main thread, but

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.