HTTP/REST API Setup

Started by Carl Green, January 31, 2021, 01:31:51 PM

Previous topic - Next topic

Carl Green

Hi

I have Windows installation of NetXMS v3.6.300 and would like to try REST API but when I run the following example curl command from https://wiki.netxms.org/wiki/Web_service_API it comes back with the following message:



The normal web interface is working fine.

Is there a guide on setting up REST API on Windows Version?

Thanks

Carl


Carl Green

Thanks that helped, I also upgraded to v3.7.144 at the same time, if I hit following in a web browser:
http://netxms:8080/webapi/

I see:
{"description":"NetXMS web service API version 3.7.130","version":"3.7.130","build":"3.7-130-gc909bacd30"}

However if I try to use the curl command I got from the netxms page here: https://wiki.netxms.org/wiki/Web_service_API
nothing is returned.

curl -X POST --data '{"login":"admin","password":"xxxx"}' "http://netxms:8080/webapi"

Have you got any examples of correct command?

I am hoping to run a command that will return devices to get their status, ie: UP or DOWN


Carl Green

After some trial and error got some json output from this command:

curl -k -u admin http://netxms:8080/webapi/alarms -X GET -d '{"alarm":"outstanding"}'

It is returning all alarms regardless of whether they are NORMAL, WARNING, CRITICAL but its a start.