Install apps using the API?
-
Hello Cloudron Team and Users!
I have had a look at https://docs.cloudron.io/api.html
I read that "All of the functionality in the Cloudron Dashboard is available through the API".
But I could not find how to install an app?
I looked at https://www.npmjs.com/package/cloudron and https://blog.cloudron.io/using-the-cloudron-cli-tool-part-1/ and could find the install command.
But I don't want to use the CLI, I want to use the API, to be able to programmatically install new apps.
Is this available?
Thanks!
-
-
@livingstonlarus A couple of things:
- The CLI tool has to be installed on your PC/Desktop/Mac .
- The CLI tool is really targeting app packagers and is (currently atleast) optimized for building custom apps and not meant as a general CLI tool.
It's possible to install apps though and change some configuration (but this is only because it's part of app packaging lifecycle). See https://docs.cloudron.io/packaging/tutorial/
-
@girish got it, thank you! But this question was not about the CLI but about the API.
@robi thanks! But I don't see where this thread helps with installing apps using the API?
I found something in this other post:
https://forum.cloudron.io/topic/9052/call-to-api-app-install-failing
and I could do this:
curl -kX POST -H "Content-Type: application/json" https://$CLOUDRON_DOMAIN/api/v1/apps/install?access_token=$CLOUDRON_TOKEN -d '{"appStoreId": "org.wordpress.cloudronapp","subdomain": "blog","domain": "$TARGET_DOMAIN","accessRestriction": {"users":[],"groups":[]}}'
It works.
But why I don't find all endpoints, like apps/install at https://docs.cloudron.io/api.html ? Is it not documented?
-
@livingstonlarus The API and API Doc is currently getting an overhaul, so sadly it is not complete.
You can always finde more here: https://git.cloudron.io/cloudron/docs/-/blob/master/api/cloudron_api_swagger.yaml?ref_type=heads
Also everything the Cloudron Frontend (Dashboard) does it also API calls.
So you can grab an API call from the browsers network inspector and even copy full CURL examples.
I posted about this multiple times already, maybe we should add this to the doc. . . -
Ok got it, thanks @BrutalBirdie ! No problem with doc being overhauled, I understand it's a WIP; just wanted to make sure it's not me that can't properly RTFM
-
-