Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. NetXMS REST-API

NetXMS REST-API

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 35.2k Views
  • 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.
  • M
    M
    Manuel Schneider
    wrote on last edited by
    #1

    Hi,

    I'm trying to build dynamic Dashboards in Grafana using the integrated Web-API, but unfortunately with limited success...

    First Question: Is the integrated Web-API complete with all NetXMS-API-Endpoints, or is the integrated one (enabled by including `Module = webapi` in netxmsd.conf) only a lighter version, in which case I should probably switch to the Full-API (netxms-websvc-VERSION.war)?

    Second Question: Is there a Bug in the API with user-provided query values?
    When querying the Endpoint '/v1/grafana/infinity/object-query' and providing query values, those user-provided query values are not used within object-query.
    I've modified my Object-Query to output a debug-column with a serialization of the `$INPUT`-Hashmap, when querying via the NetXMS-Client, I see my Input, but when querying via the API, there is no Input to be seen (see Example in Attachments).

    Best regards and Merry Christmas,
    Manuel


    Object-Query-ResultAPI.png

    Object-Query-ResultClient.png

    Object-Query.png

    Object-Query.txt

    1 Reply Last reply
    0
    • Z
      Z
      Tatjana Dubrovica
      wrote on last edited by
      #2

      Hi,

      NetXMS actually has two web API options available:

      1. New Web API - Enabled by adding Module = webapi to your configuration. This is the modern API that we're actively developing and expanding. While it currently has limited functionality, it includes a dedicated Grafana endpoint that's specifically designed to work well with the Grafana Infinity plugin and requires less data parsing/modification on the Grafana side.
      2. Legacy Web API - The older netxms-websvc-VERSION.war service. This has more complete functionality currently but may require more data manipulation when using with Grafana plugins.

      Since you're using the Grafana Infinity plugin, which can work with any web API, you have flexibility here. You can use either the new API, the legacy API, or even both depending on which is easier for your specific use case.
      For new integrations, I'd recommend trying the new Web API's Grafana endpoint first as it will provide the smoothest experience with the Infinity plugin. However, if you need functionality that isn't yet available in the new API, the legacy service is still a viable option.

      Question 2 (inputFields Format):

      You're right that the documentation needs correction - I apologize for the confusion. The inputFields parameter should be formatted as a JSON object with key-value pairs, not as an array.
      Correct format:

      {
         "rootObjectId": 2,
         "queryId": 1,
         "inputFields": {
             "name": "value",
              "anotherField": "anotherValue"
          }
      }
      

      The code extracts these fields as a StringMap and supports multiple data types:

      Strings (used as-is)
      Integers (converted to string representation)
      Floating-point numbers (converted to string representation)
      Booleans (converted to "true"/"false" strings)

      I'll update the documentation to reflect the correct format. Thank you for catching this issue!

      1 Reply Last reply
      0
      • M
        M
        Manuel Schneider
        wrote on last edited by
        #3

        Hi Tatjana,

        many thanks for your explanation!
        With your Info, I've got it working 🙂

        Best Wishes,
        Manuel

        1 Reply Last reply
        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
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        Powered by NodeBB Contributors
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups