Get Workspace Linking Compatibility
Check whether the specified workspaces can be linked to the master workspace, without linking them.
REQUEST URI
https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/linkedworkspaces/compatibility
Get
oauthscope: ZohoAnalytics.metadata.read
QUERY PARAMETERS
| Description |
|---|---|
| CONFIG* | JSONObject Config parameter specifications are available in the below section. |
FIELDS FOR CONFIG JSON
| Description |
|---|---|
| clients* | JSONArray The candidate client workspaces to validate, grouped by the organization that owns them. Supports 1 to 100 entries. Maximum length - 500000 characters. Check the table clients Fields for more details. Sample: {"clients":[{"orgId":700000654321,"workspaceIds":["466206000000071000"]}]} |
clients Fields
| Description |
|---|---|
| orgId* | Long The ID of the organization that owns the listed workspaces. Specify the value as a JSON number. Maximum length - 20 characters. You must be an Account Admin or Organization Admin of this organization. Sample: {"orgId":700000654321} |
| workspaceIds* | JSONArray of String The IDs of the client workspaces to validate. Specify each workspace ID as a string. Supports 1 to 100 entries. Maximum length - 5000 characters. Every workspace must belong to the organization specified in orgId.Duplicate workspace IDs are removed before processing. Sample: {"workspaceIds":["466206000000071000"]} |
Note: Specify orgId as a number and each entry in workspaceIds as a string, as shown in the samples.
Sample Request:
Copiedcurl "https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/linkedworkspaces/compatibility?CONFIG=%7B%22clients%22%3A%5B%7B%22orgId%22%3A700000654321%2C%22workspaceIds%22%3A%5B%22466206000000071000%22%5D%7D%5D%7D" \
-H 'ZANALYTICS-ORGID: <org-id>' \
-H 'Authorization: Zoho-oauthtoken <access_token>'Copiedusing System;
using System.Collections.Generic;
using System.Text.Json;
using ZohoAnalytics;
namespace ZohoAnalyticsTest
{
class Program
{
long orgId = 55522777;
long workspaceId = 35130000001055707;
public void GetWorkspaceLinkingCompatibility(IAnalyticsClient ac)
{
List<Dictionary<string, object>> clients = JsonSerializer.Deserialize<List<Dictionary<string, object>>>("[{\"orgId\":700000654321,\"workspaceIds\":[\"466206000000071000\"]}]");
IWorkspaceAPI workspace = ac.GetWorkspaceInstance(orgId, workspaceId);
JsonElement result = workspace.GetWorkspaceLinkingCompatibility(clients, null);
Console.WriteLine(result);
}
static void Main(string[] args)
{
string clientId = "1000.xxxxxxx";
string clientSecret = "xxxxxxx";
string refreshToken = "1000.xxxxxxx.xxxxxxx";
IAnalyticsClient ac = new AnalyticsClient(clientId, clientSecret, refreshToken);
Program obj = new Program();
obj.GetWorkspaceLinkingCompatibility(ac);
}
}
}Copiedpackage main
import (
"fmt"
ZAnalytics "zoho/pkg/analyticsclient"
)
var (
clientId = "1000.xxxxxxx"
clientSecret = "xxxxxxx"
refreshToken = "1000.xxxxxxx.xxxxxxx"
orgId = "55522777"
workspaceId = "35130000001055707"
)
func GetWorkspaceLinkingCompatibility(ac ZAnalytics.Client) {
clients := []interface{}{
map[string]interface{}{
"orgId": 700000654321,
"workspaceIds": []string{"466206000000071000"},
},
}
workspace := ZAnalytics.GetWorkspaceInstance(&ac, orgId, workspaceId)
result, exception := workspace.GetWorkspaceLinkingCompatibility(clients, nil)
if exception != nil {
fmt.Println(exception.ErrorMessage)
return
}
fmt.Println(result)
}
func main() {
ac := ZAnalytics.GetAnalyticsClient(clientId, clientSecret, refreshToken)
GetWorkspaceLinkingCompatibility(ac)
}Copiedimport com.zoho.analytics.client.*;
import org.json.*;
public class Test {
private long orgId = 55522777l;
private long workspaceId = 35130000001055707l;
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.getWorkspaceLinkingCompatibility(ac);
} catch (Exception ex) {
ex.printStackTrace();
}
}
public void getWorkspaceLinkingCompatibility(AnalyticsClient ac) throws Exception {
JSONArray clients = new JSONArray("[{\"orgId\":700000654321,\"workspaceIds\":[\"466206000000071000\"]}]");
WorkspaceAPI workspace = ac.getWorkspaceInstance(orgId, workspaceId);
JSONArray result = workspace.getWorkspaceLinkingCompatibility(clients, null);
System.out.println(result);
}
}Copied<?php
require 'AnalyticsClient.php';
class Test {
public $ac;
public $org_id = "55522777";
public $workspace_id = "35130000001055707";
function __construct() {
$this->ac = new AnalyticsClient("1000.xxxxxxx", "xxxxxxx", "1000.xxxxxxx.xxxxxxx");
}
function getWorkspaceLinkingCompatibility() {
$clients = array(
array(
"orgId" => 700000654321,
"workspaceIds" => array("466206000000071000")
)
);
$workspace = $this->ac->getWorkspaceInstance($this->org_id, $this->workspace_id);
$response = $workspace->getWorkspaceLinkingCompatibility($clients);
print_r($response);
}
}
$obj = new Test();
$obj->getWorkspaceLinkingCompatibility();
?>Copiedfrom AnalyticsClient import AnalyticsClient
class Config:
CLIENTID = "1000.xxxxxxx"
CLIENTSECRET = "xxxxxxx"
REFRESHTOKEN = "1000.xxxxxxx.xxxxxxx"
ORGID = "55522777"
WORKSPACEID = "35130000001055707"
class Sample:
ac = AnalyticsClient(Config.CLIENTID, Config.CLIENTSECRET, Config.REFRESHTOKEN)
def get_workspace_linking_compatibility(self, ac):
clients = [
{
"orgId": 700000654321,
"workspaceIds": ["466206000000071000"]
}
]
workspace = ac.get_workspace_instance(Config.ORGID, Config.WORKSPACEID)
result = workspace.get_workspace_linking_compatibility(clients)
print(result)
obj = Sample()
obj.get_workspace_linking_compatibility(obj.ac)Copiedvar analyticsClient = require('./AnalyticsClient');
var ac = new analyticsClient('1000.xxxxxxx', 'xxxxxxx', '1000.xxxxxxx.xxxxxxx');
var orgId = '55522777';
var workspaceId = '35130000001055707';
var clients = [
{
"orgId": 700000654321,
"workspaceIds": ["466206000000071000"]
}
];
var workspace = ac.getWorkspaceInstance(orgId, workspaceId);
workspace.getWorkspaceLinkingCompatibility(clients).then((result) => { console.log(result); }).catch((error) => { console.log(error); });CopiedorgId = "55522777";
workspaceId = "35130000001055707";
headersMap = Map();
headersMap.put("ZANALYTICS-ORGID", orgId);
config = {"clients": [{"orgId": 700000654321, "workspaceIds": ["466206000000071000"]}]};
response = invokeurl
[
url :"https://analyticsapi.zoho.com/restapi/v2/workspaces/" + workspaceId + "/linkedworkspaces/compatibility?CONFIG=" + zoho.encryption.urlEncode(config.toString())
type :GET
headers:headersMap
connection:"analytics_oauth_connection"
];
info response;Copiedrequire 'zoho_analytics_client'
class Config
ORGID = "55522777"
WORKSPACEID = "35130000001055707"
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_workspace_linking_compatibility
clients = [
{
"orgId" => 700000654321,
"workspaceIds" => ["466206000000071000"]
}
]
workspace = @ac.get_workspace_instance(Config::ORGID, Config::WORKSPACEID)
result = workspace.get_workspace_linking_compatibility(clients)
puts result
end
end
obj = Sample.new
obj.get_workspace_linking_compatibilityDownload client libraries: C# | GO | JAVA | PHP | PYTHON | NodeJS | Ruby
Sample value for CONFIG parameter:
Copied{
"clients": [
{
"orgId": 700000654321,
"workspaceIds": [
"466206000000071000"
]
}
]
}Sample Response:
CopiedHTTP/1.1 200 OK
Content-Type:application/json;charset=UTF-8
{
"status": "success",
"summary": "Get workspace linking compatibility",
"data": {
"clients": [
{
"orgId": "700000654321",
"orgName": "Northwind Retail",
"workspaces": [
{
"workspaceId": "466206000000071000",
"workspaceName": "Northwind Sandbox",
"isCompatible": true,
"error": null,
"entities": {
"dataSources": [],
"tables": [],
"views": []
}
},
{
"workspaceId": "466206000000071010",
"workspaceName": "Northwind EU Sandbox",
"isCompatible": false,
"error": "Some entities have conflicts",
"entities": {
"dataSources": [
{
"datasourceId": "466206000000095001",
"datasourceName": "Books Connection",
"status": "failure",
"message": "Connection configuration differs"
}
],
"tables": [
{
"viewId": "137687000006991601",
"viewName": "Sales_Fact",
"status": "warning",
"message": "Column structure differs"
}
],
"views": [
{
"viewId": "466206000000105001",
"viewName": "Revenue by Region",
"status": "failure",
"message": "Formula column missing in client workspace"
}
]
}
}
]
}
]
}
}