“Unsupported get request”
I recently started investing a particular Facebook Error: “Unsupported get request”. I wanted to post my findings on the error as most of my Google searches actually pointed to a root cause that did not apply to my case.
Most of the google searches for Facebook Error Unsupported get request pointed to an Age or Country based restriction. I.E. the user of my application was making a request for information that they did not have access or permission to see. However in our app this was not the cause.
The Facebook Error Unsupported get request was actually caused by us trying to redeem a particular Request ID from Facebook multiple times.
The requests were User to User. We searched our code and could not figure out how a single request was getting redeemed multiple times. As it turned out – it was not an issue in our code, rather in how our users accessed our application.
According to the Facebook Docs, here is how a request is handled when users click on it from facebook (https://developers.facebook.com/docs/howtos/requests/):
If people click Accept on a request, they will be sent to the Canvas Page URL of the app that sent the request. This URL will contain an additional
GET parameter —
request_ids — a comma-delimited list of Request IDs that a user is trying to act upon:
The problem was that our users were bookmarking this URL within their browser. Then on subsequent days they were using this URL to re-enter the game.
Our app was setup to handle the request ID’s if they were found in the URL. Everytime this URL was hit we tried to process the request ID’s. On the 2nd, 3rd and subsequent visits, Facebook would return the error “Unsupported get request”.
How then do you get around this? Keep in mind that this is a valid error. We tried to process a request that has already been processed. Facebook is properly giving us an error back.
You solve this by making changes to your request handling flow. here are a few suggestions.
One idea is to make a request to Facebook before processing the request ID to get a list of valid request id’s for a particular user. You can then ensure that the request id the user passed is indeed valid and active. If it is – then handle it. if it is not – then have your code skip it. P.S. this page by Facebook has details on getting all the request ids from a user: https://developers.facebook.com/docs/howtos/requests/
Another idea is to perform a redirect. There could be several other entry points that a user could be using. If you redirect the user to a clean landing page with no extra get parameters, then you have more control over how users bookmark your application. This method is not full proof however and validating user input (such as in the first option) is generally recommended.