Can I get my root password through the Digital Ocean API instead of email?

May 18, 2014 3.4k views
I'd like to create, manage and delete droplets - all from my Java app and without human intervention. Seems possible except for the step requiring the root access: is there a way to get the credentials programmatically, not by email?
3 Answers
You can setup ssh keys in your droplets. No email will be sent to you with root password and can login with the key password.
Windows:
https://www.digitalocean.com/community/articles/how-to-use-ssh-keys-with-putty-on-digitalocean-droplets-windows-users

Linux:
https://www.digitalocean.com/community/articles/how-to-use-ssh-keys-with-digitalocean-droplets
by Etel Sverdlov
This guide is for Mac OS X and Linux users. Learn how to use SSH Keys with DigitalOcean Droplets.
Please add in your API this option - email

Sample:

New Droplet
GET https://api.digitalocean.com/v1/droplets/new?client_id=[client_id]&api_key=[api_key]&name=[droplet_name]&size_id=[size_id]&image_id=[image_id]&region_id=[region_id]&email=[my_email]

my_email - email address

On email send root password



This very good!
Have another answer? Share your knowledge.