Blueprint APIs

Zoho CRM's Blueprint is simply an online replica of a business process. It captures every detail of your entire offline process within the software. It facilitates automation, validation, and collaboration of teams, thus making your process more efficient and free from loopholes.

Get Blueprint Data

Purpose

To get the next available transitions for that record, fields available for each transitions, current value of each field, and their validation(if any).

Request Details

Request URL

{api-domain}/crm/{version}/{module_api_name}/{record_id}/actions/blueprint

Supported modules

Leads, Accounts, Contacts, Deals, Campaigns, Tasks, Cases, Events, Calls, Solutions, Products, Vendors, Price Books, Quotes, Sales Orders, Purchase Orders, Invoices, Custom, Notes, and Activities

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope=ZohoCRM.modules.ALL
(or)
scope=ZohoCRM.modules.{module_name}.{operation_type}

Possible module names

leads, accounts, contacts, deals, campaigns, tasks, cases, events, calls, solutions, products, vendors, pricebooks, quotes, salesorders, purchaseorders, invoices, custom, notes, and activities

Possible operation types

ALL - Full access to records
READ - Get records from a module

Note
  • A transition can be either automatic or manual. In an automatic transition, a record moves to the next stage automatically after the set time period in the current stage has elapsed. The type key under transitions refers to the type of transition in the current state, while the type key under next_transitions represents the transition type in the next transition.

  • You can choose the escalation time period for a state. You can perform actions such as sending an email alert, triggering a webhook etc,. once it reaches the escalation time. This time period is defined in the escalation key under process_info.

  • In a parallel transition, a transition can have multiple child transitions. The parent transition gets completed automatically only when all its child transitions are completed. We will introduce this feature in v2.1 later. Refer to this announcement for more details.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v2.1/Leads/3652397000003917041/actions/blueprint"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
4.0.04.x
Copied//Get instance of BluePrintOperations Class that takes recordId and moduleAPIName as parameter
$bluePrintOperations = new BluePrintOperations($recordId,$moduleAPIName);
//Call getBlueprint method
$response = $bluePrintOperations->getBlueprint();
Copied<?php
class GetBluePrint{

    public function execute(){
        $curl_pointer = curl_init();
        
        $curl_options = array();
        $curl_options[CURLOPT_URL] = "https://www.zohoapis.com/crm/v2.1/Leads/3524033000005811001/actions/blueprint";
        $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 GetBluePrint())->execute();
2.1.0
Copied# Get instance of BluePrintOperations Class that takes module_api_name and record_id as parameter
bpo = BluePrint::BluePrintOperations.new(record_id, module_api_name)
# Call get_blueprint method
response = bpo.get_blueprint
Copiedrequire 'net/http'
class GetBluePrint

    def execute
        url = URI("https://www.zohoapis.com/crm/v2.1/Leads/3524033000005495065/actions/blueprint")
        req = Net::HTTP::Get.new(url.request_uri)
        http = Net::HTTP.new(url.host, url.port)
        http.use_ssl = true
        headers={}
        headers["Authorization"]="Zoho-oauthtoken 1000.dfa7XXXXXXXXXXXXXXXXXX84f9665840.c176aeXXXXXXXXXXXX13f3d37a84d"
        headers&.each { |key, value| req.add_field(key, value) }
        response=http.request(req)
        status_code = response.code.to_i
        headers = response.each_header.to_h
        print status_code
        print headers
        unless response.body.nil?
            print  response.body
        end
    end
end

GetBluePrint.new.execute
Copiedresponse = invokeurl
[
	url: "https://www.zohoapis.com/crm/v2.1/Leads/3652397000003917041/actions/blueprint"
	type: GET
	connection:"crm_oauth_connection"
];
info response;

Possible Errors

  • INVALID_MODULEHTTP 400

    The module name given seems to be invalid
    Resolution: You have specified an invalid module name or there is no tab permission, or the module could have been removed from the available modules. Specify a valid module API name.

  • INVALID_MODULEHTTP 400

    The given module is not supported in API
    Resolution: The modules such as Documents and Projects are not supported in the current API. (This error will not be shown, once these modules are been supported). Specify a valid module API name.

  • INVALID_URL_PATTERNHTTP 404

    Please check if the URL trying to access is a correct one
    Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to request URL section above.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized
    Resolution: Client does not have ZohoCRM.modules.{module_name}.READ scope. Create a new client with valid scope. Refer to scope section above.

  • NO_PERMISSIONHTTP 403

    Permission denied to read records
    Resolution: The user does not have permission to read blueprint data. Contact your system administrator.

  • INTERNAL_ERRORHTTP 500

    Internal Server Error
    Resolution: Unexpected and unhandled exception in Server. Contact support team.

  • RECORD_NOT_IN_PROCESSHTTP 400

    Record not in process
    Resolution: You have specified a record that is not in any process. Specify another record id.

  • INVALID_REQUEST_METHODHTTP 400

    The http request method type is not a valid one
    Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to endpoints section above.

  • AUTHORIZATION_FAILEDHTTP 400

    User does not have sufficient privilege to read records
    Resolution: The user does not have the permission to read blueprint data. Contact your system administrator.

Note
  • A transition can be either automatic or manual. In an automatic transition, a record moves to the next stage automatically after the set time period in the current stage has elapsed. The type key under transitions refers to the type of transition in the current state, while the type key under next_transitions represents the transition type in the next transition.

  • When a transition is set to automatic, you can choose the time period that a record can stay in a particular state before moving to the next. This time period is defined in the escalation key under process_info. The value for "escalation" will be null for manual transitions.

  • In a parallel transition, a transition can have multiple child transitions. The parent transition gets completed automatically only when all its child transitions are completed. We will introduce this feature later. Refer to this announcement for more details.

Sample Response

Copied{
    "blueprint": {
        "process_info": {
            "field_id": "1065415000000000575",
            "escalation": null,
            "is_continuous": false,
            "api_name": "Lead_Status",
            "continuous": false,
            "field_label": "Lead Status",
            "name": "Lead nurturing process",
            "column_name": "STATUS",
            "field_value": "Not Contacted",
            "id": "1065415000000342585",
            "field_name": "Lead Status"
        },
        "transitions": [
            {
                "next_transitions": [],
                "data": {
                    "Multi_User_Lookup": [],
                    "Multi_Select_Lookup_Contacts": []
                },
                "next_field_value": "Contacted",
                "name": "Establish contact",
                "criteria_matched": true,
                "id": "1065415000000342606",
                "fields": [
                    {
                        "system_mandatory": false,
                        "private": null,
                        "webhook": false,
                        "json_type": "jsonarray",
                        "crypt": null,
                        "field_label": "Multi-User Lookup",
                        "tooltip": null,
                        "created_source": "default",
                        "layouts": {
                            "name": "Standard",
                            "id": "1065415000000095055"
                        },
                        "field_read_only": false,
                        "content": [],
                        "display_label": "Multi-User Lookup",
                        "display_type": -1,
                        "ui_type": 445,
                        "validation_rule": null,
                        "read_only": false,
                        "association_details": null,
                        "multi_module_lookup": {},
                        "currency": {},
                        "id": "1065415000003443727",
                        "multiuserlookup": {
                            "display_label": "Users",
                            "linking_module": "Leads_X_Users",
                            "lookup_apiname": "userlookup221_5",
                            "connected_module": null,
                            "api_name": "Users5",
                            "connectedlookup_apiname": "Multi_User_Lookup",
                            "id": "1065415000003443859"
                        },
                        "custom_field": true,
                        "lookup": {},
                        "convert_mapping": {
                            "Contacts": null,
                            "Deals": null,
                            "Accounts": null
                        },
                        "visible": false,
                        "profiles": [
                            {
                                "permission_type": "read_write",
                                "name": "Administrator",
                                "id": "1065415000000015972"
                            },
                            {
                                "permission_type": "read_write",
                                "name": "Standard",
                                "id": "1065415000000015975"
                            },
                            {
                                "permission_type": "read_write",
                                "name": "custom profile",
                                "id": "1065415000003074751"
                            }
                        ],
                        "length": 50,
                        "column_name": "MXNDUMMYCOLUMN5",
                        "_type": "fields",
                        "view_type": {
                            "view": true,
                            "edit": true,
                            "quick_create": false,
                            "create": true
                        },
                        "pick_list_values_sorted_lexically": false,
                        "sortable": false,
                        "transition_sequence": 4,
                        "external": null,
                        "api_name": "Multi_User_Lookup",
                        "unique": {},
                        "history_tracking": null,
                        "data_type": "multiuserlookup",
                        "formula": {},
                        "decimal_place": null,
                        "pick_list_values": [],
                        "auto_number": {}
                    },
                    {
                        "system_mandatory": false,
                        "private": null,
                        "webhook": false,
                        "json_type": "jsonarray",
                        "crypt": null,
                        "field_label": "Multi-Select-Lookup-Contacts",
                        "tooltip": null,
                        "created_source": "default",
                        "layouts": {
                            "name": "Standard",
                            "id": "1065415000000095055"
                        },
                        "field_read_only": false,
                        "content": [],
                        "display_label": "Multi-Select-Lookup-Contacts",
                        "display_type": -1,
                        "ui_type": 444,
                        "validation_rule": null,
                        "read_only": false,
                        "association_details": null,
                        "multi_module_lookup": {},
                        "currency": {},
                        "id": "1065415000003446220",
                        "custom_field": true,
                        "lookup": {},
                        "convert_mapping": {
                            "Contacts": null,
                            "Deals": null,
                            "Accounts": null
                        },
                        "visible": false,
                        "profiles": [
                            {
                                "permission_type": "read_write",
                                "name": "Administrator",
                                "id": "1065415000000015972"
                            },
                            {
                                "permission_type": "read_write",
                                "name": "Standard",
                                "id": "1065415000000015975"
                            },
                            {
                                "permission_type": "read_write",
                                "name": "custom profile",
                                "id": "1065415000003074751"
                            }
                        ],
                        "length": 50,
                        "column_name": "MXNDUMMYCOLUMN6",
                        "_type": "fields",
                        "view_type": {
                            "view": true,
                            "edit": true,
                            "quick_create": false,
                            "create": true
                        },
                        "pick_list_values_sorted_lexically": false,
                        "sortable": false,
                        "transition_sequence": 5,
                        "external": null,
                        "api_name": "Multi_Select_Lookup_Contacts",
                        "unique": {},
                        "history_tracking": null,
                        "data_type": "multiselectlookup",
                        "formula": {},
                        "decimal_place": null,
                        "multiselectlookup": {
                            "display_label": "Contacts",
                            "linking_module": "Lead_Contact_Linking_Modu",
                            "lookup_apiname": "Multi_Select_Lookup_Leads",
                            "connected_module": "Contacts",
                            "api_name": "Contacts6",
                            "connectedlookup_apiname": "Multi_Select_Lookup_Contacts",
                            "id": "1065415000003446352"
                        },
                        "pick_list_values": [],
                        "auto_number": {}
                    }
                ],
                "type": "manual",
                "criteria_message": null,
                "percent_partial_save": 0,
                "execution_time": null
            },
            {
                "next_transitions": [],
                "data": {
                    "widget": {
                        "name": "Name1",
                        "id": "1065415000003439878"
                    }
                },
                "next_field_value": "Attempted to Contact",
                "name": "No answer",
                "criteria_matched": true,
                "id": "1065415000000342609",
                "fields": [
                    {
                        "display_label": null,
                        "data_type": "widget",
                        "_type": "widget",
                        "column_name": null,
                        "personality_name": null,
                        "id": "0",
                        "transition_sequence": 1,
                        "mandatory": true,
                        "layouts": null
                    }
                ],
                "type": "manual",
                "criteria_message": null,
                "percent_partial_save": 0,
                "execution_time": null
            }
        ]
    }
}