BulkAPI
extends AnalyticsClient
in package
AnalyticsClient provides the PHP based language binding to the https based API of ZohoAnalytics.
Table of Contents
Constants
- CLIENT_VERSION = "2.3.0"
Properties
- $ac : mixed
- $accounts_server_url : string
- $analytics_server_url : string
- $bulk_data_end_point : mixed
- $connection_timeout : int
- $data_end_point : mixed
- $proxy : bool
- $proxy_host : string
- $proxy_password : string
- $proxy_port : int
- $proxy_type : string
- $proxy_user_name : string
- $read_timeout : int
- $req_headers : mixed
Methods
- __construct() : mixed
- Creates a new BulkAPI instance.
- exportBulkData() : mixed
- Download the exported data for the mentioned job id.
- exportData() : mixed
- Export the mentioned table (or) view data.
- getBulkInstance() : BulkAPI
- Returns a new BulkAPI instance.
- getConnectionTimeout() : int
- Returns the timeout until a connection is established.A value of zero means the timeout is not used.
- getDashboards() : array<string|int, mixed>
- Returns list of all accessible dashboards.
- getExportJobDetails() : array<string|int, mixed>
- Returns the details of the export job.
- getImportJobDetails() : array<string|int, mixed>
- Returns the details of the import job.
- getOrgInstance() : OrgAPI
- Returns a new OrgAPI instance.
- getOrgs() : array<string|int, mixed>
- Returns list of all accessible organizations.
- getOwnedDashboards() : array<string|int, mixed>
- Returns list of owned dashboards.
- getOwnedWorkspaces() : array<string|int, mixed>
- Returns list of owned workspaces.
- getReadTimeout() : int
- Returns the timeout until waiting to read data. A value of zero means the timeout is not used. The default value is 15000.
- getRecentViews() : array<string|int, mixed>
- Returns list of recently accessed views.
- getSharedDashboards() : array<string|int, mixed>
- Returns list of shared dashboards.
- getSharedWorkspaces() : array<string|int, mixed>
- Returns list of shared workspaces.
- getViewDetails() : array<string|int, mixed>
- Returns details of the specified view.
- getViewInstance() : ViewAPI
- Returns a new ViewAPI instance.
- getWorkspaceDetails() : array<string|int, mixed>
- Returns details of the specified workspace.
- getWorkspaceInstance() : WorkspaceAPI
- Returns a new WorkspaceAPI instance.
- getWorkspaces() : array<string|int, mixed>
- Returns list of all accessible workspaces.
- importBulkData() : string
- Asynchronously import the data contained in the mentioned file into the table.
- importBulkDataAsBatches() : string
- Asynchronously import the data contained in the mentioned file into the table.
- importBulkDataInNewTable() : string
- Asynchronously create a new table and import the data contained in the mentioned file into the created table.
- importBulkDataInNewTableAsBatches() : string
- Asynchronously create a new table and import the data contained in the mentioned file into the created table.
- importData() : array<string|int, mixed>
- Import the data contained in the mentioned file into the table.
- importDataInNewTable() : array<string|int, mixed>
- Create a new table and import the data contained in the mentioned file into the created table.
- importRawData() : array<string|int, mixed>
- Import the data contained in the mentioned file into the table.
- importRawDataInNewTable() : array<string|int, mixed>
- Create a new table and import the raw data provided into the created table.
- initiateBulkExport() : string
- Initiate asynchronous export for the mentioned table (or) view data.
- initiateBulkExportUsingSQL() : string
- Initiate asynchronous export with the given SQL Query.
- setConnectionTimeout() : mixed
- Sets the timeout until a connection is established. A value of zero means the timeout is not used. The default value is 15000.
- setProxy() : mixed
- Used to specify the proxy server details.
- setReadTimeout() : mixed
- Sets the timeout until waiting to read data. A value of zero means the timeout is not used. The default value is 15000.
Constants
CLIENT_VERSION
public
const
CLIENT_VERSION
= "2.3.0"
CLIENT_VERSION It contain the API client version.It is a constant one.
Properties
$ac
private
mixed
$ac
$accounts_server_url
private
string
$accounts_server_url
= "https://@@ACCOUNTS_URL"
Account URL.
$analytics_server_url
private
string
$analytics_server_url
= "https://@@ANALYTICS_URL"
The base request API URL.
$bulk_data_end_point
private
mixed
$bulk_data_end_point
$connection_timeout
private
int
$connection_timeout
It is a time value until a connection is established.
$data_end_point
private
mixed
$data_end_point
$proxy
private
bool
$proxy
= \FALSE
It will indicate whether the proxy is set or not.
$proxy_host
private
string
$proxy_host
The hostname/ip address of the proxy-server.
$proxy_password
private
string
$proxy_password
The password for proxy-server authentication.
$proxy_port
private
int
$proxy_port
The proxy server port.
$proxy_type
private
string
$proxy_type
Can be any one ( HTTP , HTTPS , BOTH ).Specify "BOTH" if same configuration can be used for both HTTP and HTTPS.
$proxy_user_name
private
string
$proxy_user_name
The user name for proxy-server authentication.
$read_timeout
private
int
$read_timeout
It is a time value until waiting to read data.
$req_headers
private
mixed
$req_headers
= array()
Methods
__construct()
Creates a new BulkAPI instance.
public
__construct(AnalyticsClient $ac, string $org_id, string $workspace_id) : mixed
Parameters
- $ac : AnalyticsClient
-
AnalyticsClient instance.
- $org_id : string
-
The ID of the organization.
- $workspace_id : string
-
The ID of the workspace.
exportBulkData()
Download the exported data for the mentioned job id.
public
exportBulkData(string $job_id, string $file_path[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $job_id : string
-
Id of the job.
- $file_path : string
-
Path of the file where the data exported to be stored.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
exportData()
Export the mentioned table (or) view data.
public
exportData(string $view_id, string $response_format, string $file_path[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $view_id : string
-
Id of the view to be exported.
- $response_format : string
-
The format in which the data is to be exported.
- $file_path : string
-
Path of the file where the data exported to be stored.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
getBulkInstance()
Returns a new BulkAPI instance.
public
getBulkInstance(string $org_id, string $workspace_id) : BulkAPI
Parameters
- $org_id : string
-
The ID of the organization.
- $workspace_id : string
-
The ID of the workspace.
Return values
BulkAPI —instance.
getConnectionTimeout()
Returns the timeout until a connection is established.A value of zero means the timeout is not used.
public
getConnectionTimeout() : int
Return values
int —Connection timeout limit.
getDashboards()
Returns list of all accessible dashboards.
public
getDashboards() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Dashboard list.
getExportJobDetails()
Returns the details of the export job.
public
getExportJobDetails(string $job_id) : array<string|int, mixed>
Parameters
- $job_id : string
-
Id of the job.
Tags
Return values
array<string|int, mixed> —Export job details.
getImportJobDetails()
Returns the details of the import job.
public
getImportJobDetails(string $job_id) : array<string|int, mixed>
Parameters
- $job_id : string
-
Id of the job.
Tags
Return values
array<string|int, mixed> —Import job details.
getOrgInstance()
Returns a new OrgAPI instance.
public
getOrgInstance(string $org_id) : OrgAPI
Parameters
- $org_id : string
-
The ID of the organization.
Return values
OrgAPI —instance.
getOrgs()
Returns list of all accessible organizations.
public
getOrgs() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Organization list.
getOwnedDashboards()
Returns list of owned dashboards.
public
getOwnedDashboards() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Dashboard list.
getOwnedWorkspaces()
Returns list of owned workspaces.
public
getOwnedWorkspaces() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Workspace list.
getReadTimeout()
Returns the timeout until waiting to read data. A value of zero means the timeout is not used. The default value is 15000.
public
getReadTimeout() : int
Return values
int —Read timeout limit.
getRecentViews()
Returns list of recently accessed views.
public
getRecentViews() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —View list.
getSharedDashboards()
Returns list of shared dashboards.
public
getSharedDashboards() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Dashboard list.
getSharedWorkspaces()
Returns list of shared workspaces.
public
getSharedWorkspaces() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Workspace list.
getViewDetails()
Returns details of the specified view.
public
getViewDetails(string $view_id[, array<string|int, mixed> $config = array() ]) : array<string|int, mixed>
Parameters
- $view_id : string
-
The ID of the view.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
array<string|int, mixed> —View details.
getViewInstance()
Returns a new ViewAPI instance.
public
getViewInstance(string $org_id, string $workspace_id, string $view_id) : ViewAPI
Parameters
- $org_id : string
-
The ID of the organization.
- $workspace_id : string
-
The ID of the workspace.
- $view_id : string
-
The ID of the view.
Return values
ViewAPI —instance.
getWorkspaceDetails()
Returns details of the specified workspace.
public
getWorkspaceDetails(string $workspace_id) : array<string|int, mixed>
Parameters
- $workspace_id : string
-
The ID of the workspace.
Tags
Return values
array<string|int, mixed> —Workspace details.
getWorkspaceInstance()
Returns a new WorkspaceAPI instance.
public
getWorkspaceInstance(string $org_id, string $workspace_id) : WorkspaceAPI
Parameters
- $org_id : string
-
The ID of the organization.
- $workspace_id : string
-
The ID of the workspace.
Return values
WorkspaceAPI —instance.
getWorkspaces()
Returns list of all accessible workspaces.
public
getWorkspaces() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Workspace list.
importBulkData()
Asynchronously import the data contained in the mentioned file into the table.
public
importBulkData(string $view_id, string $import_type, string $file_type, string $auto_identify, string $file_path[, array<string|int, mixed> $config = array() ]) : string
Parameters
- $view_id : string
-
Id of the view where the data to be imported.
- $import_type : string
-
The type of import. Can be one of - append, truncateadd, updateadd.
- $file_type : string
-
Type of the file to be imported.
- $auto_identify : string
-
Used to specify whether to auto identify the CSV format.
- $file_path : string
-
Path of the file to be imported.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Import job id.
importBulkDataAsBatches()
Asynchronously import the data contained in the mentioned file into the table.
public
importBulkDataAsBatches(string $view_id, string $import_type, string $auto_identify, string $file_path, int $batch_size[, array<string|int, mixed> $config = array() ]) : string
Parameters
- $view_id : string
-
Id of the view where the data to be imported.
- $import_type : string
-
The type of import. Can be one of - append, truncateadd, updateadd.
- $auto_identify : string
-
Used to specify whether to auto identify the CSV format.
- $file_path : string
-
Path of the file to be imported.
- $batch_size : int
-
Number of lines per batch.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Import job id.
importBulkDataInNewTable()
Asynchronously create a new table and import the data contained in the mentioned file into the created table.
public
importBulkDataInNewTable(string $table_name, string $file_type, string $auto_identify, string $file_path[, array<string|int, mixed> $config = array() ]) : string
Parameters
- $table_name : string
-
Name of the new table to be created.
- $file_type : string
-
Type of the file to be imported.
- $auto_identify : string
-
Used to specify whether to auto identify the CSV format.
- $file_path : string
-
Path of the file to be imported.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Import job id.
importBulkDataInNewTableAsBatches()
Asynchronously create a new table and import the data contained in the mentioned file into the created table.
public
importBulkDataInNewTableAsBatches(string $table_name, string $auto_identify, string $file_path, int $batch_size[, array<string|int, mixed> $config = array() ][, mixed $tool_config = array() ]) : string
Parameters
- $table_name : string
-
Name of the new table to be created.
- $auto_identify : string
-
Used to specify whether to auto identify the CSV format.
- $file_path : string
-
Path of the file to be imported.
- $batch_size : int
-
Number of lines per batch.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
- $tool_config : mixed = array()
Tags
Return values
string —Import job id.
importData()
Import the data contained in the mentioned file into the table.
public
importData(string $view_id, string $import_type, string $file_type, string $auto_identify, string $file_path[, array<string|int, mixed> $config = array() ]) : array<string|int, mixed>
Parameters
- $view_id : string
-
Id of the view where the data to be imported.
- $import_type : string
-
The type of import. Can be one of - append, truncateadd, updateadd.
- $file_type : string
-
Type of the file to be imported.
- $auto_identify : string
-
Used to specify whether to auto identify the CSV format.
- $file_path : string
-
Path of the file to be imported.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
array<string|int, mixed> —Import result.
importDataInNewTable()
Create a new table and import the data contained in the mentioned file into the created table.
public
importDataInNewTable(string $table_name, string $file_type, string $auto_identify, string $file_path[, array<string|int, mixed> $config = array() ]) : array<string|int, mixed>
Parameters
- $table_name : string
-
Name of the new table to be created.
- $file_type : string
-
Type of the file to be imported.
- $auto_identify : string
-
Used to specify whether to auto identify the CSV format.
- $file_path : string
-
Path of the file to be imported.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
array<string|int, mixed> —Import result.
importRawData()
Import the data contained in the mentioned file into the table.
public
importRawData(string $view_id, string $import_type, string $file_type, string $auto_identify, string $data[, array<string|int, mixed> $config = array() ]) : array<string|int, mixed>
Parameters
- $view_id : string
-
Id of the view where the data to be imported.
- $import_type : string
-
The type of import. Can be one of - append, truncateadd, updateadd.
- $file_type : string
-
Type of the file to be imported.
- $auto_identify : string
-
Used to specify whether to auto identify the CSV format.
- $data : string
-
Raw data to be imported.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
array<string|int, mixed> —Import result.
importRawDataInNewTable()
Create a new table and import the raw data provided into the created table.
public
importRawDataInNewTable(string $table_name, string $file_type, string $auto_identify, string $data[, array<string|int, mixed> $config = array() ]) : array<string|int, mixed>
Parameters
- $table_name : string
-
Name of the new table to be created.
- $file_type : string
-
Type of the file to be imported.
- $auto_identify : string
-
Used to specify whether to auto identify the CSV format.
- $data : string
-
Raw data to be imported.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
array<string|int, mixed> —Import result.
initiateBulkExport()
Initiate asynchronous export for the mentioned table (or) view data.
public
initiateBulkExport(string $view_id, string $response_format[, array<string|int, mixed> $config = array() ]) : string
Parameters
- $view_id : string
-
Id of the view to be exported.
- $response_format : string
-
The format in which the data is to be exported.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Export job id.
initiateBulkExportUsingSQL()
Initiate asynchronous export with the given SQL Query.
public
initiateBulkExportUsingSQL(string $sql_query, string $response_format[, array<string|int, mixed> $config = array() ]) : string
Parameters
- $sql_query : string
-
The SQL Query whose output is exported.
- $response_format : string
-
The format in which the data is to be exported.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Export job id.
setConnectionTimeout()
Sets the timeout until a connection is established. A value of zero means the timeout is not used. The default value is 15000.
public
setConnectionTimeout(int $time_limit) : mixed
Parameters
- $time_limit : int
-
An integer value.
setProxy()
Used to specify the proxy server details.
public
setProxy(string $proxy_host, int $proxy_port, string $proxy_type, string $proxy_user_name, string $proxy_password) : mixed
Parameters
- $proxy_host : string
-
The hostname/ip address of the proxy-server.
- $proxy_port : int
-
The proxy server port.
- $proxy_type : string
-
Can be any one ( HTTP , HTTPS , BOTH ).Specify "BOTH" if same configuration can be used for both HTTP and HTTPS.
- $proxy_user_name : string
-
The user name for proxy-server authentication.
- $proxy_password : string
-
The password for proxy-server authentication.
setReadTimeout()
Sets the timeout until waiting to read data. A value of zero means the timeout is not used. The default value is 15000.
public
setReadTimeout(int $time_limit) : mixed
Parameters
- $time_limit : int
-
An integer value.