Client settings
Configuration
Timeouts, proxies, regions and per-request configuration.
Everything on this page is set on the client and applies to every call made through it.
Timeouts#
Defaults are generous enough for interactive calls but not for large imports or exports. Raise the read timeout before moving large files.
ac.SetConnectionTimeout(10) // seconds
ac.SetReadTimeout(60)Proxy#
ac.SetProxy("proxy.example.com", 8443, "proxyUser", "proxyPassword")Region#
ac.SetAnalyticsServerURL("https://analyticsapi.zoho.eu")
ac.SetAccountsServerURL("https://accounts.zoho.eu")See Authentication for the full host table.
Request configuration#
Most methods take a final config value carrying optional parameters for that endpoint — filter criteria, output format, pagination and so on.
// Config maps are plain map[string]interface{} values.
config := map[string]interface{}{
"viewTypes": []string{"0", "1"},
}
views, exception := workspace.GetViews(config)Supplying an access token directly#
ac.SetAccessToken("1000.xxxxxxx.xxxxxxx")Go notes#
- Results come back as
interface{}; type-assert tomap[string]interface{}or[]interface{}before reading fields. ErrorCodeis afloat64because it is decoded from JSON; cast withint(...)to compare.
Related#
- Authentication — credentials and the token throttle.
- Errors — what a failure looks like.