API Getting empty json list from a certian link but everything else works fine

Hi,

I successfully authenticated and can access api/v1/me/ and do stuff in my profile but when trying to access blocked players from https://online-go.com/api/v1/me/blocks I get response 200 and JSON is just empty list [] compared to the browser it returns a list of profiles blocked as expected

Pretty sure my authentication is fine as I can get my profile info using https://online-go.com/api/v1/me/ and perform actions like block_game, block_chat using players ids and I confirmed these action using the browser but I fail to get the list

import requests

url = 'https://online-go.com/api/v1/me/blocks'
headers = {'Authorization': "Bearer " + auth_token}
r = requests.get(url, headers=headers)

It works fine if I added the cookies from the browser tho but I didn’t need cookies before for other actions in my profile.

Does it need special values in the header? why other actions are working fine except this

Thanks

1 Like

Yeah for that endpoint you’ll need to pass the sessionid cookie, that’s true for a few endpoints.

3 Likes

So, I managed to get around the sessionid by using https://online-go.com/api/v1/meblocks instead

The catch is… this one returns all previously blocked profiles with their status (it maintains those already unblocked)

[
{'blocked': player_id1, 'block_chat': False, 'block_games': True}, <-- blocked games
{'blocked': player_id2, 'block_chat': False, 'block_games': False}, <-- no longer blocked
{'blocked': player_id3, 'block_chat': True, 'block_games': True} <--- blocked chat and games
]

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.