Hi, I’m trying to challenge a player through the post
API at https://online-go.com/api/v1/players/293685/challenge
. I’ve managed to make moves and pause a game through the API, but I’m not able to start a new game through it.
The server always responds just with
Server Error (500)
and no more information, so I’m not sure which piece I’m doing wrong.Here’s my code (in python), copied almost exactly from the api docs:
values = '''
{
"game": {
"name": "a test game",
"rules": "japanese",
"ranked": false,
"handicap": 0,
"time_control_parameters": {
"time_control": "fischer",
"initial_time": 259200,
"max_time": 604800,
"time_increment": 86400
},
"pause_on_weekends": true,
"width": 9,
"height": 9,
"disable_analysis": true
},
"challenger_color": "automatic",
"min_ranking": 0,
"max_ranking": 0
}
'''
headers = {
'Content-Type': 'application/json',
"Authorization" : "Bearer " + token
}
url = 'https://online-go.com/api/v1/players/293685/challenge'
r = requests.post(url, data=values, headers=headers)
if not r.ok:
print(r, r.text)
I’m logged in as player 293686, and I’m able to make moves on an existing game using the web post
API, and able to view my current games, other player info, etc., through the web get
API. This is the only API function I wasn’t able to get to work.
Is it currently supported? Am I doing something wrong?
Thanks.