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

    Client und Contact über eine API Abfrage erstellen

    Scheduled Pinned Locked Moved Entwicklung
    3 Posts 2 Posters 637 Views 3 Watching
    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.
    • K Offline
      konstantin
      last edited by

      Hi, ich versuche im Moment viele Clients in I-DoIT zu übertragen.
      Ich würde gerne per API sowohl den Client als auch die Kontaktzuweisung erstellen.
      Bisher habe ich Probiert die Kontaktzuweisung über "C__CATG__CONTACT" zu erstellen komme da aber leider nicht weiter.

      Gibt es dafür eine schöne Lösung?

      1 Reply Last reply Reply Quote 0
      • Michael HuhnM Offline
        Michael Huhn
        last edited by

        undefined @konstantin

        es gibt dazu 2 Möglichkeiten.

        category.create

        {
            "jsonrpc": "2.0",
            "method": "cmdb.category.save",
            "params": {
                "apikey": "apikey",
                "language": "en",
                "category": "C__CATG__CONTACT",
                "object": 1122704399,
                "data": {
                    "contact": 14,
                    "role": 1
                }
            },
            "id": 1
        }
        

        object.create with categories

        {
          "id": 1,
          "version": "2.0",
          "method": "cmdb.object.create",
          "params": {
            "type": "C__OBJTYPE__SERVER",
            "title": "MyLittleServer",
            "categories": {
              "C__CATG__CONTACT": [
                {
                    "contact": 14,
                    "role": 1
                }
              ],
              "C__CATG__MODEL": [
                {
                  "serial": "1337"
                }
              ]
            },
            "apikey": "h3md6u3y",
            "language": "en"
          }
        }
        
        K 1 Reply Last reply Reply Quote 0
        • K Offline
          konstantin @Michael Huhn
          last edited by

          @Michael-Huhn

          Danke erstmal für die zwei Beispiele.
          Beide setzen aber voraus, dass der "contact" schon existiert - das ist bei mir nicht der Fall.
          Da wäre halt die Idee beides in einer Abfrage zu vereinen, ich kann mir aber gut vorstellen, dass das so nicht vorgesehen ist.

          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