I’m getting a 422 Unprocessable Entity when trying to create a droplet via postman.
First, a GET to https://api.digitalocean.com/v2/images gives me a list of droplet images. Let’s say I want to base my droplet on this one…
{
"id": 13764801,
"name": "Elixir on 14.04",
"distribution": "Ubuntu",
"slug": null,
"public": true,
"regions": [
"nyc1",
"sfo1",
"nyc2",
"ams2",
"sgp1",
"lon1",
"nyc3",
"ams3",
"fra1",
"tor1",
"sfo2",
"blr1"
],
"created_at": "2015-09-30T15:42:07Z",
"min_disk_size": 30,
"type": "snapshot",
"size_gigabytes": 1.85
},
So I POST to https://api.digitalocean.com/v2/droplets with this request body:
{
"name" : "512-auto",
"region" : "lon1",
"size" : "512mb",
"image" : "Elixir on 14.04",
"ssh_keys" : ["a9:a2:b4:d2:4f:79:32:22:9d:e3:68:72:11:11:aa:aa"]
}
I get a 422 error… How do I make this work?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @adam95c2fc3ac28a1681a23714
The image needs to be either a number (if using an image id), or String (if using a public image slug), so since the image you’re listing doesn’t have a slug I would think you need to use the id:
{
"name" : "512-auto",
"region" : "lon1",
"size" : "512mb",
"image" : 13764801,
"ssh_keys" : ["a9:a2:b4:d2:4f:79:32:22:9d:e3:68:72:11:11:aa:aa"]
}
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.