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

    API cmdb.object.create categories

    Scheduled Pinned Locked Moved Entwicklung
    1 Posts 1 Posters 100 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.
    • L Offline
      leobaer
      last edited by

      Hallo,

      laut Doku kann man bei cmdb.object.create auch gleich Attribute in Kategorien schreiben, was einige API Aufrufe erspart:

      categories
      Object with Array
      Category constant, for example: "C__CATG__MODEL" with keys in a array

      Nach etwas rumprobieren habe ich folgende Möglichkeit gefunden mit der ich Daten schreiben kann:

      {
          "version": "2.0",
          "method": "cmdb.object.create",
          "params": {
              "apikey": "*****",
              "language": "en",
              "type": "C__NEUER_OBJEKTTYP_ZZ_ALLE_KATEGORIEN",
              "title": "test_2025-11-20-05",
              "categories" : {
                "C__CATG__CUSTOM_FIELDS_NETZ_INFO" : [
                  {"f_text_nautobot_name" : "asdf"},
                  {"f_text_nautobot_id" : "12335"}
                ]
              }
          },
          "id": 1
      }
      

      Kann jemand bestätigen, dass dieses Format richtig ist?
      Wenn ja, wäre es sinnvoll, die API Dokumentation um so ein Beispiel zu erweitern und evtl. das "keys in array" besser zu formulieren. Es gibt ja mehrere Möglichkeiten dies zu implementieren.

      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