doc/pages/02.administer/60.extend/30.api/admin_api.md
2024-03-01 23:14:44 +01:00

2 KiB

title template taxonomy routes
Administration from the API or an external application docs
category
docs
default
/admin_api

All command line actions can also be ran from the web API. The API is available at https://your.server/yunohost/api.

Test with curl

You must first retrieve a login cookie thanks to the /login route to perform the other actions.

# Login (with admin password)
curl -k -H "X-Requested-With: customscript" \
        -d "credentials=supersecretpassword" \
        -dump-header headers \
        https://your.server/yunohost/api/login

# GET example
curl -k -i -H "Accept: application/json" \
           -H "Content-Type: application/json" \
           -H 'Cookie: yunohost.admin="XXXXXXXX"' \
           -L -b headers -X GET https://your.server/yunohost/api/ROUTE \
        | grep } | python -mjson.tool

Test with our swagger doc

  1. Login on the Webadmin of demo.yunohost.org
  2. Use the Try it out button on the API endpoint you want to test