0

I tried to run this command for rebuilding my droplet:

curl -X POST "https://api.digitalocean.com/v2/droplets/MY_DROPLET_ID/actions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer MY_API_TOKEN" \
-d '{"type":"rebuild","image":"ubuntu-16-04-x64"}'

Note I used MY_DROPLET_ID, taken from my cloud.digitalocean.com/droplets. Note I used MY_API_TOKEN (read and write), taken from cloud.digitalocean.com/settings/api/tokens.

I'd like to know what's bad with my command? I might missed something aside of droplet-ID and API-token.

Arcticooling
  • 119
  • 1
  • 14

1 Answers1

0

The problem was with the API token: I might have used the wrong one or it has expired for some odd reason.

After creating a new (read-write) API token in the DigitalOcean API user interface, the operation succeeded - I've rebuild the droplet from command line.

user454858
  • 308
  • 1
  • 3
  • 5