API response: {"errors":{"vmid":"property is missing and it is not optional"},"data":null}

Mick Vazovsky

New Member
Feb 10, 2021
9
0
1
43
This request to url (https://10.40.100.95:8006/api2/json/nodes/pve01/qemu) returns an error {"errors":{"vmid":"property is missing and it is not optional"},"data":null},
request for url (https://10.40.100.95:8006/api2/json/nodes), returned an array, what's wrong? in the documentation like everything is correct?

Code:
  var clients = new RestClient("https://10.40.100.95:8006/api2/json/nodes/pve01/qemu");
  clients.Timeout = 10000;
  var requests = new RestRequest(Method.POST);
  requests.AddHeader("Authorization", "PVEAPIToken=test@pve!ddf5959760540181d171d2e2a7adcba4=ad78e07e-a418-41a1-a201-3528154737f2");
  IRestResponse responses = clients.Execute(requests);
  var setting = new JsonSerializerSettings
       {
            NullValueHandling = NullValueHandling.Include
        };
  dynamic stuffs = JsonConvert.DeserializeObject(responses.Content, setting);
  Console.WriteLine(responses.Content.ToString());

{"errors":{"vmid":"property is missing and it is not optional"},"data":null}
 
Last edited:
Hey,

you're right, vmid is optional, but only for GET requests, you're doing POST and there it is required. In the docs(right under the path) there is a tab for GET and one for POST.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!