this post was submitted on 28 Nov 2021
22 points (100.0% liked)

Lemmy

12690 readers
53 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to [email protected].

founded 4 years ago
MODERATORS
 

The API docs on join-lemmy.org are actually JavaScript SDK docs, not API docs. I want to build an API client in a different language, not write a JavaScript thing using the SDK, and would prefer not to plumb the JS SDK code to understand the API.

Is there somewhere that has a language-agnostic description of Lemmy's APIs?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 3 years ago

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.