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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login