Update Slideshow

Update details of the specified slideshow.

REQUEST URI

https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/slides/<slide-id>

Put

oauthscopeZohoAnalytics.embed.update

QUERY PARAMETERS

 

Parameter Name
Description
CONFIG*JSONObject

Config parameter specifications are available in the below section.

FIELDS FOR CONFIG JSON

KeyDescription
slideNameString

The new name of the slide.
viewIdsJSONArray

View ids to be included in the slideshow.

Sample: ["viewId1","viewId2"]
regenerateSlideKeyBoolean

To generate a new slidekey, previously generated link will be disabled.
Default value - false.
accessType

Integer

To mention the access type of the slideshow. 
Default value - 0.

Allowed values for accessType attribute

0 - Access With Login
1 - Access without login
2 - Sort 

POSSIBLE ERROR CODES

7103, 7104, 7301, 7387, 7395, 8083, 8518, 8535

Sample Request:

Copiedcurl https://analyticsapi.zoho.com/restapi/v2/workspaces/<workspace-id>/slides/<slide-id>?CONFIG=<encoded_json_value> 
-X 'PUT' 
-H 'ZANALYTICS-ORGID: <org-id>' 
-H 'Authorization: Zoho-oauthtoken <access_token>'
Copiedusing System;
using System.Collections.Generic;
using ZohoAnalytics;

namespace ZohoAnalyticsTest
{
    class Program
    {
        long orgId = 55522777;
        long workspaceId = 35130000001055707;

        public void UpdateSlideshow(IAnalyticsClient ac)
        {
            long slideId = 114874600000267890;
            List<long> viewIds = new List<long>();
            viewIds.Add(35730000007354002);

            Dictionary<string, object> config = new Dictionary<string, object>();
            config.Add("viewIds", viewIds);
            IWorkspaceAPI workspace = ac.GetWorkspaceInstance(orgId, workspaceId);
            workspace.UpdateSlideshow(slideId, config);
        }

        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.UpdateSlideshow(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 UpdateSlideshow(ac ZAnalytics.Client) {
    slideid := "1767024000003151001"

    config := map[string]interface{}{}
    slidename := "NewSlidename"
    viewids := [1]string{}
    viewids[0] = "35130000001354002"

    config["slideName"] = slidename
    config["viewIds"] = viewids
    workspace := ZAnalytics.GetWorkspaceInstance(&ac, orgId, workspaceId)
    exception := workspace.UpdateSlideshow(slideid, config)

    if(exception != nil){
        fmt.Println(exception.ErrorMessage)
    }else{
        fmt.Println("success")
    }
}

func main() {

    ac := ZAnalytics.GetAnalyticsClient(clientId, clientSecret, refreshToken)
    UpdateSlideshow(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.updateSlideshow(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 updateSlideshow(AnalyticsClient ac) throws Exception {
        long slideId = 148746000002541001l;
        String slideName = "NewSlidename";
        JSONArray viewIds = new JSONArray();
        viewIds.put("35130000001354002");

        JSONObject config = new JSONObject();
        config.put("slideName", slideName);
        config.put("viewIds", viewIds);
        WorkspaceAPI workspace = ac.getWorkspaceInstance(orgId, workspaceId);
        workspace.updateSlideshow(slideId, config);
        System.out.println("success");
    }
}
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 updateSlideshow() {
            $slide_id = "1767024000003151001";
            $slide_name = "NewSlidename";
            $view_ids = array("35130000001080001", "35130000001080082");

            $config = array();
            $config["slideName"] = $slide_name;
            $config["viewIds"] = $view_ids;
            $workspace = $this->ac->getWorkspaceInstance($this->org_id, $this->workspace_id);
            $workspace->updateSlideshow($slide_id, $config);
        }
    }

    $test_obj = new Test();

    try {
        $test_obj->updateSlideshow();
    }
    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 update_slideshow(self, ac):
        slide_id = "1767024000003151001"

        config = {}
        config["slideName"] = "NewSlidename"
        config["accessType"] = "1"
        view_ids = []
        view_ids.append("35130000001102001")
        view_ids.append("35130000001102034")
        config["viewIds"] = view_ids

        workspace = ac.get_workspace_instance(Config.ORGID, Config.WORKSPACEID)
        workspace.update_slideshow(slide_id, config)
        print("success")

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

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

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

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

var slideId = '1767024000003151001';
var slideName = 'NewSlidename';
var viewIds = [];
viewIds.push('35130000001102001');
viewIds.push('35130000001102034');

var config = {};
config["slideName"] = slideName;
config["viewIds"] = viewIds;
var workspace = ac.getWorkspaceInstance(orgId, workspaceId);
workspace.updateSlideshow(slideId, config).catch((error) => {
    console.log('errorCode : '+error.errorCode);
    console.log('errorMessage : '+error.errorMessage);
});
CopiedorgId = "55522777";
workspaceId = "35130000001055707";
slideId = "5888000000222001";

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

slideName = "NewSlidename";

config = Map();
config.put("slideName",slideName);
parameters = "CONFIG=" + zoho.encryption.urlEncode(config.toString());
response = invokeurl
[
  url :"https://analyticsapi.zoho.com/restapi/v2/workspaces/" + workspaceId + "/slides/" + slideId + "?" + parameters
  type :PUT
  headers:headersMap
  connection:"analytics_oauth_connection"
];

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

Sample value for CONFIG parameter:

Copied{
  "slideName": "<slide-name>"
}

Sample Response:

CopiedHTTP/1.1 204 No Content