Copiedcurl
-d "ZOHO_ACTION=GETDATABASENAME&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&ZOHO_API_VERSION=1.0&DBID=999999999999999"
-H "Authorization:Zoho-oauthtoken <access_token>"
https://analyticsapi.zoho.com/api/EmailAddress
Copiedusing ZReports;
namespace Test
{
CLIENT_ID = "************";
CLIENT_SECRET = "************";
REFRESH_TOKEN = "************";
EMAIL = "Email Address";
DBID = 999999999999999;
class Program
{
public IReportClient getClient()
{
IReportClient RepClient = new ReportClient(CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN);
return RepClient;
}
public void getdbname(IReportClient rc)
{
string uri = rc.GetURI(EMAIL);
string result = rc.GetDatabaseName(uri, DBID, null);
Console.WriteLine(result);
}
static void Main(string[] args)
{
Program obj = new Program();
IReportClient rc = obj.getClient();
obj.getdbname(rc);
}
}
}
Copiedpackage main
import (
"fmt"
"zoho/pkg/reportclient"
)
var (
email = "Email Address"
clientid = "************"
clientsecret = "************"
refreshtoken = "************"
dbid = "999999999999999"
)
func getdatabasename() {
url := reportclient.GetUserUri(email)
databasename, err := reportclient.GetDatabaseName(url, dbid)
if err != nil {
fmt.Println(err.ErrorMessage)
fmt.Println(err.ErrorCode)
fmt.Println(err.Action)
fmt.Println(err.HttpStatusCode)
} else {
fmt.Println(databasename)
}
}
func main() {
reportclient.SetOAuthToken(clientid, clientsecret, refreshtoken)
getdatabasename()
}
Copiedimport com.adventnet.zoho.client.report.*;
public class Sample {
String email = "Email Address";
String clientId = "************";
String clientSecret = "************";
String refreshToken = "************";
long dbid = 999999999999999;
Map config = new HashMap();
private ReportClient rc = new ReportClient(clientId, clientSecret, refreshToken);
public void getdbname() throws Exception {
String uri = rc.getURI(email);
String result = rc.getDatabaseName(uri, dbid);
System.out.println(result);
}
public static void main(String[] args) throws Exception {
Sample obj = new Sample();
obj.getdbname();
}
}
Copied<?php
require 'ReportClient.php';
$EMAIL_ID = "Email Address";
$CLIENT_ID = "************";
$CLIENT_SECRET = "************";
$REFRESH_TOKEN = "************";
$report_client_request = new ReportClient($CLIENT_ID, $CLIENT_SECRET, $REFRESH_TOKEN);
$uri = $report_client_request->getUserURI($EMAIL_ID);
$db_id = 999999999999999;
$database_name = $report_client_request->getDatabaseName($uri, $db_id);
?>
Copiedfrom __future__ import with_statement
from ReportClient import ReportClient
import sys
class Sample:
LOGIN_EMAIL_ID = "Email Address"
CLIENT_ID = "************"
CLIENT_SECRET = "************"
REFRESH_TOKEN = "************"
DBID = "999999999999999"
rc = None
rc = ReportClient(REFRESH_TOKEN, CLIENT_ID, CLIENT_SECRET)
def getdatabasename(self, rc):
uri = rc.getUserURI(self.LOGIN_EMAIL_ID)
result = rc.getDatabaseName(uri, self.DBID)
print(result)
obj = Sample()
obj.getdatabasename(obj.rc)
Copiedvar nodelib = require('./ZAnalyticsClient');
var clientId = '************';
var clientSecret = '************';
var refreshtoken = '************';
var emailId = 'EmailAddress';
var workspaceId = 'WorkspaceID';
nodelib.initialize(clientId, clientSecret, refreshtoken).then(() => {
var params = {};
var uripath = nodelib.getUri(emailId);
nodelib.getWorkspaceName(workspaceId, 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", "GETDATABASENAME");
paramsMap.put("ZOHO_OUTPUT_FORMAT", "JSON");
paramsMap.put("ZOHO_ERROR_FORMAT", "JSON");
paramsMap.put("ZOHO_API_VERSION", "1.0");
// ACTION SPECIFIC PARAMS
paramsMap.put("DBID", "");
response = invokeurl[url: "https://analyticsapi.zoho.com/api/" + email type: POST parameters: paramsMap headers: headers];
info response;