phpfacebookfacebook-graph-api

can't publish facebook single achievements


I am using https://graph.facebook.com/myuid/achievements/POST/?achievement=achievement_url&access_token=app_access_token. But this url is returning empty data array.I have publish_action permission.Please help.


Solution

  • You're doing a GET request here, but this needs to be a POST to

    /v2.1/me/achievements
    

    as stated at https://developers.facebook.com/docs/graph-api/reference/v2.1/user/achievements/#publish with

    achievement={url-of-achievement-type}
    

    as POST body. Replace {url-of-achievement-type} with the actual URL of your achievement.