0

I'm trying to use Streamlabs API to have access to donations on my channel. Because Streamlabs use a complicated and time consuming system of app reviewing, I'm trying to use my personal API token available on my setting page :

enter image description here

But it doesn't work, when trying to reach https://streamlabs.com/api/v1.0/donations with a GET request and the access token provided in the previous screen, I obtains the following response :

{
    "error": "access_denied",
    "error_description": "The resource owner or authorization server denied the request."
}

I don't really understand what my access token is for if not to use the actual API...

Documentation about the API here : https://dev.streamlabs.com/reference#donations

graille
  • 1,131
  • 2
  • 14
  • 33

1 Answers1

1

I was stuck for a while like you, that when I just used the socket api, here is my python code but the same can be done with javascript or others.

pip install "python-socketio[client]"
import socketio

io = socketio.Client()
socket_access_token = ''

io.connect(f'https://sockets.streamlabs.com?token={socket_access_token}', transports='websocket')

@io.on('event')
def event(data):
    match data['type']:
        case 'donation':
            print(data['message'])

        case 'subscription':
            print(data['message'])

  • I finally found my mistake. Streamlabs doesn't use the latest version of SockerIO on Python. You have to download specific version of aiohttp, socketio and engineio to work with Streamlabs API: ```python aiohttp==3.8.1 python-engineio==3.14.2 python-socketio[client]==4.6.1 ``` – graille Aug 30 '22 at 08:42
  • I haven't pinned any of my packages and it seems to work now. This answer was very helpful, it should be added to the docs! – Zane Helton Jan 13 '23 at 02:33