9

I am trying to register a Facebook open graph achievement for an app. I obtain the app access token and post the following request using open graph API explorer:

https://graph.facebook.com/752901688356092/achievements&achievement=https://googledrive.com/host/0B1R_JKMKJc2KbkNqZTdleEZvOUE/brags/fb_achive_100_words.html&display_order=100&access_token=752901688356092|pPwn52AvX-Pkj2n8Tavopew5Rav

(note that app ID an access token above are not the real ones). However, I get the following response:

{
  "error": {
    "message": "Unknown path components: /achievements&achievement=https://googledrive.com/host/0B1R_JKMKJc2KbkNqZTdleEZvOUE/brags/fb_achive_100_words.html&display_order=100&access_token=752901688356092|pPwn52AvX-Pkj2n8Tavopew5Rav",
    "type": "OAuthException",
    "code": 2500
  }
}

I have registered the app as a games type app and I have verified the achievement URL using open graph debugger (it shows the achievement and reports everything is fine). I also tried the above without the app-ID included in the access token. What could I be missing?

tron
  • 311
  • 1
  • 3
  • 10
  • The Query String part of an URL is initiated by a question mark `?`, not an ampersand `&` – the latter is only to separate parameters within the query string. – CBroe Apr 30 '13 at 07:48

1 Answers1

13

You have an error in the way your URL is composed. The first GET parameter is supposed to be separated from the base URL by a ?, not a &. Try the following :

https://graph.facebook.com/752901688356092/achievements?achievement=https://googledrive.com/host/0B1R_JKMKJc2KbkNqZTdleEZvOUE/brags/fb_achive_100_words.html&display_order=100&access_token=752901688356092%7CpPwn52AvX-Pkj2n8Tavopew5Rav

This throws another error, but that might also be caused by a missing AUTH token. Why don't you have a look at how they suggest you do it? You probably need to check the setup of the achievement.

likeitlikeit
  • 5,563
  • 5
  • 42
  • 56
  • 1
    That did it, thanks! The facebook tutorial [https://developers.facebook.com/docs/tutorials/androidsdk/3.0/games/open-graph/ ] is actually wrong - it specifies & instead of ? – tron Apr 30 '13 at 22:54