Start a Conversation

Unsolved

14.3K Posts

547

October 29th, 2018 07:00

Rest API to create multiple resources

I opened a ticket for this, but perhaps someone already tried this before and can cut down the waiting line...

I'm in phase where I'm exploring and documenting Rest API usage... I kind of like it even though for normal human usage nsradmin is still your best friend.  Still, I can see where Rest API would be better fit, especially when integrating with other platforms without any specific parts of NW package to be available. 

One thing where I found myself stuck is handling multiple resources (if you wish to create it via POST).  Consider following body:

{

  "protectionGroups": [

    {

      "comment": "Backup group via RestAPI one",

      "name": "RestAPIb",

      "workItemType": "Client",

      "workItems": []

    },

    {

      "comment": "Backup group via RestAPI two",

      "name": "RestAPIc",

      "workItemType": "Client",

      "workItems": []

    }

  ]

}

That doesn't work for me, but error I get seems to suggest some kind of syntax error (or this simply not being supported in the first place).  I can easily create one resource or have two calls for each resource too, but would prefer if I could use single call for multiple resources when building requests for the same type of resources.

No Responses!
No Events found!

Top