AnsweredAssumed Answered

R80 API - Create multiple objects JSON

Question asked by Joshua Boreum on Jun 16, 2016
Latest reply on Jun 19, 2016 by Uri Bialik

Looking at the API for add-host. What is the proper syntax to add multiple hosts in one payload rather than just one at a time?

 

Example:

add one host

{

     "name" : "New Host 1",

     "ip-address" : "192.0.2.1"

}

 

add multiple hosts

[

   {

        "name" : "New Host 1",

        "ip-address" : "192.0.2.1"

   },

   {

        "name" : "New Host 2",

        "ip-address" : "192.0.2.2"

   }

]

The above gives the following error:

Can not deserialize instance of com.checkpoint.management.web_api.core.handler.objects.network_objects.host.HostRequestNew out of START_ARRAY token

Outcomes