Skip to main content

Calling APIs

This was an example of a call requested from the LSIO discord to add a tag on completion of a torrent. This is a working example of authenticating to the API and then calling it to add the "done" tag.

curl -i -XPOST http://localhost:8080/api/v2/torrents/addTags \
  --data 'hashes=%I&tags=done' \
  --cookie \
    $(curl -i \
        --header 'Referer: http://localhost:8080' \
        --data 'username=admin&password=<YOURPASSWORDHERE>' \
        http://localhost:8080/api/v2/auth/login | grep set-cookie | tr ";" " " | awk '{print $2}')