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

    Is there a query API for i-doit?

    Scheduled Pinned Locked Moved General
    7 Posts 5 Posters 9.6k Views 1 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.
    • C Offline
      css1971
      last edited by

      Hi,

      is there a query API for i-doit? I couldn't see anything in the docs. Can I query the app server from other applications to pull out useful information?

      1 Reply Last reply Reply Quote 0
      • dsD Offline
        ds
        last edited by

        Yes there is. But the current API was completely renewed for the next version. Try these in Version 0.9.9-7 and below (1 is the ID of your mandator):

        All objects:
        /idoit/?ajax=1&call=json&login=admin,adminpasswordasmd5hash,1

        All objects of type 5 (server):
        /idoit/?ajax=1&call=json&objTypeID=5&login=admin,adminpasswordasmd5hash,1

        Info of object 10:
        /idoit/?ajax=1&call=json&objID=10&login=admin,adminpasswordasmd5hash,1

        Info of object 10 and global category 2:
        /idoit/?ajax=1&call=json&objID=10&catgID=2&login=admin,adminpasswordasmd5hash,1

        Info of object 10 and specific category 1
        /idoit/?ajax=1&call=json&objID=10&catsID=1&login=admin,adminpasswordasmd5hash,1

        Parameters:
        objID = ID of your object
        catgID = ID of your global category
        catsID = ID of your specific category
        login = username,md5password,mandator-id

        When your client supports session handling the login parameter is only needed for initializing the session.
        Before i forget: the http method is get and the response is JSON (application/json)

        But as i said: This API is actually deprecated in the upcoming version 0.9.9-8, but will still exist for a while.

        1 Reply Last reply Reply Quote 0
        • C Offline
          css1971
          last edited by

          Magic. exactly what I'm looking for.

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

            I'm wondering if the new API made it into 0.9.9-8?
            I can't find any documentation about it.

            1 Reply Last reply Reply Quote 0
            • T Offline
              tiagoratto
              last edited by

              @ds:

              All objects:
              /idoit/?ajax=1&call=json&login=admin,adminpasswordasmd5hash,1

              That doens't seems to work, It always returns an empty JSON structure.
              Am I doing something wrong ?

              1 Reply Last reply Reply Quote 0
              • dsD Offline
                ds
                last edited by

                This does not work anymore in version 1.0 in favor of our new JSON-RPC API. A detailed documentation of that API can be found here: http://akademie.i-doit.com/goto.php?target=file_346&client_id=idoit

                This is an example for retrieving cpu (id: 4) data for an object with id 4438, the apikey can be created in "Administration -> Interfaces / external data -> JSON-RPC APi" :

                ***** Request *****

                {"method":"cmdb.category","params":{"apikey":"192npkvfh7","objID":4438,"catgID":4},"id":1,"version":"2.0"}

                ***** End Of request *****

                ***** Server response *****

                {"result":[{"id":"255","title":null,"manufacturer":{"id":"2","title":"Intel","const":null,"title_lang":"Intel"},"type":{"id":"16","title":"CoreTM i7","const":null,"title_lang":"CoreTM i7"},"frequency":[],"frequency_unit":{"id":"3","title":"GHz","const":"C__FREQUENCY_UNIT__GHZ","title_lang":"GHz"},"cores":null,"description":null}],"error":null,"id":1}

                ***** End of server response *****

                The JSON-RPC Request payload should be sent to http://i-doit-host/src/jsonrpc.php

                This is a neat json-rpc client for php: http://jsonrpcphp.org/

                1 Reply Last reply Reply Quote 0
                • M Offline
                  manolis
                  last edited by

                  Hello,

                  I have created an acount to the i-doit academy and i tried to access the API manual (http://akademie.i-doit.com/goto.php?target=file_346&client_id=idoit), but i do not have any rights to the document.

                  Can anyone please help with the rights or provide me with the document?

                  Thanks

                  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