Get Org Dashboards
Get the list of dashboards that the user can access across the workspaces of the specified organization.
REQUEST URI
https://<ZohoAnalytics_Server_URI>/restapi/v2/orgs/dashboards
Get
oauthscope: ZohoAnalytics.metadata.read
QUERY PARAMETERS
| Description |
|---|---|
| CONFIG | JSONObject Config parameter specifications are available in the below section. |
FIELDS FOR CONFIG JSON
| Description |
|---|---|
| workspaceIds | JSONArray The IDs of the workspaces from which the dashboards are to be listed. Each ID must belong to the organization specified in the ZANALYTICS-ORGID header.Supported range - 0 to 1000 IDs. Maximum length - 10000 characters. Duplicate IDs are ignored. An empty array is treated the same as an omitted key. If not specified, dashboards from all the workspaces visible to the user are listed. Sample: {"workspaceIds":["137687000271334001","466206000000071000"]} |
| pageNo | Integer The page number of the result to be returned. Supported range - 1 to 1000. Default value - 1. Sample: {"pageNo":2} |
| recordsPerPage | Integer The number of dashboards to be returned per page. Supported range - 1 to 500. Default value - 100. Sample: {"recordsPerPage":10} |
| searchKey | String The text to search for in dashboard names. Only the dashboards whose name contains this text are listed. The text is matched as a single phrase. Leading and trailing spaces are trimmed. Maximum length - 100 characters. If not specified, no filter is applied. Sample: {"searchKey":"Sales"} |
Note: Specifying workspaceIds does not bypass view-level access. Dashboards that the user does not have permission to view are not listed.
Note: When workspaceIds is not specified and the user can access more than 100 workspaces, the request fails. Specify workspaceIds in such cases.
Note: CONFIG supports only the keys listed above. A key set to null, an empty string or a blank string is not allowed. Omit the key instead.
Sample Request:
Copiedcurl "https://analyticsapi.zoho.com/restapi/v2/orgs/dashboards?CONFIG=%7B%22recordsPerPage%22%3A50%2C%22searchKey%22%3A%22Sales%22%7D" \
-H 'ZANALYTICS-ORGID: <org-id>' \
-H 'Authorization: Zoho-oauthtoken <access_token>'Copiedusing System;
using System.Collections.Generic;
using ZohoAnalytics;
using System.Text.Json;
namespace ZohoAnalyticsTest
{
class Program
{
long orgId = 55522777;
public void GetOrgDashboards(IAnalyticsClient ac)
{
IOrgAPI org = ac.GetOrgInstance(orgId);
Dictionary<string, object> config = new Dictionary<string, object>();
config.Add("recordsPerPage", 50);
config.Add("searchKey", "Sales");
JsonElement result = org.GetOrgDashboards(config);
Console.WriteLine(result);
}
static void Main(string[] args)
{
string clientId = "1000.xxxxxxx";
string clientSecret = "xxxxxxx";
string refreshToken = "1000.xxxxxxx.xxxxxxx";
try
{
IAnalyticsClient ac = new AnalyticsClient(clientId, clientSecret, refreshToken);
Program obj = new Program();
obj.GetOrgDashboards(ac);
}
catch (ServerException ex)
{
Console.WriteLine("Server exception - " + ex.GetErrorMessage());
}
catch (Exception ex)
{
Console.WriteLine("Other exception - " + ex.Message);
}
}
}
}Copiedpackage main
import (
"fmt"
ZAnalytics "zoho/pkg/analyticsclient"
)
var(
clientId = "1000.xxxxxxx"
clientSecret = "xxxxxxx"
refreshToken = "1000.xxxxxxx.xxxxxxx"
orgId = "55522777"
)
func GetOrgDashboards(ac ZAnalytics.Client) {
org := ZAnalytics.GetOrgInstance(&ac, orgId)
config := map[string]interface{}{"recordsPerPage": 50, "searchKey": "Sales"}
result, _ := org.GetOrgDashboards(config)
fmt.Println(result)
}
func main() {
ac := ZAnalytics.GetAnalyticsClient(clientId, clientSecret, refreshToken)
GetOrgDashboards(ac)
}Copiedimport com.zoho.analytics.client.*;
import org.json.*;
public class Test {
private long orgId = 55522777l;
public static void main(String args[]) {
String clientId = "1000.xxxxxxx";
String clientSecret = "xxxxxxx";
String refreshToken = "1000.xxxxxxx.xxxxxxx";
Test tObj = new Test();
AnalyticsClient ac = new AnalyticsClient(clientId, clientSecret, refreshToken);
try {
tObj.getOrgDashboards(ac);
}
catch (ServerException ex) {
System.out.println("Server exception - ErrorCode : " + ex.getErrorCode() + ", ErrorMessage : " + ex.getErrorMessage());
}
catch (Exception ex) {
System.out.println("Other exception - ");
ex.printStackTrace();
}
}
public void getOrgDashboards(AnalyticsClient ac) throws Exception {
OrgAPI org = ac.getOrgInstance(orgId);
JSONObject config = new JSONObject();
config.put("recordsPerPage", 50);
config.put("searchKey", "Sales");
JSONObject result = org.getOrgDashboards(config);
System.out.println(result);
}
}Copied<?php
require 'AnalyticsClient.php';
class Test
{
public $ac = NULL;
public $client_id = "1000.xxxxxxx";
public $client_secret = "xxxxxxx";
public $refresh_token = "1000.xxxxxxx.xxxxxxx";
public $org_id = "55522777";
function __construct() {
$this->ac = new AnalyticsClient($this->client_id, $this->client_secret, $this->refresh_token);
}
function getOrgDashboards() {
$org = $this->ac->getOrgInstance($this->org_id);
$config = array("recordsPerPage" => 50, "searchKey" => "Sales");
$response = $org->getOrgDashboards($config);
print_r($response);
}
}
$test_obj = new Test();
try {
$test_obj->getOrgDashboards();
}
catch(ServerException $se) {
echo "Server exception : " . $se->getErrorMessage() . "\n";
}
catch(Exception $e) {
echo "Exception : " . $e->getMessage() . "\n";
}
?>Copiedfrom AnalyticsClient import AnalyticsClient
import sys
class Config:
CLIENTID = "1000.xxxxxxx"
CLIENTSECRET = "xxxxxxx"
REFRESHTOKEN = "1000.xxxxxxx.xxxxxxx"
ORGID = "55522777"
class sample:
ac = AnalyticsClient(Config.CLIENTID, Config.CLIENTSECRET, Config.REFRESHTOKEN)
def get_org_dashboards(self, ac):
org = ac.get_org_instance(Config.ORGID)
config = {"recordsPerPage": 50, "searchKey": "Sales"}
result = org.get_org_dashboards(config)
print(result)
try:
obj = sample()
obj.get_org_dashboards(obj.ac)
except Exception as e:
print(str(e))Copiedvar analyticsClient = require('./AnalyticsClient');
var clientId = '1000.xxxxxxx';
var clientSecret = 'xxxxxxx';
var refreshToken = '1000.xxxxxxx.xxxxxxx';
var orgId = '55522777';
var ac = new analyticsClient(clientId, clientSecret, refreshToken);
var org = ac.getOrgInstance(orgId);
var config = {recordsPerPage: 50, searchKey: 'Sales'};
org.getOrgDashboards(config).then(function (result) {
console.log(result);
}).catch(function (err) {
console.log(err);
});CopiedorgId = "55522777";
headersMap = Map();
headersMap.put("ZANALYTICS-ORGID", orgId);
config = Map();
config.put("recordsPerPage", 50);
config.put("searchKey", "Sales");
response = invokeurl
[
url :"https://analyticsapi.zoho.com/restapi/v2/orgs/dashboards?CONFIG=" + zoho.encryption.urlEncode(config.toString())
type :GET
headers:headersMap
connection:"analytics_oauth_connection"
];
info response;Copiedrequire 'zoho_analytics_client'
class Config
ORGID = "55522777"
end
class Sample
def initialize
@ac = AnalyticsClient.new
.with_data_center("US")
.with_oauth({
"clientId" => "1000.xxxxxxx",
"clientSecret" => "xxxxxxx",
"refreshToken" => "1000.xxxxxxx.xxxxxxx"
})
.build
end
def get_org_dashboards
org = @ac.get_org_instance(Config::ORGID)
config = {"recordsPerPage" => 50, "searchKey" => "Sales"}
result = org.get_org_dashboards(config)
puts result
end
end
begin
obj = Sample.new
obj.get_org_dashboards
rescue ServerError => e
puts "Server Error: #{e.response_content}"
rescue StandardError => e
puts e.message
puts e.backtrace.join("\n")
endDownload client libraries: C# | GO | JAVA | PHP | PYTHON | NodeJS | Ruby
Sample value for CONFIG parameter:
Copied{
"recordsPerPage": 50,
"searchKey": "Sales"
}Sample Response:
CopiedHTTP/1.1 200 OK
Content-Type:application/json;charset=UTF-8
{
"status": "success",
"summary": "Get dashboards",
"data": {
"views": [
{
"viewId": "466206000000106002",
"viewName": "Support Overview",
"viewDesc": "Open tickets by priority",
"viewType": "Dashboard",
"parentViewId": "",
"folderId": "466206000000071005",
"createdTime": "1718361737000",
"createdBy": "jane.doe@example.com",
"lastModifiedTime": "1720000000000",
"lastModifiedBy": "jane.doe@example.com",
"isFavorite": true,
"sharedBy": "jane.doe@example.com",
"workspaceId": "466206000000071000",
"orgId": "700000123456"
},
{
"viewId": "466206000000106003",
"viewName": "Support Backlog",
"viewDesc": "",
"viewType": "Dashboard",
"parentViewId": "",
"folderId": "null",
"createdTime": "1707286805000",
"createdBy": "jane.doe@example.com",
"lastModifiedTime": "1719000000000",
"lastModifiedBy": "john.roe@example.com",
"isFavorite": false,
"sharedBy": "jane.doe@example.com",
"workspaceId": "466206000000071000",
"orgId": "700000123456"
}
],
"pageDetails": {
"pageNo": 1,
"recordsPerPage": 2,
"hasNextPage": true
}
}
}