Get Shared Details For Views

Returns shared details of the specified views.

REQUEST URI

https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/share/shareddetails

Get

oauthscopeZohoAnalytics.share.read

QUERY PARAMETERS

Parameter NameDescription
CONFIG*JSONObject

Config parameter specifications are available in the below section.

FIELDS FOR CONFIG JSON

KeyDescription
viewIdsJSONArray

View ids for which shared details need to be fetched.

POSSIBLE ERROR CODES

7103 , 7104 , 7301 , 8504 , 8083

Sample Request:

Copiedcurl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/share/shareddetails?CONFIG=<encoded_json_value>
-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 = 67648404;
        long workspaceId = 1148746000002449012;

        public void GetSharedDetailsForViews(IAnalyticsClient ac)
        {
            IWorkspaceAPI ws = ac.GetWorkspaceInstance(orgId, workspaceId);
            List<long> viewIds = new List<long>();
            viewIds.Add(1148746000002449002);
            JsonElement sharedDetails = ws.GetSharedDetailsForViews(viewIds);
            Console.WriteLine(sharedDetails);
        }

        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.GetSharedDetailsForViews(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"
    workspaceId = "35130000001055707"
)

func GetSharedDetailsForViews(ac ZAnalytics.Client) {

    viewids := [1]string{}
    viewids[0] = "35130000001354002"

    workspace := ZAnalytics.GetWorkspaceInstance(&ac, orgId, workspaceId)
    result, exception := workspace.GetSharedDetailsForViews(viewids)
    if(exception != nil){
        fmt.Println(exception.ErrorMessage)
    }else{
        fmt.Println(result)
    }
}

func main() {

    ac := ZAnalytics.GetAnalyticsClient(clientId, clientSecret, refreshToken)
    GetSharedDetailsForViews(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.getSharedDetailsForViews(ac);
        }
        catch (ServerException ex) {
            System.out.println("Server exception - ErrorCode : " + ex.getErrorCode() + ", ErrorMessage : "  + ex.getErrorMessage());
        }
        catch (ParseException ex) {
            System.out.println("Parser exception - ErrorMessage : "  + ex.getResponseMessage());
        }
        catch (Exception ex) {
            System.out.println("Other exception - ");
            ex.printStackTrace();
        }
    }

    public void getSharedDetailsForViews(AnalyticsClient ac) throws Exception {
        WorkspaceAPI workspace = ac.getWorkspaceInstance(orgId, workspaceId);
        JSONArray viewIds = new JSONArray();
        viewIds.put("1148746000002449002");
        JSONArray result = workspace.getSharedDetailsForViews(viewIds);
        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";
        public $workspace_id = "35130000001055707";

        function __construct() {
            $this->ac =  new AnalyticsClient($this->client_id, $this->client_secret, $this->refresh_token);
        }

        function getSharedDetailsForViews() {
            $view_ids = array("1767024000008742002", "1767024000008742002");
            $workspace = $this->ac->getWorkspaceInstance($this->org_id, $this->workspace_id, $this->view_id);
            $response = $workspace->getSharedDetailsForViews($view_ids);
            print_r($response);
        }
    }

    $test_obj = new Test();

    try {
        $test_obj->importBulkDataAsBatches();
    }
    catch(ServerException $se) {
        echo "Server exception : " . $se->getErrorMessage() . "\n";
    }
    catch(IOException $ioe) {
        echo "IO exception : " . $ioe->getErrorMessage() . "\n";
    }
    catch(ParseException $pe) {
        echo "Parser exception : " . $pe->getErrorMessage() . "\n";
    }
    catch(Exception $e) {
        echo "Exception : " . $e->getErrorMessage() . "\n";
    }
?>
Copiedfrom __future__ import with_statement
from AnalyticsClient import AnalyticsClient
import sys
import json

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_shared_details_for_views(self, ac):
        view_ids = []
        view_ids.append("1148746000002449002")

        workspace = ac.get_workspace_instance(Config.ORGID, Config.WORKSPACEID)
        result = workspace.get_shared_details_for_views(view_ids)

try:
    obj = sample()
    obj.get_shared_details_for_views(obj.ac);

except Exception as e:
    print(str(e))
Copiedvar nodelib = require('./ZAnalyticsClient');

var clientId = '1000.xxxxxxx';
var clientSecret = 'xxxxxxx';
var refreshtoken = '1000.xxxxxxx.xxxxxxx';
var orgId = '55522777';
var workspaceId = '35130000001055707';

var viewIds = [];
viewIds.push("");
viewIds.push("");


var ac = new analyticsClient(clientId, clientSecret, refreshtoken);

var workspace = ac.getWorkspaceInstance(orgId, workspaceId);
workspace.getSharedDetailsForViews(viewIds).then((response) => {
    console.log(response);

}).catch((error) => {
    console.log('errorCode : '+error.errorCode);
    console.log('errorMessage : '+error.errorMessage);
});
CopiedorgId = "55522777";
workspaceId = "35130000001055707";

headersMap = Map();
headersMap.put("ZANALYTICS-ORGID",orgId);

viewIds = {};
viewIds.add("35130000003471855");
viewIds.add("35130000004032008");

config = Map();
config.put("viewIds", viewIds);
paramsMap = Map();
paramsMap.put("CONFIG",config.toString());

response = invokeurl
[
    url :"https://analyticsapi.zoho.com/restapi/v2/workspaces/" + workspaceId + "/share/shareddetails"
    type :GET
    parameters:paramsMap
    headers:headersMap
    connection:"analytics_oauth_connection"
];
info response;

Download SDK:  C# | GO | JAVA | PHP | PYTHON | NodeJS

Sample value for CONFIG parameter

Copied{
  "viewIds": ["<view-id1>", "<view-id2>"]
}

Sample Response

CopiedHTTP/1.1 200 OK
Content-Type:application/json;charset=UTF-8


{
	"status": "success",
	"summary": "Get shared details for view",
	"data": {
	"sharedDetails": [{
	"viewId": "1669024000008741002",
	"shareInfo": [{
	"sharedTo": "Public Visitor",
	"sharedBy": "admin@finepick.com",
	"sharedToZuId": "-20",
	"permissionString": "Read Access",
	"permissions": {
	"read": true,
	"export": false,
	"vud": false,
	"addRow": false,
	"updateRow": false,
	"deleteRow": false,
	"deleteAllRows": false,
	"importAppend": false,
	"importAddOrUpdate": false,
	"importDeleteAllAdd": false,
	"importDeleteUpdateAdd": false,
	"share": false,
	"drillDown": false,
	"discussion": false,
	"insight": false
	},
	"criteria": "",
	"inheritParentFilterCriteria": "false",
	"isInvalidCriteria": false,
	"sharedColumns": [],
	"vudColumns": [],
	"drillColumns": [],
	"isGroupShare": false,
	"publicPermLevel": 1,
	"isROUser": false
	}, {
	"sharedTo": "user2@finepick.com",
	"sharedBy": "admin@finepick.com",
	"sharedToZuId": "64531012",
	"permissionString": "Read Access, Allow Commenting",
	"permissions": {
	"read": true,
	"export": false,
	"vud": false,
	"addRow": false,
	"updateRow": false,
	"deleteRow": false,
	"deleteAllRows": false,
	"importAppend": false,
	"importAddOrUpdate": false,
	"importDeleteAllAdd": false,
	"importDeleteUpdateAdd": false,
	"share": false,
	"drillDown": false,
	"discussion": true,
	"insight": false
	},
	"criteria": "",
	"inheritParentFilterCriteria": "true",
	"isInvalidCriteria": false,
	"sharedColumns": [],
	"vudColumns": [],
	"drillColumns": [],
	"isGroupShare": false,
	"publicPermLevel": 0,
	"isROUser": true
	}]
	}, {
	"viewId": "1669024000008741004",
	"shareInfo": [{
	"sharedTo": "Private Link",
	"sharedBy": "admin@finepick.com",
	"sharedToZuId": "-30",
	"permissionString": "Read Access",
	"permissions": {
	"read": true,
	"export": false,
	"vud": false,
	"addRow": false,
	"updateRow": false,
	"deleteRow": false,
	"deleteAllRows": false,
	"importAppend": false,
	"importAddOrUpdate": false,
	"importDeleteAllAdd": false,
	"importDeleteUpdateAdd": false,
	"share": false,
	"drillDown": false,
	"discussion": false,
	"insight": false
	},
	"criteria": "",
	"inheritParentFilterCriteria": "false",
	"isInvalidCriteria": false,
	"sharedColumns": [],
	"vudColumns": [],
	"drillColumns": [],
	"isGroupShare": false,
	"publicPermLevel": 0,
	"isROUser": false
	}]
	}]
	}
}