DocsReferenceAnalyticsClient

Reference

AnalyticsClient

The entry point. 15 methods.

ruby
require 'zoho_analytics_client'

ac = AnalyticsClient.new
       .with_data_center("US")
       .with_oauth({
         "clientId"     => "1000.xxxxxxx",
         "clientSecret" => "xxxxxxx",
         "refreshToken" => "1000.xxxxxxx.xxxxxxx"
       })
       .build

AnalyticsClient exposes 15 methods. Method names are snake_case and identifiers are string.

Methods#

get_accounts_server_url, get_analytics_server_url, get_bulk_instance, get_org_instance, get_view_instance, get_workspace_instance, new, set_access_token, set_accounts_server_url, set_analytics_server_url, with_access_token, with_data_center, with_oauth, with_proxy, with_token_store_path

get_accounts_server_url#

ruby
get_accounts_server_url()

Gets the current accounts server URL

Returns (String) — The current accounts server URL

get_analytics_server_url#

ruby
get_analytics_server_url()

Gets the current analytics server URL

Returns (String) — The current analytics server URL

get_bulk_instance#

ruby
get_bulk_instance(org_id, workspace_id)

Returns a new BulkAPI instance.

ParameterTypeDescription
org_idStringThe id of the organization.
workspace_idStringThe id of the workspace.

Returns (BulkAPI) — Bulk API instance

get_org_instance#

ruby
get_org_instance(org_id)

Returns a new OrgAPI instance.

ParameterTypeDescription
org_idStringThe id of the organization.

Returns (OrgAPI) — Organization API instance

get_view_instance#

ruby
get_view_instance(org_id, workspace_id, view_id)

Returns a new ViewAPI instance.

ParameterTypeDescription
org_idStringThe id of the organization.
workspace_idStringThe id of the workspace.
view_idStringThe id of the view.

Returns (ViewAPI) — View API instance

get_workspace_instance#

ruby
get_workspace_instance(org_id, workspace_id)

Returns a new WorkspaceAPI instance.

ParameterTypeDescription
org_idStringThe id of the organization.
workspace_idStringThe id of the workspace.

Returns (WorkspaceAPI) — Workspace API instance

new#

ruby
new()

set_access_token#

ruby
set_access_token(token)

========== TOKEN HANDLING LOGIC ========== Sets the access token directly on the AnalyticsClient instance, bypassing the need for OAuth token refresh or regeneration.

set_accounts_server_url#

ruby
set_accounts_server_url(url)

Sets the accounts server URL

ParameterTypeDescription
urlStringThe accounts server URL

Returns (String) — The updated accounts server URL

set_analytics_server_url#

ruby
set_analytics_server_url(url)

Sets the analytics server URL

ParameterTypeDescription
urlStringThe analytics server URL

Returns (String) — The updated analytics server URL

with_access_token#

ruby
with_access_token(token)

Sets a direct access token on the client, bypassing OAuth. Using this token disables automatic token refresh logic.

ParameterTypeDescription
tokenStringThe direct access token string

Returns (Builder) — Returns self for method chaining

with_data_center#

ruby
with_data_center(dc)

Sets the Zoho Analytics data center for this client.

ParameterTypeDescription
dcStringData center code, mandatory (e.g., "US", "EU")

Returns (Builder) — Returns self for method chaining

with_oauth#

ruby
with_oauth(oauth_hash)

Sets the OAuth credentials hash for authentication.

ParameterTypeDescription
oauth_hashHashOAuth credentials with keys:

Returns (Builder) — Returns self for method chaining

with_proxy#

ruby
with_proxy(proxy_details)

Sets the proxy configuration details.

ParameterTypeDescription
proxy_detailsHashProxy settings with keys:

Returns (Builder) — Returns self for method chaining

with_token_store_path#

ruby
with_token_store_path(path)

Sets the path for encrypted token storage. Raises an error if the directory does not exist.

ParameterTypeDescription
pathStringFilesystem directory to store encrypted tokens

Returns (Builder) — Returns self for method chaining

  • Errors — the failure envelope and codes worth branching on.
  • Limits — throttles and quotas that apply to these calls.
Zoho Analytics Ruby SDK · REST API v2 Generated 2026-10-27