Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login
    1. Home
    2. SHQuinn4Com
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 4
    • Groups 0

    SHQuinn4Com

    @SHQuinn4Com

    0
    Reputation
    5
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    SHQuinn4Com Unfollow Follow

    Latest posts made by SHQuinn4Com

    • Client mit Kontakt mit API zu verbinden

      Hallo!

      ich habe schon ein API, dass neue Clients bei I-DoIt erstellt, aber ich möchte es so erweitern, dass es den Client mit einem Kontakt verknüpft.

      Ich habe schon die Methode cmdb.category.create ausprobiert, aber ich bekomme immer wieder die untere Fehlermeldung:

      "message=Invalid parameters: Object id invalid. ID must be positive and higher than two"

      Als Test habe ich auch verscuht, ein Catergory Eintrag mit der Methode cmdb.category.save zu ändern, und bekomme die gleiche Meldung. Ich nutze Powershell, unter ist was ich bis jetzt geschrieben habe:

      $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}
      
      

      Ich weiß, dass ich etwas verpasst habe, aber nachdem ich die Dokus gelesen habe, komme ich nicht weiter

      Danke!

      posted in Entwicklung
      S
      SHQuinn4Com
    • 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

      posted in Development
      S
      SHQuinn4Com
    • Das Erstellen von Clients per API

      Hallo zusammen,

      Ich bin relativ neu in i-doit und versuche, ein Powershell-Skript zu machen, das neu installierte Windows-Systeme automatisch in i-doit erstellt. Für den Teil der Übertragung des neuen Computers in i-doit habe ich das Folgende geschrieben:

      $Body = ConvertTo-Json @{
      jsonrpc = "2.0";
      method = "cmdb.category.save";
      params = @{
      apikey="our_api_key";
      Object=10872;
      category="C__CATG__MODEL";
      data = @{
      serial = "123wer123"
      }
      }
      id="1"
      }

      $Auth = "My_logon_Info"

      Invoke-RestMethod -uri http://Our.idoit.domain//src/jsonrpc.php -ContentType application/json -Method Post -Body $Body -Headers @{ Authorization = $Auth}

      Aber, ich bekomme immer wieder die untere Fehlermeldung:

      "message=i-doit system error: (object) ObjectId needs to be a integer value which references an existing object"

      Ich bin mir 100% sicher, dass das Objekt ID richtig ist, trotzdem funktioniert das Skript. Ich wäre seht dankbar, wann einer von euch das anschauen könnte.

      Danke!

      posted in Betrieb
      S
      SHQuinn4Com
    • Creating Clients via API

      Hello everyone,

      I am relatively new to i-doit and am trying to create a powershell script that will automatically enter newly installed Windows systems into i-doit in an effort to reduce human error. For the part of entering the new computer into i-doit I have written the below:

      $Body = ConvertTo-Json @{
      jsonrpc = "2.0";
      method = "cmdb.category.save";
      params = @{
      apikey="our_api_key";
      Object=10872;
      category="C__CATG__MODEL";
      data = @{
      serial = "123wer123"
      }
      }
      id="1"
      }

      $Auth = "My_logon_Info"

      Invoke-RestMethod -uri http://Our.idoit.domain//src/jsonrpc.php -ContentType application/json -Method Post -Body $Body -Headers @{ Authorization = $Auth}

      However I keep getting the response that:

      "message=i-doit system error: (object) ObjectId needs to be a integer value which references an existing object"

      I am 100% sure that the object ID is correct, I also tried the ID number in both "" and without. Any ideas what the problem is?

      Thanks!

      posted in Operating
      S
      SHQuinn4Com