• Type: Incident report
    • Resolution: Won't fix
    • Priority: Major
    • None
    • Affects Version/s: None
    • Component/s: API (A)
    • Environment:
      linux

      Hi everyone,

      i am new to Zabbix.I recently started working with zabbix API. i am stuck at one point.

      i am trying to link multiple templates with one host which is created(host) using zabbix api. i don't know i am going wrong.

      Here is the jason:

      "jsonrpc":"2.0",
      "method":"host.create",
      "params":{
      "host":"srv-test-t005",
      "ip":"192.168.3.1",
      "port":10050,
      "useip":1,
      "groups":[

      { "groupid":7 }

      ],
      "templates":[

      { "templateid":10047 }

      ,

      { "templateid":10049 }

      ]
      },
      "auth":'.$res['result'].',
      "id":1
      }';

      which gives me an error: "Invalid JSON. An error occurred on the server while parsing the JSON text."

      Can you please guide me?

      Another thing i noticed that when i use php fuction json_decode() with above json the last templateid"10049 is gone in the php arrary. may be because of duplicate "templateid" entry.

            Assignee:
            Unassigned
            Reporter:
            sandeep parekh
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: