Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login

    Das Erstellen von Clients per API

    Scheduled Pinned Locked Moved Betrieb
    2 Posts 2 Posters 426 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      SHQuinn4Com
      last edited by

      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!

      LFischerL 1 Reply Last reply Reply Quote 0
      • LFischerL Offline
        LFischer @SHQuinn4Com
        last edited by

        Hallo @shquinn4com

        könntest du einmal den $Body in seiner reinen JSON-Form posten? Ich könnte mir nur vorstellen das es ggf. Probleme aufgrund der Schreibweise gibt - du hast Object groß geschrieben.
        Alternativ könntest du es mit der Schreibweise objID probieren.

        Viele Grüße
        Leo

        1 Reply Last reply Reply Quote 0

        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
        • First post
          Last post