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?
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.
Hi @adam95c2fc3ac28a1681a23714
The
image
needs to be either a number (if using an imageid
), or String (if using a public imageslug
), so since the image you’re listing doesn’t have aslug
I would think you need to use theid
: