Wizards API

A Wizard helps you divide a long form into a series of screens, where users can enter data on each screen as they proceed to the next step until completion. Wizards reduce the chances of errors during data entry as the screens can be partially saved as a draft and submitted later. For more details, refer to Wizards in Zoho CRM.

Purpose

To get the details of the wizards in a module.

Request Details

Request URL

All wizards - {api-domain}/crm/{version}/settings/wizards
Layout-specific wizard - {api-domain}/crm/{version}/settings/wizards/{wizard_ID}?layout_id={layout_ID}

Supported modules

Leads, Contacts, Deals, Accounts, and custom

Header

Authorization: Zoho-oauthtoken <access_token>

Scope

Scope = ZohoCRM.settings.wizards.READ

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v2.1/settings/wizards"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
4.0.0
Copied//Get instance of WizardsOperations Class
$wizardsOperations = new WizardsOperations();
//Call getWizards method
$response = $wizardsOperations->getWizards();
Copied<?php
class GetWizards{
    
    public function execute(){
        $curl_pointer = curl_init();
        
        $curl_options = array();
        $url = "https://www.zohoapis.com/crm/v2/settings/wizards?";
        $parameters = array();
        $parameters["layout_id"]="34770610087501";

        foreach ($parameters as $key=>$value){
            $url =$url.$key."=".$value."&";
        }
        $curl_options[CURLOPT_URL] = $url;
        $curl_options[CURLOPT_RETURNTRANSFER] = true;
        $curl_options[CURLOPT_HEADER] = 1;
        $curl_options[CURLOPT_CUSTOMREQUEST] = "GET";
        $headersArray = array();
        $headersArray[] = "Authorization". ":" . "Zoho-oauthtoken " ."1000.30f3a589XXXXXXXXXXXXXXXXXXX4077.dc5XXXXXXXXXXXXXXXXXXXee9e7c171c";
        $curl_options[CURLOPT_HTTPHEADER]=$headersArray;
        
        curl_setopt_array($curl_pointer, $curl_options);
        
        $result = curl_exec($curl_pointer);
        $responseInfo = curl_getinfo($curl_pointer);
        curl_close($curl_pointer);
        list ($headers, $content) = explode("\r\n\r\n", $result, 2);
        if(strpos($headers," 100 Continue")!==false){
            list( $headers, $content) = explode( "\r\n\r\n", $content , 2);
        }
        $headerArray = (explode("\r\n", $headers, 50));
        $headerMap = array();
        foreach ($headerArray as $key) {
            if (strpos($key, ":") != false) {
                $firstHalf = substr($key, 0, strpos($key, ":"));
                $secondHalf = substr($key, strpos($key, ":") + 1);
                $headerMap[$firstHalf] = trim($secondHalf);
            }
        }
        $jsonResponse = json_decode($content, true);
        if ($jsonResponse == null && $responseInfo['http_code'] != 204) {
            list ($headers, $content) = explode("\r\n\r\n", $content, 2);
            $jsonResponse = json_decode($content, true);
        }
        var_dump($headerMap);
        var_dump($jsonResponse);
        var_dump($responseInfo['http_code']);
        
    }
    
}
(new GetWizards())->execute();

Sample Response

Copied{
    "wizards": [
        {
            "created_time": "2021-01-21T06:28:21+05:30",
            "modified_time": "2021-01-21T06:28:21+05:30",
            "module": {
                "api_name": "Leads",
                "id": "3652397000000002175"
            },
            "name": "wizard1",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            },
            "profiles": [
                {
                    "name": "Administrator",
                    "id": "3652397000000026011"
                },
                {
                    "name": "Standard",
                    "id": "3652397000000026014"
                },
                {
                    "name": "Free",
                    "id": "3652397000001614008"
                }
            ],
            "active": true,
            "containers": [
                {
                    "layout": {
                        "name": "Standard",
                        "id": "3652397000000091055"
                    },
                    "id": "3652397000000091055"
                }
            ],
            "id": "3652397000003677001",
            "created_by": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            }
        },
        {
            "created_time": "2021-01-21T07:11:06+05:30",
            "modified_time": "2021-01-21T07:11:06+05:30",
            "module": {
                "api_name": "Contacts",
                "id": "3652397000000002179"
            },
            "name": "wizard2",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            },
            "profiles": [
                {
                    "name": "Administrator",
                    "id": "3652397000000026011"
                }
            ],
            "active": true,
            "containers": [
                {
                    "layout": {
                        "name": "Standard",
                        "id": "3652397000000091033"
                    },
                    "id": "3652397000000091033"
                }
            ],
            "id": "3652397000003677031",
            "created_by": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            }
        }
    ]
}
Parameters
  • layout_idstring, mandatory when you want to fetch a layout-specific wizard

    The ID of the layout that you want to fetch the wizard's details from. Use the Layouts MetaData API to obtain the ID of the layout.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v2.1/settings/wizards/3652397000003677001?layout_id=3652397000000091055"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Possible Errors

  • REQUIRED_PARAM_MISSINGHTTP 400

    You have not specified the layout ID in the request.

    Resolution: "layout_id" is a mandatory parameter when you want to fetch the details of a particular wizard in a module.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    You do not have the scope required to use this API.
    Resolution: Use the correct scope and generate the grant and access tokens to use this API.

  • NO_PERMISSIONHTTP 403

    You do not have permission to use this API.
    Resolution: Contact your administrator.

Sample Response

Copied{
    "wizards": [
        {
            "created_time": "2021-01-21T06:28:21+05:30",
            "modified_time": "2021-01-21T06:28:21+05:30",
            "module": {
                "api_name": "Leads",
                "id": "3652397000000002175"
            },
            "name": "wizard1",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            },
            "profiles": [
                {
                    "name": "Administrator",
                    "id": "3652397000000026011"
                },
                {
                    "name": "Standard",
                    "id": "3652397000000026014"
                },
                {
                    "name": "Free",
                    "id": "3652397000001614008"
                }
            ],
            "active": true,
            "containers": [
                {
                    "layout": {
                        "name": "Standard",
                        "id": "3652397000000091055"
                    },
                    "chart_data": {
                        "nodes": [
                            {
                                "pos_y": 180,
                                "pos_x": 420,
                                "start_node": true,
                                "screen": {
                                    "display_label": "Screen 1",
                                    "id": "3652397000003677007"
                                }
                            },
                            {
                                "pos_y": 178,
                                "pos_x": 762,
                                "start_node": false,
                                "screen": {
                                    "display_label": "screen 2",
                                    "id": "3652397000003679024"
                                }
                            }
                        ],
                        "connections": [
                            {
                                "source_button": {
                                    "display_label": "Next",
                                    "id": "3652397000003677020"
                                },
                                "target_screen": {
                                    "display_label": "screen 2",
                                    "id": "3652397000003679024"
                                }
                            }
                        ]
                    },
                    "screens": [
                        {
                            "display_label": "screen 2",
                            "id": "3652397000003679024",
                            "segments": [
                                {
                                    "sequence_number": 1,
                                    "display_label": "Status and Source",
                                    "column_count": 2,
                                    "id": "3652397000003679026",
                                    "type": "fields",
                                    "fields": [
                                        {
                                            "sequence_number": 1,
                                            "api_name": "Owner",
                                            "id": "3652397000000002589"
                                        },
                                        {
                                            "sequence_number": 3,
                                            "api_name": "Lead_Status",
                                            "id": "3652397000000002611"
                                        },
                                        {
                                            "sequence_number": 5,
                                            "api_name": "Lead_Source",
                                            "id": "3652397000000002609"
                                        },
                                        {
                                            "sequence_number": 7,
                                            "api_name": "mailchimp0__Status",
                                            "id": "3652397000001634977"
                                        }
                                    ]
                                },
                                {
                                    "sequence_number": 2,
                                    "display_label": "Dummy",
                                    "buttons": [
                                        {
                                            "display_label": "Save",
                                            "sequence_number": 1,
                                            "color": "#fff",
                                            "background_color": "#1161B5",
                                            "shape": "square",
                                            "visibility": "disable",
                                            "criteria": {
                                                "comparator": "equal",
                                                "field": {
                                                    "api_name": "Lead_Source",
                                                    "id": "3652397000000002609"
                                                },
                                                "value": "${EMPTY}"
                                            },
                                            "target_screen": null,
                                            "id": "3652397000003679034",
                                            "type": "save",
                                            "transition": null
                                        }
                                    ],
                                    "column_count": 2,
                                    "id": "3652397000003679036",
                                    "type": "buttons"
                                }
                            ]
                        },
                        {
                            "display_label": "Screen 1",
                            "id": "3652397000003677007",
                            "segments": [
                                {
                                    "sequence_number": 1,
                                    "display_label": "Personal Details",
                                    "column_count": 2,
                                    "id": "3652397000003677009",
                                    "type": "fields",
                                    "fields": [
                                        {
                                            "sequence_number": 1,
                                            "api_name": "Last_Name",
                                            "id": "3652397000000002595"
                                        },
                                        {
                                            "sequence_number": 3,
                                            "api_name": "Email",
                                            "id": "3652397000000002599"
                                        },
                                        {
                                            "sequence_number": 5,
                                            "api_name": "Company",
                                            "id": "3652397000000002591"
                                        },
                                        {
                                            "sequence_number": 7,
                                            "api_name": "Phone",
                                            "id": "3652397000000002601"
                                        },
                                        {
                                            "sequence_number": 9,
                                            "api_name": "Skype_ID",
                                            "id": "3652397000000014173"
                                        },
                                        {
                                            "sequence_number": 11,
                                            "api_name": "First_Name",
                                            "id": "3652397000000002593"
                                        },
                                        {
                                            "sequence_number": 11,
                                            "api_name": "Salutation",
                                            "id": "3652397000000022011"
                                        }
                                    ]
                                },
                                {
                                    "sequence_number": 2,
                                    "display_label": "Dummy",
                                    "buttons": [
                                        {
                                            "display_label": "Next",
                                            "sequence_number": 1,
                                            "color": "#fff",
                                            "background_color": "#1161B5",
                                            "shape": "capsule",
                                            "visibility": "disable",
                                            "criteria": {
                                                "comparator": "equal",
                                                "field": {
                                                    "api_name": "Company",
                                                    "id": "3652397000000002591"
                                                },
                                                "value": "${EMPTY}"
                                            },
                                            "target_screen": {
                                                "name": "screen 2",
                                                "id": "3652397000003679024"
                                            },
                                            "id": "3652397000003677020",
                                            "type": "transition",
                                            "transition": null
                                        }
                                    ],
                                    "column_count": 2,
                                    "id": "3652397000003677022",
                                    "type": "buttons"
                                }
                            ]
                        }
                    ],
                    "id": "3652397000000091055"
                }
            ],
            "id": "3652397000003677001",
            "created_by": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            }
        }
    ]
}