Facebook OpenGraph: Submit New Action

I am just starting out with Facebook SSO and OpenGraph. My SSO works with my iOS application, and now I'm starting to see how to publish OpenGraph actions.

I created a new type of action and I need to submit it. When I do this, I get an error message:

You must publish at least one action on your timeline using this type of action. View the documentation.

Ok, so I click on the link to useful documentation and it tells me that I want to do this:

https://graph.facebook.com/me/recipebox:cook?recipe=http://www.example.com/pumpkinpie.html&access_token=YOUR_ACCESS_TOKEN

So, I translated this to the following:

https://graph.facebook.com/me/fotoferret:hug?ferret=http://www.example.com/pumpkinpie.html&access_token=MY_ACCESS_TOKEN

fotoferret is my namespace, hug is my action

where MY_ACCESS_TOKEN is the value returned:

https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=MY_APP_ID&client_secret=MY_APP_SECRET

When I inserted my translated URL, I will return this error:

{
   "error": {
      "message": "An active access token must be used to query information about the current user.",
      "type": "OAuthException",
      "code": 2500
   }
}

. , , , . , ?

+3
2

/me. , .

https://graph.facebook.com/me/fotoferret:hug?ferret=http://www.example.com/pumpkinpie.html&access_token=MY_ACCESS_TOKEN

https://graph.facebook.com/ID/fotoferret:hug?ferret=http://www.example.com/pumpkinpie.html&access_token=MY_ACCESS_TOKEN

Graph Explorer POST GET. GET , , .

cURL

curl -F 'access_token=MY_ACCESS_TOKEN' \
-F 'ferret=http://www.example.com/pumpkinpie.html' \
https://graph.facebook.com/ID/fotoferret:hug

", App Token to Publish"

{"error":{"message":"(#15) This method must be called with an app access_token.","type":"OAuthException","code":15}}

,

curl -F 'access_token=MY_ACCESS_USER_TOKEN' \
-F 'ferret=http://www.example.com/pumpkinpie.html' \
https://graph.facebook.com/me/fotoferret:hug

MY_APP_TOKEN. ,

{"error":{"message":"An active access token must be used to query information about the current user.","type":"OAuthException","code":2500}}

,

curl -F 'access_token=MY_APP_TOKEN' \
-F 'ferret=http://www.example.com/pumpkinpie.html' \
https://graph.facebook.com/me/fotoferret:hug

curl -F 'access_token=MY_APP_TOKEN' \
-F 'ferret=http://www.example.com/pumpkinpie.html' \
https://graph.facebook.com/ID/fotoferret:hug

{"error":{"message":"(#200) Requires extended permission: publish_actions","type":"OAuthException","code":200}}

publish_actions /, "publish_actions": 1, , , "Get Access Token" ( )

+6

, API- API-, . , , .

+1

All Articles