Friends
Game Invite
Send or respond to a game invite. Invites only work between confirmed friends and expire automatically after 5 minutes.
POST
/api/vaneltonid/game_invite.php
Requires
Authorization: AppID:AppKey + user tokenSend an invite (action: "send")
| Field | Type | Required | Description |
|---|---|---|---|
| token | string | required | Sender's session token |
| action | string | required | send |
| friend_id | int | required | ID of the friend to invite |
| appid | string | required | Package ID of the game |
| room_data | object | optional | Arbitrary JSON with join info (room ID, server address, etc.) |
Test this endpoint
Headers
Body (send)
Send response 200
{ "success": true, "invite_id": 102 }
Respond to an invite (action: "respond")
The recipient responds using the notification_id from the game_invite notification.
| Field | Type | Required | Description |
|---|---|---|---|
| token | string | required | Recipient's session token |
| action | string | required | respond |
| notification_id | int | required | ID of the game_invite notification |
| accepted | bool | required | true to accept, false to decline |
Respond response 200
{ "success": true, "accepted": true }
After responding, the sender automatically receives a game_invite_accepted or game_invite_declined notification on their next poll.
Errors
| Code | Message | Cause |
|---|---|---|
| 403 | You can only invite friends. | Target is not a confirmed friend |
| 404 | Notification not found or expired. | Invite expired (5 min) or invalid notification ID |