Is there a query API for i-doit?



  • 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?



  • 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.



  • Magic. exactly what I'm looking for.



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



  • @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 ?



  • 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/



  • 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


 


Datenschutz / Privacy Policy