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

    API Abfrage schlägt fehl

    Scheduled Pinned Locked Moved Betrieb
    2 Posts 2 Posters 269 Views 2 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.
    • N Offline
      NiklasTE
      last edited by

      Hallo, wir möchten gerne per API einen Export aller Systeme und deren Beschreibung vornehmen, leider kriege ich aber schon bei den ersten Tests keine Verbindung mit der API hergestellt.

      Um die API zu testen habe ich versucht einen bestimmten Server abzufragen:

      Bei folgendem Befehl:
      curl.exe --data '{"version":"2.0","method":"idoit.search","params":{"q":"servername","apikey":"xxx","language":"en"},"id":1}' --header "Content-Type:application/json"
      https://xxx.local/src/jsonrpc.php

      Erscheint folgender Error:
      {"id":null,"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid request : Provided request is not a valid json rpc.","data":null}

      Woran kann dies liegen? Ich habe schon versucht die Formatierung mit Leerzeichen vor den Attributen umzustellen und auch schon im Forum gesucht, leider alles ohne Erfolg.

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

        Hallo @NiklasTE,

        versuch es mal mit dem hier. Scheint auf windows ohne Powershell nicht so einfach zu sein 😆

        curl  -u admin:admin -i --data "{\"version\": \"2.0\",\"method\": \"cmdb.objects.read\",\"params\": {\"filter\": {\"type\": \"C__OBJTYPE__SERVER\",\"status\": \"C__RECORD_STATUS__NORMAL\"},\"categories\": [\"C__CATG__GLOBAL\"],\"limit\": \"0,10\",\"order_by\": \"title\",\"sort\": \"ASC\",\"apikey\": \"c1ia5q\",\"language\": \"en\"},\"id\": 1}" --header "Content-Type: application/json; charset=UTF-8" https://demo.i-doit.com/src/jsonrpc.php
        
        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