CaspianXI@lemmy.world to Lemmy App Development @lemm.ee · 1 year agoHow to I get an API token for lemmy.world?message-squaremessage-square1fedilinkarrow-up17arrow-down10file-text
arrow-up17arrow-down1message-squareHow to I get an API token for lemmy.world?CaspianXI@lemmy.world to Lemmy App Development @lemm.ee · 1 year agomessage-square1fedilinkfile-text
I’ve read through the docs, but it doesn’t tell me how to get a token. This should be obvious, I know… Sorry…
minus-squareRoundSparrowlinkfedilinkarrow-up6arrow-down1·edit-21 year agoThe 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
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