This post is very old, but it's what came up when I googled it, so for anyone else, here's some basic scripts for logging in and then using the authentication to get something that may help you get started in exploring the API.
this post was submitted on 28 Nov 2021
14 points (100.0% liked)
Lemmy
12524 readers
1 users here now
Everything about Lemmy; bugs, gripes, praises, and advocacy.
For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.
founded 5 years ago
MODERATORS
This is just what I was looking for! Thank you ๐
The HTTP docs are what you want: https://join-lemmy.org/api/classes/LemmyHttp.html#getPost
It tells you the full input and output types, and if you click the defined in link, it shows you the endpoint you can use for curl.
Example from above:
return this.wrapper(HttpType.Get, '/post', form);
We do it this way because the lemmy-js-client exactly matches what you need to build a client, and is completely auto-generated. Before we used to manually maintain other API docs, and it was a huge hassle to keep them updated.