Question
"Can't authenticate you" error when trying to run a DigitalOcean API command
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 MYDROPLETID, taken from my cloud.digitalocean.com/droplets
.
Note I used MYAPITOKEN (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.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×