lichess.org
Donate

PHP Oauth2 Lichess puzzles

Hi there,
since I'm not happy with how few puzzle statistics you get, I wanted to make my own.
I tried it with python for...8hours and gave up.

Now I have my webserver set up, and I manage to get my authorization code and my token.

Next step would be, to somehow get the puzzle-activity with a request to this URL: lichess.org//api/user/{username}/puzzle-activity
(I changed {username} to Asrar).

This is where my understanding completely stops.
I'm using php and CURL to send / receive data, but I have no idea what kind of header I have to send, to not get a "Missing authorization header" error.

I can't find that info in the api documentation either.
I also only get "404 - Resource not found"

I would greatly appreciate some help here.
Thanks in advance,

Asrar
I do.

I sent this program to a friend(he does these things for a living), and he told me, the puzzle-activity endpoint seems to be dead.
It's also asked on the Discord now.
So I hope to hear back soon, to see if it's that the api that has a bug, or the documentation.
Try send the request to the protocol http instead https.
Then I get the message "301 Moved Permanently"

So...any other api link for the puzzles?
niklasf posted this on the Github issue I made:
"Documentation bug. The actual URL is lichess.org/api/user/puzzle-activity, and it gives the activity of the user authorized via OAuth."

With that, it works now. Thank you Niklasf!

This topic has been archived and can no longer be replied to.