NetXMS Support Forum

English Support => General Support => Topic started by: MarcusH on October 28, 2022, 10:11:48 AM

Title: Push values to DCI with API
Post by: MarcusH on October 28, 2022, 10:11:48 AM
Hi,

Is functionality to push values to push DCI implemented in current API 4.2.395?
Title: Re: Push values to DCI with API
Post by: Filipp Sudanov on October 28, 2022, 06:22:07 PM
The request should be:

Request type: POST
Request path: API_HOME/pushData

It's possible to use one of two data formats:

1) If you need to send just one DCI:

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


2) If you are sending data for multiple DCIs

data :
[
  {
      nodeId : 10,
      dciId : 20,
      value : "Value"
  },
  {
      nodeName : "Node name",
      dciName : "DCI name",
      value : "Value"
  }
]


You can use both names and IDs of objects and DCIs.

If both name and ID are set, ID has priority
Title: Re: Push values to DCI with API
Post by: MarcusH on October 31, 2022, 10:41:37 AM
i get Internal error error 46, 404 not found when i try to access /pushData
Title: Re: Push values to DCI with API
Post by: MarcusH on October 31, 2022, 10:55:17 AM
ah it is  API_HOME/push-data
Title: Re: Push values to DCI with API
Post by: MarcusH on October 31, 2022, 11:12:07 AM
Works great now thanks, happy for ability to use name instead of id makes what i do alot easier.
Just had an issue with name until i got that name is "Metric" now on DCI
Title: Re: Push values to DCI with API
Post by: Filipp Sudanov on November 01, 2022, 12:10:28 AM
Yes, we are moving toward term "metric" in the UI (and also in NXSL at some point)