send json like this to the api :
{"jsonrpc":"2.0","method":"host.create","params":{"host":"Linux server","interfaces":[{"type":1,"main":1,"useip":1,"ip":"192.168.3.1","dns":"","port":"10050"}],"groups": [{"groupid":"50"}],},"auth":"4b8dce2153bbba6e5e9988a2a4d729ac","id":1}
that errors out :
{"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid Request.","data":"JSON-rpc version is not specified."},"id":null}
that's wrong - jsonrpc parameter is specified, and the real problem is the extra comma in "params": ...[{"groupid":"50"}],}
- duplicates
-
ZBX-11244 json parsing fails with "Invalid JSON"
- Closed