1. Generate Personal Access Token (Api-token)
The key resembles the following format:
81d58e36224b63fc2gedac14342d0cfb16vf5451c798b2a38f976360410c4d09
2. Get Digitalocean account information
Requires Curl,bearer heel Api-token
Curl-x get-h "Content-type:application/json"-H "authorization:bearer 81d58e36224b63fc2gedac14342d0cfb16vf5451c798b2a38f976360410c4d09 "" Https://api.digitalocean.com/v2/account "
3. Create a droplet
Easy to read format
Curl-x POST- H "Content-type:application/json"- H "authorization:bearer 81d58e36224b63fc2gedac14342d0cfb16vf5451c798b2a38f976360410c4d09 " -d ' { " name ":" example.com ", " Region ":" NYC3 ", " size ":" 512MB ", " image ":" Ubuntu-14-04-x64 ", " Ssh_keys ": null, " Backups ": false, "IPv6": True, "User_data": null, "private_networking": null } ' "https:// Api.digitalocean.com/v2/droplets "
Single-line format
Curl-x post-h "Content-type:application/json"-H "authorization:bearer 81d58e36224b63fc2gedac14342d0cfb16vf5451c798b2a38f976360410c4d09 "-d ' {" name ":" example.com "," Region ":" NYC3 "," Size ":" 512MB "," image ":" Ubuntu-14-04-x64 "," Ssh_keys ": null," Backups ": false," IPv6 ": True," user_data ": null," private _networking ": null} '" Https://api.digitalocean.com/v2/droplets "
Using the API to create a VPS on Digitalocean