Hi,
I'm trying to use the API to put together a small report, but I have my doubts in myself using it efficiently. I'd like to retrieve some item information for all hosts using template X.
So first I use the API template.get to retrieve all hosts connected to template X. Then I loop through the hosts one by one to retrieve the item information using item.get. That's an API request for each item for each host. So for 10 hosts with 5 items each, that's 50 requests. Wouldn't it be more efficient to request all 5 items per host in a single request? If so, how do I accomplish that?
TIA,
Wouter
I'm trying to use the API to put together a small report, but I have my doubts in myself using it efficiently. I'd like to retrieve some item information for all hosts using template X.
So first I use the API template.get to retrieve all hosts connected to template X. Then I loop through the hosts one by one to retrieve the item information using item.get. That's an API request for each item for each host. So for 10 hosts with 5 items each, that's 50 requests. Wouldn't it be more efficient to request all 5 items per host in a single request? If so, how do I accomplish that?
TIA,
Wouter
Comment