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

The Archive Base Latest Questions

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

I’ve tried building the basis of our next app following Facebook’s Open Graph Tutorial

  • 0

I’ve tried building the basis of our next app following Facebook’s Open Graph Tutorial but for some reason I’m getting errors thrown at me regardless of how I try POSTing an action.

I’ll go as in-depth as I can here as I hope it’ll be very useful for all developers getting to grips with the new Timeline.

I’ve defined a battle action and a hero object using the default settings when setting up each. transcendgame is my namespace.

$id is the userid of the Facebook user (I’ve tried using /me/, the direct id has always been less problematic in the past for me).

$herourl is an urlencoded string pointing to a separate webpage with the following content:

 <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# transcendgame: http://ogp.me/ns/fb/transcendgame#">
  <meta property="fb:app_id"      content="[my id]"> 
  <meta property="og:type"        content="transcendgame:hero"> 
  <meta property="og:url"         content="http://apps.facebook.com/transcendgame/"> 
  <meta property="og:title"       content="Hercules"> 
  <meta property="og:description" content="As this game is still in development, you can ignore this feed post!"> 
  <meta property="og:image"       content="[an image url]">

The application canvas page contains the following code. It should POST a new action event to the user’s timeline, but is consistently giving me “Error occured”. I have also tried it with the sample hero object (samples.ogp.me…) with the same problem.

<script>
    function doTest()
        {
            FB.api('/<?=$id?>/transcendgame:battle' + 
                        '?hero=<?=$herourl?>','post',
                        function(response) {
                if (!response || response.error) {
                        alert('Error occured');
                } else {
                    alert('Post was successful! Action ID: ' + response.id);
                    }
            });
        }
    </script>

    <a href="#" onclick="doTest(); return false">Test fb post</a>

I’m calling the JS SDK and running fb.init correctly. I honestly don’t know where the problem even lies, let alone how to fix it.

EDIT: I’ve correctly added the user’s access token to the API call:

FB.api('/me/transcendgame:battle' + 
                    '?hero=<?=$herourl?>&access=<?=$token?>','post',

However, I’m getting the following error:

Type: OAuthException

Message: (#3502) Object at URL [url] has og:type of 'game'. The property 'hero' requires an object of og:type 'transcendgame:hero'.

This is odd, as the webpage definitely does have og:type set correctly, as listed earlier in this question. Is this some Facebook hiccup I need to work around?

SECOND EDIT: Fixed the final problem.

The og:url I had assumed to point back to the URL of the app’s canvas, but it needs to reference itself instead. For instance, if your object is on mydomain.com/object1.php then the code must be:

<meta property="og:url"         content="http://www.mydomain.com/object1.php">

Hope this helps others.

  • 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:43:13+00:00Added an answer on May 25, 2026 at 8:43 pm

    I have the same problem and I changed the callback to be more helpful:

      var fb_url = '/me/YOUR_NAMESPACE?key=value';
      FB.api(fb_url,'post',
        function(response) {
          console.log(response);
          if (!response || response.error) {
            var msg = 'Error occured';
            if (response.error) {
              msg += "\n\nType: "+response.error.type+"\n\nMessage: "+response.error.message;
            }
            alert(msg);
          } else {
            alert('Post was successful! Action ID: ' + response.id);
          }
        }
      );
    

    UPDATE

    I finally got a post to the timeline, and the change I had to make was to use the BETA version of JavaScript SDK. ( https://developers.facebook.com/support/beta-tier/ )

    Use this:

    <script src="//connect.beta.facebook.net/en_US/all.js#appId=xxx&amp;xfbml=1"></script>
    

    Instead of this:

    <script src="//connect.facebook.net/en_US/all.js#appId=xxx&amp;xfbml=1"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including 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.