Lets say I run a website where a user can create a team, and he can invite his friends to join his Teams.
Say User A created Team XYZ, and Invited User B and User C to join Team XYZ.
For this purpose he sent them a facebook request using javascript, using this method.
The request is sent, my callback function presumably gets a request ID from facebook, using that I store a record in my database with the requestId and teamId, so if the users accept the request, I would be able to add them to the team by identifying them thru the facebook requestId. (That's how assume it will work, correct me if I'm wrong).
User B and C see the requests when they login to facebook the next time, and they accept the requests.
How will my application get a callback saying the request was denied or accepted? Can I set a callback Url, and where can I see some documentation of what the callback will contain?
If a user clicks '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, which is a comma delimited list of Request IDs that a user is trying to act upon:
https://apps.facebook.com/[app_name]/?request_ids=[request_ids]
See https://developers.facebook.com/docs/requests/ for more details about the request format.