[Answer]-How should I get Open Graph JSON object to pass in facepy class

1👍

I created open graph actions

You shouldn’t be using me/feed then

The OpenGraph calls are as follows

me/[app_namespace]:[action_type]?[object_type]=[OBJECT_URL]

So, to achieve the same just set the path to me/[app_namespace]:[action_type]

graph.post(
        path = 'me/[app_namespace]:[action_type]',
        [object_type] = '[OBJECT_URL]'
)

og_data is not a parameter in the call. So if your object_type is recipe then it would be

graph.post(path, recipe)

If you want to continue to use me/feed then it should be

graph.post(path, link)

as described at http://developers.facebook.com/docs/reference/api/user/#posts


You cannot do customs read actions like that, the proper call should be

graph.post(
    path = 'me/news.reads',
    article = 'http://yourobjecturl/article.html'
)

Please read the documentation http://developers.facebook.com/docs/opengraph/actions/builtin/#read

👤phwd

0👍

You’re getting an OAuthError because you’re initializing the Graph API client with an instance of a class instead of a string.

Try this:

graph = GraphAPI(request.facebook.user.oauth_token.token)

Alternatively, you could use the graph propery of the Fandjango’s User model to get a preinitialized instance of the Graph API client:

request.facebook.user.graph

Leave a comment