Console
Friends

Poll Notifications

Returns all unread social notifications. Call every 5–10 seconds for near-real-time updates. Game invite notifications expire automatically after 5 minutes.

POST /api/vaneltonid/notifications_poll.php
Requires Authorization: AppID:AppKey + user token

Request body

FieldTypeRequiredDescription
tokenstringrequiredUser's session token

Success response 200

{
  "success": true,
  "count": 2,
  "notifications": [
    {
      "id": 101,
      "type": "friend_request",
      "from_user_id": 15,
      "from_username": "new_friend",
      "from_name": "New Friend",
      "from_profileimg": "https://...",
      "data": null,
      "created_at": "2026-05-29 14:30:00"
    },
    {
      "id": 102,
      "type": "game_invite",
      "from_user_id": 10,
      "from_username": "friend1",
      "data": { "appid": "com.myapp.game", "room_data": { "room": "room-42" } },
      "created_at": "2026-05-29 14:31:00"
    }
  ]
}

Notification types

TypeDescription
friend_requestYou received a friend request
friend_acceptedYour friend request was accepted
game_inviteA friend invited you to a game — data.room_data contains join info. Expires in 5 minutes.
game_invite_acceptedYour game invite was accepted
game_invite_declinedYour game invite was declined

After processing notifications, call notifications_read to mark them as read so they stop appearing on the next poll.