ViewAPI
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.4.0"
Properties
- $ac : mixed
- $accounts_server_url : string
- $analytics_server_url : string
- $connection_timeout : int
- $proxy : bool
- $proxy_host : string
- $proxy_password : string
- $proxy_port : int
- $proxy_type : string
- $proxy_user_name : string
- $read_timeout : int
- $req_headers : mixed
- $view_end_point : mixed
Methods
- __construct() : mixed
- Creates a new ViewAPI instance.
- addAggregateFormula() : string
- Add an aggregate formula in the specified table.
- addColumn() : string
- Add a column in the specified table.
- addFavorite() : mixed
- Adds a specified view as favorite.
- addFormulaColumn() : string
- Add a formula column in the specified table.
- addRow() : array<string|int, mixed>
- Add a single row in the specified table.
- autoAnalyse() : mixed
- Auto generate reports for the specified table.
- autoAnalyseColumn() : mixed
- Auto generate reports for the specified column.
- copyFormulas() : mixed
- Copy the specified formulas from one table to another within the workspace or across workspaces.
- createLookup() : mixed
- Add a lookup in the specified child table.
- createPrivateURL() : string
- Create a private URL for the specified view.
- createSimilarViews() : mixed
- Create reports for the specified table based on the reference table.
- delete() : mixed
- Delete a specified view in the workspace.
- deleteAggregateFormula() : mixed
- Delete the specified aggregate formula.
- deleteColumn() : mixed
- Delete a specified column in the table.
- deleteFormulaColumn() : mixed
- Delete the specified formula column.
- deleteRow() : int
- Delete rows in the specified table.
- editAggregateFormula() : mixed
- Edit the specified aggregate formula.
- editFormulaColumn() : mixed
- Edit the specified formula column.
- getAggregateFormulas() : array<string|int, mixed>
- Returns list of all aggregate formulas for the specified table.
- getBulkInstance() : BulkAPI
- Returns a new BulkAPI instance.
- getColumnDependents() : array<string|int, mixed>
- Returns dependent details for the specified column.
- 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.
- getEmbedURL() : string
- Returns embed URL to access the specified view.
- getFormulaColumns() : array<string|int, mixed>
- Returns list of all formula columns for the specified table.
- getLastImportDetails() : array<string|int, mixed>
- Returns last import details of the specified view.
- getMyPermissions() : array<string|int, mixed>
- Returns permissions for the specified view.
- 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.
- getPrivateURL() : string
- Returns private URL to access the specified view.
- getPublishConfigurations() : array<string|int, mixed>
- Returns publish configurations for the specified view.
- 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.
- getViewDependents() : array<string|int, mixed>
- Returns list of dependents views for the specified view.
- getViewDetails() : array<string|int, mixed>
- Returns details of the specified view.
- getViewInstance() : ViewAPI
- Returns a new ViewAPI instance.
- getViewURL() : string
- Returns the URL to access the specified view.
- 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.
- hideColumns() : mixed
- Hide the specified columns in the table.
- makeViewPublic() : string
- Make the specified view publically accessible.
- refetchData() : mixed
- Sync data from available datasource for the specified view.
- removeFavorite() : mixed
- Remove a specified view from favorite.
- removeLookup() : mixed
- Remove the lookup for the specified column in the table.
- removePrivateAccess() : mixed
- Remove private link access for the specified view.
- removePublicAccess() : mixed
- Remove public access for the specified view.
- rename() : mixed
- Rename a specified view in the workspace.
- renameColumn() : mixed
- Rename a specified column in the table.
- saveAs() : string
- Copy a specified view within the workspace.
- 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.
- showColumns() : mixed
- Show the specified hidden columns in the table.
- updatePublishConfigurations() : mixed
- Update publish configurations for the specified view.
- updateRow() : array<string|int, mixed>
- Update rows in the specified table.
- updateSharedDetails() : mixed
- Update the existing sharing configuration for the specified view.
Constants
CLIENT_VERSION
public
const
CLIENT_VERSION
= "2.4.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.
$connection_timeout
private
int
$connection_timeout
It is a time value until a connection is established.
$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()
$view_end_point
private
mixed
$view_end_point
Methods
__construct()
Creates a new ViewAPI instance.
public
__construct(AnalyticsClient $ac, string $org_id, string $workspace_id, string $view_id) : mixed
Parameters
- $ac : AnalyticsClient
-
AnalyticsClient instance.
- $org_id : string
-
The ID of the organization.
- $workspace_id : string
-
The ID of the workspace.
- $view_id : string
-
The ID of the view.
addAggregateFormula()
Add an aggregate formula in the specified table.
public
addAggregateFormula(string $formula_name, string $expression[, array<string|int, mixed> $config = array() ]) : string
Parameters
- $formula_name : string
-
Name of the aggregate formula to be created.
- $expression : string
-
Formula expression.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Created column id.
addColumn()
Add a column in the specified table.
public
addColumn(string $column_name, string $data_type[, array<string|int, mixed> $config = array() ]) : string
Parameters
- $column_name : string
-
The name of the column.
- $data_type : string
-
The data-type of the column.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Created column id.
addFavorite()
Adds a specified view as favorite.
public
addFavorite() : mixed
Tags
addFormulaColumn()
Add a formula column in the specified table.
public
addFormulaColumn(string $formula_name, string $expression[, array<string|int, mixed> $config = array() ]) : string
Parameters
- $formula_name : string
-
Name of the formula column to be created.
- $expression : string
-
Formula expression.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Created column id.
addRow()
Add a single row in the specified table.
public
addRow(array<string|int, mixed> $column_values[, array<string|int, mixed> $config = array() ]) : array<string|int, mixed>
Parameters
- $column_values : array<string|int, mixed>
-
Contains the values for the row. The column names are the key.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
array<string|int, mixed> —Column Names and Added Row Values.
autoAnalyse()
Auto generate reports for the specified table.
public
autoAnalyse([array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
autoAnalyseColumn()
Auto generate reports for the specified column.
public
autoAnalyseColumn(string $column_id[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $column_id : string
-
Id of the column.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
copyFormulas()
Copy the specified formulas from one table to another within the workspace or across workspaces.
public
copyFormulas(string $formulaNames, string $dest_workspace_id[, array<string|int, mixed> $config = array() ][, string $dest_org_id = NULL ]) : mixed
Parameters
- $formulaNames : string
-
The name of the formula columns to be copied.
- $dest_workspace_id : string
-
The id of the destination workspace.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
- $dest_org_id : string = NULL
-
Id of the organization where the destination workspace is present. Can be null.
Tags
createLookup()
Add a lookup in the specified child table.
public
createLookup(string $column_id, string $ref_view_id, string $ref_column_id[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $column_id : string
-
Id of the column.
- $ref_view_id : string
-
The id of the table contains the parent column.
- $ref_column_id : string
-
The id of the parent column.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
createPrivateURL()
Create a private URL for the specified view.
public
createPrivateURL([array<string|int, mixed> $config = array() ]) : string
Parameters
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —private URL.
createSimilarViews()
Create reports for the specified table based on the reference table.
public
createSimilarViews(string $ref_view_id, string $folder_id[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $ref_view_id : string
-
The ID of the reference view.
- $folder_id : string
-
The folder id where the views to be saved.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
delete()
Delete a specified view in the workspace.
public
delete([array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
deleteAggregateFormula()
Delete the specified aggregate formula.
public
deleteAggregateFormula(string $formula_id[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $formula_id : string
-
Id of the aggregate formula to be deleted.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
deleteColumn()
Delete a specified column in the table.
public
deleteColumn(string $column_id[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $column_id : string
-
Id of the column.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
deleteFormulaColumn()
Delete the specified formula column.
public
deleteFormulaColumn(string $formula_id[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $formula_id : string
-
Id of the formula column to be deleted.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
deleteRow()
Delete rows in the specified table.
public
deleteRow(array<string|int, mixed> $criteria[, array<string|int, mixed> $config = array() ]) : int
Parameters
- $criteria : array<string|int, mixed>
-
The criteria to be applied for deleting data. Only rows matching the criteria will be deleted. Should be null for delete all rows.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
int —Deleted rows count.
editAggregateFormula()
Edit the specified aggregate formula.
public
editAggregateFormula(string $formula_id, string $expression[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $formula_id : string
-
Id of the aggregate formula to be updated.
- $expression : string
-
Formula expression.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
editFormulaColumn()
Edit the specified formula column.
public
editFormulaColumn(string $formula_id, string $expression[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $formula_id : string
-
Id of the formula column to be updated.
- $expression : string
-
Formula expression.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
getAggregateFormulas()
Returns list of all aggregate formulas for the specified table.
public
getAggregateFormulas() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Aggregate formula list.
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.
getColumnDependents()
Returns dependent details for the specified column.
public
getColumnDependents(mixed $column_id) : array<string|int, mixed>
Parameters
- $column_id : mixed
Tags
Return values
array<string|int, mixed> —Dependent details.
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.
getEmbedURL()
Returns embed URL to access the specified view.
public
getEmbedURL([array<string|int, mixed> $config = array() ]) : string
Parameters
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Embed URL.
getFormulaColumns()
Returns list of all formula columns for the specified table.
public
getFormulaColumns() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Formula column list.
getLastImportDetails()
Returns last import details of the specified view.
public
getLastImportDetails() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Last data import details.
getMyPermissions()
Returns permissions for the specified view.
public
getMyPermissions() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Permission 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.
getPrivateURL()
Returns private URL to access the specified view.
public
getPrivateURL([array<string|int, mixed> $config = array() ]) : string
Parameters
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Private URL.
getPublishConfigurations()
Returns publish configurations for the specified view.
public
getPublishConfigurations() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Publish details.
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.
getViewDependents()
Returns list of dependents views for the specified view.
public
getViewDependents() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Dependent view 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.
getViewURL()
Returns the URL to access the specified view.
public
getViewURL([array<string|int, mixed> $config = array() ]) : string
Parameters
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —View URL.
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.
hideColumns()
Hide the specified columns in the table.
public
hideColumns(array<string|int, mixed> $column_ids) : mixed
Parameters
- $column_ids : array<string|int, mixed>
-
Ids of the columns to be hidden.
Tags
makeViewPublic()
Make the specified view publically accessible.
public
makeViewPublic([array<string|int, mixed> $config = array() ]) : string
Parameters
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —public URL.
refetchData()
Sync data from available datasource for the specified view.
public
refetchData([array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
removeFavorite()
Remove a specified view from favorite.
public
removeFavorite() : mixed
Tags
removeLookup()
Remove the lookup for the specified column in the table.
public
removeLookup(string $column_id[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $column_id : string
-
Id of the column.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
removePrivateAccess()
Remove private link access for the specified view.
public
removePrivateAccess() : mixed
Tags
removePublicAccess()
Remove public access for the specified view.
public
removePublicAccess() : mixed
Tags
rename()
Rename a specified view in the workspace.
public
rename(string $view_name[, array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $view_name : string
-
New name of the view.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
renameColumn()
Rename a specified column in the table.
public
renameColumn(string $column_id, string $column_name) : mixed
Parameters
- $column_id : string
-
Id of the column.
- $column_name : string
-
New name for the column.
Tags
saveAs()
Copy a specified view within the workspace.
public
saveAs(string $new_view_name[, array<string|int, mixed> $config = array() ]) : string
Parameters
- $new_view_name : string
-
The name of the new view.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
string —Created view 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.
showColumns()
Show the specified hidden columns in the table.
public
showColumns(array<string|int, mixed> $column_ids) : mixed
Parameters
- $column_ids : array<string|int, mixed>
-
Ids of the columns to be hidden.
Tags
updatePublishConfigurations()
Update publish configurations for the specified view.
public
updatePublishConfigurations([array<string|int, mixed> $config = array() ]) : mixed
Parameters
- $config : array<string|int, mixed> = array()
-
Contains the control parameters.
Tags
updateRow()
Update rows in the specified table.
public
updateRow(array<string|int, mixed> $column_values, array<string|int, mixed> $criteria[, array<string|int, mixed> $config = array() ]) : array<string|int, mixed>
Parameters
- $column_values : array<string|int, mixed>
-
Contains the values for the row. The column names are the key.
- $criteria : array<string|int, mixed>
-
The criteria to be applied for updating data. Only rows matching the criteria will be updated. Should be null for update all rows.
- $config : array<string|int, mixed> = array()
-
Contains any additional control parameters. Can be null.
Tags
Return values
array<string|int, mixed> —Updated Columns List and Updated Rows Count.
updateSharedDetails()
Update the existing sharing configuration for the specified view.
public
updateSharedDetails([ $config = array() ]) : mixed