Enable Domain Workspace (Only For White Label Customers)
The Enable Workspace API is used to enable the workspace from your Zoho Analytics Account to White label account (custom domain).
REQUEST URI
https://<ZohoAnalytics_Server_URI>/api/<OwnerEmail>
Post
oauthscope: ZohoAnalytics.modeling.update
COMMON PARAMETERS
Parameter | Possible Values | Description |
---|---|---|
ZOHO_ACTION | ENABLEDOMAINDB | This parameter specifies the action to be performed by the API request. |
ZOHO_OUTPUT_FORMAT | XML/JSON | This parameter specifies the output format for the response. |
ZOHO_ERROR_FORMAT | XML/JSON | Specifies the output format for the response in case an error occurs when trying to process the request. |
ZOHO_API_VERSION | 1.0 | The API version of Zoho Analytics based on which the application(/service) has been written. This parameter allows the Zoho Analytics to handle applications based on the older versions.The current API version is 1.0. |
AUTHORIZATION
To make authenticated API request, append the access token in Authorization request header.
Header Name | Value | Description |
---|---|---|
Authorization | Zoho-oauthtoken<space><access_token> | The Access token provides a secure and temporary access to Zoho Analytics API's. Each access token will be valid only for an hour, and can be used only for the set of operations that is described in the scope. |
ACTION SPECIFIC PARAMETERS
Parameter | Possible Values | Description |
---|---|---|
DBNAME (mandatory) | Workspace name | This parameter holds the name of the workspace to be enabled. |
DOMAINNAME (mandatory) | Domain name | This parameter holds the domain address. |
POSSIBLE ERROR CODES
Sample Request:
Copiedcurl -d "ZOHO_ACTION=ENABLEDOMAINDB&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
&ZOHO_API_VERSION=1.0
&DBNAME=Workspace Name&DOMAINNAME=Domain Name"
-H "Authorization:Zoho-oauthtoken <access_token>"
https://analyticsapi.zoho.com/api/EmailAddress
Copiedusing ZReports;
namespace Test
{
class Program
{
public IReportClient GetClient()
{
IReportClient RepClient = new ReportClient(CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN);
return RepClient;
}
public void EnableDomainDB(IReportClient rc)
{
try
{
string uri = rc.GetURI(EMAIL);
string dbname = "Workspace Name";
string domainname = "Domain Name";
var result = rc.EnableDomainDB(uri, dbname, domainname, null);
foreach (KeyValuePair<string, string> kvp in result)
{
Console.WriteLine(kvp.Key + " = " + kvp.Value);
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
static void Main(string[] args)
{
Program obj = new Program();
IReportClient rc = obj.GetClient();
obj.EnableDomainDB(rc);
}
}
}
Copiedpackage main
import (
"fmt"
"zoho/pkg/reportclient"
)
var (
clientid = "************"
clientsecret = "************"
refreshtoken = "************"
)
func EnableDomainDB() {
url := reportclient.GetUserUri("Email Address")
params := map[string]string{}
err := reportclient.EnableDomainDB(url, "Workspace Name", "Domain Name", params)
if err != nil {
fmt.Println(err.ErrorMessage)
fmt.Println(err.ErrorCode)
fmt.Println(err.Action)
fmt.Println(err.HttpStatusCode)
} else {
fmt.Println("success")
}
}
func main() {
reportclient.SetOAuthToken(clientid, clientsecret, refreshtoken)
EnableDomainDB()
}
Copiedimport com.adventnet.zoho.client.report.*;
public class Sample {
String clientId = "************";
String clientSecret = "************";
String refreshToken = "************";
private ReportClient rc = new ReportClient(clientId, clientSecret, refreshToken);
public void enableDomainDB() throws Exception {
String uri = rc.getURI("Email Address");
String dbName = "Workspace Name";
String domainName = "Domain Name";
rc.enableDomainDB(uri, dbName, domainName, null);
}
public static void main(String[] args) throws Exception {
Sample obj = new Sample();
obj.enableDomainDB();
}
}
Copied<?php
require 'ReportClient.php';
$CLIENT_ID = "************";
$CLIENT_SECRET = "************";
$REFRESH_TOKEN = "************";
$request = new ReportClient($CLIENT_ID, $CLIENT_SECRET, $REFRESH_TOKEN);
$uri = $request->getUserURI("Email Address");
$dbname = "Workspace Name";
$domain_name = "Domain Name";
$request->enableDomainDB($uri, $dbname, $domain_name);
?>
Copiedfrom __future__ import with_statement
from ReportClient import ReportClient
import sys
class Sample:
CLIENTID = "************"
CLIENTSECRET = "************"
REFRESHTOKEN = "************"
rc = None
rc = ReportClient(REFRESHTOKEN, CLIENTID, CLIENTSECRET)
def enableDomainDB(self, rc):
uri = rc.getURI("Email Address")
dbName = "Workspace Name"
domainName = "Domain Name"
rc.enableDomainDB(uri, dbName, domainName)
obj = Sample()
obj.enableDomainDB(obj.rc)
Copiedvar nodelib = require('./ZAnalyticsClient');
var clientId = '************';
var clientSecret = '************';
var refreshtoken = '************';
var emailId = 'EmailAddress';
var workspaceName = 'WorkspaceName';
var domainName = 'DomainName';
nodelib.initialize(clientId, clientSecret, refreshtoken).then(() => {
var params = {};
var uripath = nodelib.getUri(emailId);
nodelib.enableDomainWorkspace(workspaceName, domainName, uripath, params).then((response) => {
console.log(response);
}).catch((error) => {
console.log('Error : ' + error.message);
});
}).catch((error) => {
console.log('Authentication Error : ' + error);
});
Copiedemail = zoho.encryption.urlEncode("");
paramsMap = Map();
oauthParams = Map();
headers = Map();
// AUTHENTICATION PARAMS
oauthParams.put("client_id", "********");
oauthParams.put("client_secret", "********");
oauthParams.put("refresh_token", "********");
oauthParams.put("grant_type", "refresh_token");
tokenInfo = invokeurl[url: "https://accounts.zoho.com/oauth/v2/token" type: POST parameters: oauthParams];
if (tokenInfo.containKey("access_token")) {
accessToken = tokenInfo.get("access_token");
headers.put("Authorization", "Zoho-oauthtoken ".concat(accessToken));
} else {
info tokenInfo;
return;
}
// COMMON PARAMS
paramsMap.put("ZOHO_ACTION", "ENABLEDOMAINDB");
paramsMap.put("ZOHO_OUTPUT_FORMAT", "JSON");
paramsMap.put("ZOHO_ERROR_FORMAT", "JSON");
paramsMap.put("ZOHO_API_VERSION", "1.0");
// ACTION SPECIFIC PARAMS
paramsMap.put("DBNAME", "");
paramsMap.put("DOMAINNAME", "");
response = invokeurl[url: "https://analyticsapi.zoho.com/api/" + email type: POST parameters: paramsMap headers: headers];
info response;
Sample Response:
Copied<responseuri="/api/EmailAddress"action="ENABLEDOMAINDB">
<result>
<status>Success</status>
<message>Domain Feature has been enabled</message>
</result>
</response>
Copied{"response":
{"uri": "\/api\/email",
"action": "ENABLEDOMAINDB",
"result":
{"status":"Success",
"message":"Domain Feature has been enabled"}}}