Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I keep on getting this error on XboxLiveClient.send_message() #107

Open
mas6y6 opened this issue Jun 17, 2024 · 1 comment
Open

I keep on getting this error on XboxLiveClient.send_message() #107

mas6y6 opened this issue Jun 17, 2024 · 1 comment

Comments

@mas6y6
Copy link

mas6y6 commented Jun 17, 2024

I don't know how to format the messages and I keep getting this error

Here is my code for the sending script:

async def send_message(auth_mgr, recipient_xuid, message_text, client_session):
    xbl_client = XboxLiveClient(auth_mgr=auth_mgr)
    try:
        formatted_xuid = recipient_xuid
        print(formatted_xuid)
        await xbl_client.message.send_message(
            xuid=recipient_xuid,
            message_text=message_text
        )
        print(f"Message sent to XUID {recipient_xuid}: {message_text}")
    except Exception as e:
        traceback.print_exc()
        print(f"Failed to send message: {e}")

But keep on getting this annoying error

Traceback (most recent call last):
  File "/Users/*****/Desktop/Python projects/*****/xbox_messaging_debug.py", line 50, in send_message
    await xbl_client.message.send_message(
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/xbox/webapi/api/provider/message/__init__.py", line 133, in send_message
    resp.raise_for_status()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/httpx/_models.py", line 761, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://xblmessaging.xboxlive.com/network/Xbox/users/me/conversations/users/xuid(*****)'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
Failed to send message: Client error '400 Bad Request' for url 'https://xblmessaging.xboxlive.com/network/Xbox/users/me/conversations/users/xuid(*****)'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

I dont know if there is a format for the xuid that I need or something else...

@mas6y6
Copy link
Author

mas6y6 commented Jun 17, 2024

I added a print script and i got this as the result

{"errorCode":400,"errorMessage":"Failed to parse user identity from path."}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant