Hi,
I am trying to run following API request but keep getting 'Invalid Request'
curl -i -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"host.create","params": {"host":"test_apihost","interfaces":[{"type":1,"main":1,"useip":1,"ip":"192.168.0.1","d ns":"domain.ru","port":"10050"}],"groups":[{"groupid":"5"}],"templates":[{"templateid":"10130"}],},"auth":"11955c178d18779be5241d61b8dc1a6c","id": 1}' http://<ip>/zabbix/api_jsonrpc.php
HTTP/1.1 200 OK
Date: Thu, 21 Jan 2016 20:35:17 GMT
Server: Apache/2.4.6 (CentOS) PHP/5.4.16
X-Powered-By: PHP/5.4.16
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 1000
Content-Length: 124
Content-Type: application/json
{"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid Request.","data":"JSON-rpc version is not specified."},"id":null}
Any idea why I keep getting this error even though JSON-rpc verison is defined.
thanks
I am trying to run following API request but keep getting 'Invalid Request'
curl -i -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"host.create","params": {"host":"test_apihost","interfaces":[{"type":1,"main":1,"useip":1,"ip":"192.168.0.1","d ns":"domain.ru","port":"10050"}],"groups":[{"groupid":"5"}],"templates":[{"templateid":"10130"}],},"auth":"11955c178d18779be5241d61b8dc1a6c","id": 1}' http://<ip>/zabbix/api_jsonrpc.php
HTTP/1.1 200 OK
Date: Thu, 21 Jan 2016 20:35:17 GMT
Server: Apache/2.4.6 (CentOS) PHP/5.4.16
X-Powered-By: PHP/5.4.16
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 1000
Content-Length: 124
Content-Type: application/json
{"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid Request.","data":"JSON-rpc version is not specified."},"id":null}
Any idea why I keep getting this error even though JSON-rpc verison is defined.
thanks
Comment