Question
How to use the Comet-Hosted server API?
Answer
Version 26.8.3 and later support creating API tokens with the same permissions as the administrator that created them. The feature will be available on Comet-Hosted in 26.10.0.
For earlier versions:
Comet-Hosted servers have a default admin account that can be used for API calls to the server.
On the My Services page, open the Actions menu > Login Details to reveal your Comet-Hosted server's default credentials for the service admin account.
The password can be changed from the default by logging into your server with the credentials, and reset the password in the top-right admin menu. The Login Details dialog will not be updated with the new password.
Enabling 2FA on the admin account will prevent the use of the API.
To add 2FA to the default admin account (separate from the two-factor authentication of the Comet Account Portal at account.cometbackup.com), open the URL of your Comet-Hosted server and log in with the default credentials, click the dropdown arrow in the top-right admin menu, and go to Advanced Options to enable 2FA for that account.
Additional admins for API and general access can also be created from the server settings, on the Additional Users tab.
The admin credentials can then be used in API requests in the same way as a self-hosted instance. For example, using the address above:
# curl -X POST -d 'Username=<admin user>&AuthType=Password&Password=<password>' 'https://<server address>/api/v1/admin/list-users'
More examples are available in Comet API Guide.
Comments
Please sign in to leave a comment.