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. pushdata webapi

pushdata webapi

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 23.5k 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.
  • S
    S
    samuelet
    wrote on last edited by
    #1

    Hi,
    How can i use curl to push dci data on remote netxms host?
    From changelog i see push dci via webapi feature is already implemented (even if it's not documented), but i always get 404 Not Found -> error 46
    I also put debug to 6, but i get no log about webapi.

    This is an example:

    /usr/bin/curl -u admin:XXXXXX -H "Accept: application/json" -H "Content-Type:application/json" --data '{"login":"admin", "password":"XXXXX","data": {"node",1234,"OK" }}' -v "http://x.x.x.x:8080/webapi/pushData" 

    > User-Agent: curl/7.64.0
    > Accept: application/json
    > Content-Type:application/json
    > Content-Length: 41
    >
    * upload completely sent off: 41 out of 41 bytes
    < HTTP/1.1 404 Not Found
    < Content-Type: application/json;charset=utf-8
    < Date: Fri, 26 Aug 2022 10:25:21 GMT
    < Accept-Ranges:  none
    < Server: Restlet-Framework/2.4.3
    < Content-Length: 43
    <
    * Connection #0 to host X.X.X.X left intact
    {"description":"Internal error","error":46}

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      There are two options - to send value for a single DCI or for a number of DCIs (array is used in this case);

      One value:

      {
            nodeId : 10,
            dciId : 20,
            value : "Value"
      }
      

      Or, alternatively node name and DCI name (parameter name) can be used:

      {
            nodeName : "Node name",
            dciName : "DCI name",
            value : "Value"
      }
      

      When sending multiple values:

      data :
      [
         {
            nodeId : 10,
            dciId : 20,
            value : "Value"
         },
         {
            nodeName : "Node name",
            dciName : "DCI name",
            value : "Value"
         }
      ]
      
      1 Reply Last reply
      0
      • S
        S
        samuelet
        wrote on last edited by
        #3

        Thanks, it's now clear how to send value but unfortunately i still cannot authenticate the POST with the netxms api.
        I also tried with the sessesionhandler cookie as explained here:
        https://wiki.netxms.org/wiki/Web_service_API
        In my case, i've no proxy in front of it, and with the jetty requestlog i don't see any error except "internal error" .
        I'm authenticating with the "admin" user (full rights).
        Is there something that i missing to enable?

        1 Reply Last reply
        0
        • S
          S
          samuelet
          wrote on last edited by
          #4

          i found that i was using a wrong api url (retrived from github): /push-data and not /pushData
          Now it works.

          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