rta
Get chat WebSocket authentication
Returns an authentication token for establishing a WebSocket connection to Xbox Live's Chat service.
What is Xbox Chat WebSocket?
The Chat WebSocket provides real-time messaging capabilities, allowing you to:
- Receive instant message notifications
- Send messages in real-time
- Get typing indicators
- Receive read receipts
WebSocket Connection
const response = await fetch('https://api.xbl.io/v2/rta/chat', {
headers: { 'X-Authorization': 'YOUR_API_KEY' }
});
const authToken = await response.json();
const socket = new WebSocket(
`wss://chat.xboxlive.com/users/xuid(${yourXuid})/chat/connect?AuthKey=${authToken}`,
'chat'
);
socket.onmessage = (event) => {
const message = JSON.parse(event.data);
console.log('New message:', message);
};
Use Cases
- Real-time chat applications - Build instant messaging features
- Notification systems - Alert users to new messages
- Chat bots - Respond to messages automatically
get/v2/rta/chat
Response
Chat authentication token
Example response
{
"code": 200
}Changes
No recorded changes to this endpoint across all 1 revision of this API.