Copiedcurl
-d "ZOHO_ACTION=CREATESIMILARVIEWS&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&ZOHO_API_VERSION=1.0&ZOHO_REFVIEW=Reference Table Name&ZOHO_FOLDERNAME=Folder Name&ISCOPYCUSTOMFORMULA=false&ISCOPYAGGFORMULA=false"
-H "Authorization:Zoho-oauthtoken <access_token>"
https://analyticsapi.zoho.com/api/EmailAddress/WorkspaceName/TableName
Copiedusing ZReports;
namespace Test
{
CLIENT_ID = "************";
CLIENT_SECRET = "************";
REFRESH_TOKEN = "************";
EMAIL = "Email Address";
class Program
{
public IReportClient getClient()
{
IReportClient RepClient = new ReportClient(CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN);
return RepClient;
}
public void createsimilarviews(IReportClient rc)
{
try
{
string uri = rc.GetURI(EMAIL, "Workspace name", "Table Name");
string refview = "Reference Table Name";
string foldername = "Folder Name";
bool copycusformula = false;
bool copyaggformula = false;
rc.CreateSimilarViews(uri, refview, foldername, copycusformula, copyaggformula, null);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
static void Main(string[] args)
{
Program obj = new Program();
IReportClient rc = obj.getClient();
obj.createsimilarviews(rc);
}
}
}
Copiedpackage main
import (
"fmt"
"zoho/pkg/reportclient"
)
var (
email = "User Email"
clientid = "************"
clientsecret = "************"
refreshtoken = "************"
)
func CreateSimilarViews() {
url := reportclient.GetUri(email, "Workspace Name", "Table Name")
refview := "Reference Table Name"
foldername := "Folder Name"
customformula := false
aggformula := false
params := map[string]string{}
result, err := reportclient.CreateSimilarViews(url, refview, foldername, customformula, aggformula, params)
if err != nil {
fmt.Println(err.ErrorMessage)
fmt.Println(err.ErrorCode)
fmt.Println(err.Action)
fmt.Println(err.HttpStatusCode)
} else {
fmt.Println(result)
}
}
func main() {
reportclient.SetOAuthToken(clientid, clientsecret, refreshtoken)
CreateSimilarViews()
}
Copiedimport com.adventnet.zoho.client.report.*;
public class Sample {
String email = "Email Address";
String databaseName = "Workspace Name";
String tableName = "Table Name";
String clientId = "************";
String clientSecret = "************";
String refreshToken = "************";
Map config = new HashMap();
private ReportClient rc = new ReportClient(clientId, clientSecret, refreshToken);
public void createSimilarViews() throws Exception {
String uri = rc.getURI(email, databaseName, tableName);
String refView = "Reference Table Name";
String folderName = "Folder Name";
boolean customFormula = false;
boolean aggFormula = false;
Map result = rc.createSimilarViews(uri, refView, folderName, customFormula, aggFormula, null);
}
public static void main(String[] args) throws Exception {
Sample obj = new Sample();
obj.createSimilarViews();
}
}
Copied<?php
require 'ReportClient.php';
$EMAIL_ID = "Email Address";
$CLIENT_ID = "************";
$CLIENT_SECRET = "************";
$REFRESH_TOKEN = "************";
$DB_NAME = "Workspace Name";
$TABLE_NAME = "Table Name";
$request = new ReportClient($CLIENT_ID, $CLIENT_SECRET, $REFRESH_TOKEN);
$uri = $request->getURI($EMAIL_ID, $DB_NAME, $TABLE_NAME);
$ref_view = "Reference Table Name";
$folder_name = "Folder Name";
$copy_customformula = false;
$copy_aggformula = false;
$response = $request->createSimilarViews($uri, $ref_view, $folder_name, $copy_customformula, $copy_aggformula);
?>
Copiedfrom __future__ import with_statement
from ReportClient import ReportClient
import sys
class Sample:
LOGIN_EMAIL_ID = "Email Address"
DATABASE_NAME = "Workspace Name"
TABLE_NAME = "Table Name"
CLIENT_ID = "************"
CLIENT_SECRET = "************"
REFRESH_TOKEN = "************"
rc = None
rc = ReportClient(REFRESH_TOKEN, CLIENT_ID, CLIENT_SECRET)
def createSimilarViews(self, rc):
uri = rc.getURI(self.LOGIN_EMAIL_ID, self.DATABASE_NAME, self.TABLE_NAME)
refView = "Reference Table Name"
folderName = "Folder Name"
customFormula = False
aggFormula = False
result = rc.createSimilarViews(uri, refView, folderName, customFormula, aggFormula, None)
print(result)
obj = Sample()
obj.createSimilarViews(obj.rc)
Copiedvar nodelib = require('./ZAnalyticsClient');
var clientId = '************';
var clientSecret = '************';
var refreshtoken = '************';
var emailId = 'EmailAddress';
var workspaceName = 'WorkspaceName';
var viewName = 'ViewName';
nodelib.initialize(clientId, clientSecret, refreshtoken).then(() => {
var params = {};
var uripath = nodelib.getUri(emailId, workspaceName, viewName);
var referenceView = '';
var folderName = '';
var copyCustomFormula = '';
var copyAggregateFormula = '';
nodelib.createSimilarViews(referenceView, folderName, copyCustomFormula, copyAggregateFormula, 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("");
workspaceName = 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:POSTparameters: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", "CREATESIMILARVIEWS");
paramsMap.put("ZOHO_OUTPUT_FORMAT", "JSON");
paramsMap.put("ZOHO_ERROR_FORMAT", "JSON");
paramsMap.put("ZOHO_API_VERSION", "1.0");
// ACTION SPECIFIC PARAMS
paramsMap.put("ZOHO_REFVIEW", "");
paramsMap.put("ZOHO_FOLDERNAME", "");
paramsMap.put("ISCOPYCUSTOMFORMULA", "");
paramsMap.put("ISCOPYAGGFORMULA", "");
response = invokeurl[url: "https://analyticsapi.zoho.com/api/" + email + "/" + workspaceName
type: POST parameters: paramsMap headers: headers];
info response;