Kassem wroteOh you mean the request_id will be included in the query string AFTER they've accepted the invitation to my application? In that case, I should be able to get the request id and use the GET /ID/ call to check the data field. But in case they did not accept the invitation to the facebook app, the request_id will be null, right?
Correct! as for the question if they didn't accept the invitation (if they click X as called by Facebook), then I have no idea what would happen, but I don't think they will be redirected to your app! maybe the request will be deleted automatically, but I haven't tried it to be honest.
By "there" I mean in your website after accepting the invitation and being redirected, but if you only need to "invitation code" then never mind. :-)
About the other problem, I've answered you on stackoverflow.