Mastodon WebSocket API 401: Unauthorized

145 Views Asked by At

I am trying to connect to mastodons websocket to receive posts. So I am using this guide: https://docs.joinmastodon.org/methods/streaming/#websocket

At beginning I created a new Mastodon application to get my oauth token. After setting up I did a post request to https://mastodon.social/oauth/token and received my token:

{
    "access_token": "MY TOKEN",
    "token_type": "Bearer",
    "scope": "read",
    "created_at": 1689248541
}

Now I want to connect to websocket. I try to connect via wss://streaming.mastodon.social/api/v1/streaming?stream=public&access_token=MY_TOKEN but I always get 401. Is there a problem with the token? I think the scope is correct.

response after connection to websocket

0

There are 0 best solutions below