Message - Read and send messages

Message - Read and send messages

TODO: Support group messaging

class xbox.webapi.api.provider.message.MessageProvider(client)[source]

Bases: BaseProvider

MSG_URL = 'https://xblmessaging.xboxlive.com'
HEADERS_MESSAGE = {'x-xbl-contract-version': '1'}
HEADERS_HORIZON = {'x-xbl-contract-version': '2'}
async get_inbox(max_items=100, **kwargs)[source]

Get messages

Returns:

Inbox Response

Return type:

InboxResponse

Parameters:

max_items (int) –

async get_conversation(xuid, max_items=100, **kwargs)[source]

Get detailed conversation info

Parameters:
  • xuid (str) – Xuid of user having a conversation with

  • max_items (int) –

Returns:

Conversation Response

Return type:

ConversationResponse

async delete_conversation(conversation_id, horizon, **kwargs)[source]

Delete message

NOTE: Returns HTTP Status Code 200 on success

Parameters:
  • conversation_id (str) – Message Id

  • horizon (str) – Delete horizon from get conversation response

Return type:

bool

Returns: True on success, False otherwise

async delete_message(conversation_id, message_id, **kwargs)[source]

Delete message

NOTE: Returns HTTP Status Code 200 on success

Parameters:
  • conversation_id (str) – Conversation Id

  • message_id (str) – Message Id

Return type:

bool

Returns: True on success, False otherwise

async send_message(xuid, message_text, **kwargs)[source]

Send message to an xuid

Parameters:
  • xuid (str) – Xuid

  • message_text (str) – Message text

Returns:

Send Message Response

Return type:

SendMessageResponse