func NewAPI(url string) (api *API) {
	return &API{url: url, c: http.Client{}}
}
Creates new API access object.
Typical URL is http://host/api_jsonrpc.php or http://host/zabbix/api_jsonrpc.php.
It also may contain HTTP basic auth username and password like
http://username:password@host/api_jsonrpc.php.
package zabbix
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"sync/atomic"
)
type (
	Params map[string]interface{}
)
type request struct {
	Jsonrpc string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
	Auth    string      `json:"auth,omitempty"`
	Id      int32       `json:"id"`
}
type Response struct {
	Jsonrpc string      `json:"jsonrpc"`
	Error   *Error      `json:"error"`
	Result  interface{} `json:"result"`
	Id      int32       `json:"id"`
}
type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    string `json:"data"`
}
func (e *Error) Error() string {
	return fmt.Sprintf("%d (%s): %s", e.Code, e.Message, e.Data)
}
type ExpectedOneResult int
func (e *ExpectedOneResult) Error() string {
	return fmt.Sprintf("Expected exactly one result, got %d.", *e)
}
type ExpectedMore struct {
	Expected int
	Got      int
}
func (e *ExpectedMore) Error() string {
	return fmt.Sprintf("Expected %d, got %d.", e.Expected, e.Got)
}
type API struct {
	Auth   string       
	Logger *log.Logger  
	url    string
	c      http.Client
	id     int32
}