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

    Gruppenmitgliedschaften per api löschen

    Scheduled Pinned Locked Moved Entwicklung
    3 Posts 2 Posters 366 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.
    • Lutz HaseloffL Offline
      Lutz Haseloff
      last edited by

      Hallo zusammen,

      ich versuche, die Gruppenmitgliedschaften per api zu automatisieren.
      Das Erstellen einer neuen Gruppenmitgliedschaft funktioniert sehr gut mit:

      {
      "method":"cmdb.category.save",
      "jsonrpc":"2.0",
      "id":$id,
      "params":{
      "apikey":"$apikey",
      "object":"$userid",
      "category":"C__CATS__PERSON_ASSIGNED_GROUPS",
      "data":{"connected_object":"$groupid"}
      }
      }

      Wenn ich aber die Gruppenmitgliedschaft laut Doku mit:

      {
      "method":"cmdb.category.delete",
      "jsonrpc":"2.0",
      "id":$id,
      "params":{
      "apikey":"$apikey",
      "objID":"$userid",
      "category":"C__CATS__PERSON_ASSIGNED_GROUPS",
      "cateID":"$cateid"}
      }

      ($cateid ist der "entry", der mir beim Erzeugen der Gruppenmitgliedschaft zurückgegeben wird)

      wieder löschen möchte, bekomme ich eine Fehlermeldung:

      {"id":2,"jsonrpc":"2.0","error":{"code":-32099,"message":"i-doit system error: ObjectId has to be a positive numeric value.","data":null}}

      Was mache ich falsch?

      Vielen Dank im Voraus

      Lutz

      P.S. api.validation = 0 hat nicht geholfen

      1 Reply Last reply Reply Quote 0
      • F Offline
        franknagel
        last edited by

        Hallo,

        bitte einmal genau auf das erzeugte JSON schauen: objID muss dort den Typ int haben, nicht string. i-doit macht an dieser Stelle keine automatische Konvertierung mehr sondern wirft eine Exception.

        Lutz HaseloffL 1 Reply Last reply Reply Quote 0
        • Lutz HaseloffL Offline
          Lutz Haseloff @franknagel
          last edited by

          @franknagel Genau das war es, vielen Dank!

          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