Search code examples
facebook-opengraphcustom-action

open graph sample object, invalid og:type?


I've set up a custom action and custom object. I'm attempting to post to my timeline with the sample code Facebook offers:

curl -F 'access_token=<my token>' \
     -F 'photo=http://samples.ogp.me/351656114891990' \
        'https://graph.facebook.com/me/stipple_staging:stipple'

The response that comes back is this (parsed out for easier reading):

{
    "error":{
        "type":"Exception",
        "message":"Object at URL 'http:\/\/samples.ogp.me\/351656114891990' is invalid because the configured 'og:type' of '103770389680565:photo' is invalid."
    }
}

I'm sort of clueless at this point. Is this a known gotcha where I need to do something, or just a bug?

EDIT: Facebook now seems to have fixed this problem.


Solution

  • I think your issue is that your og:type is supposed to be your app namespace:action type, like

    <meta property="og:type" content="your_app_namespace:photo" />
    

    Check out section IV of the custom objects walkthrough, it has some examples of how the og:type tag should be formatted. I'm not certain that appid and namespace are the same thing, in the eyes of FB.

    On a side note, you can check your FB URL's here instead of doing everything through cURL, if you prefer.