Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on lemmy.world
support·Lemmy.world Supportbybennysp

How to curl the API?

Hi all,

I am trying to create a simple RSS-to-post bot. I am using IFTTT to do this. Anyways, I have had only mild success with the existing documentation and I am hoping you can help.

I am able to successfully login via Postman app with below URL and supplied JSON:

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

{
    "username_or_email": "bennysp",
    "password": "[REDACTED]",
    "totp_2fa_token": "[REDACTED]"
}

The problem is that I cannot find api documentation that seems to match curl/url responses using the auth token. I have stumbled my way through finding things like community and supplying an id via param, but I am simply guessing.

Example: (assumes you have jq installed)
curl -k -X GET https://lemmy.world/api/v3/community?id=23677 | jq .

I have done something like this on Mastodon pretty easily because I can get a token and just pass that as a header to the Webhook/curl.

Any help is appreciated.

View original on lemmy.world
6

2 replies

endlesstalk.org

There's a post on ![email protected] called "Basic Lemmy API "get unread replies" script" which uses the jwt for a endpoint that requires it.

Authentication is optional for get_community, but if you want to include it, you'd just put an '&' between 'jwt=' and 'id='

3

You reached the end

How to curl the API? | Spyke