this post was submitted on 13 Jul 2023
7 points (100.0% liked)

Lemmy App Development

788 readers
1 users here now

A place for Lemmy builders to chat about building apps, clients, tools and bots for the Lemmy platform.

On-Topic:

Off-Topic:

founded 2 years ago
MODERATORS
 

I've read through the docs, but it doesn't tell me how to get a token. This should be obvious, I know... Sorry...

top 1 comments
sorted by: hot top controversial new old
[–] RoundSparrow@lemmy.ml 5 points 2 years ago* (last edited 2 years ago)

The API uses the same system as the normal lemmy-ui website login. There is a login API call where you get a JWT token that is used with the auth parameter on other API calls (such as creating a comment or post that requires login).

JavaScript example:

    http://lemmy.world/api/v3/user/login

    jsonBody= JSON.stringify( {
        username_or_email: "username",
        password: "secretpassword"
        } );

Also found this bash shell script example: https://lemmy.ml/post/1829749

load more comments
view more: next ›