Linking two objects together via API
-
Hello!
I alredy have an API that will create a new object for a client within I-DoIt, however I would like to expand is so that the new client is assigned to a contact.
I have played around with with cmdb.category.create method, but keep getting the error:
"message=Invalid parameters: Object id invalid. ID must be positive and higher than two"
As a test I try to update a category with the cmdb.category.save method and get the same message. I am using Powershell to do this, my code so far is:
$parameter = @{ "category" = "C__CATS__PERSON_CONTACT_ASSIGNMENT" "apikey" = $APIKey "language" = "en" "object" = 9217 "data" = @{ "objID" = 14131 "description" = "Computer" } } $Commands = @{ "jsonrpc" = "2.0" "method" = "cmdb.category.create" "params" = $parameter "id" = 1 } Invoke-RestMethod -uri xxxxxxxx -ContentType application/json -Method Post -Body ($Commands | ConvertTo-Json ) -Headers @{ Authorization = $Auth}
I know I am missing something, but can't find anything in the documentation to help me further
-
Hello @SHQuinn4Com,
short and painless
cmdb.category.save = Key -> object
cmdb.category.create = Key -> objID