Create a Calendar View

Purpose

Use this API to create calendar views. Each user can create calendar views that include users below their role in the hierarchy or the user groups they are a part of.

Endpoints

  • POST /settings/calendar

Request Details

Request URL

{api-domain}/crm/{version}/settings/calendar

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

ZohoCRM.settings.calendar.ALL
(or)
ZohoCRM.settings.calendar.CREATE

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v8/settings/calendar"
-X POST
-d "@input.json"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Request JSON Keys

  • namestring, mandatory

    Represents the name of the calendar view. Accepts alphanumeric characters.

  • usersJSON array, mandatory if you do not include "user_groups"

    Each JSON object in this array represents the record ID and name of the users you want to add to this calendar view. Use the Get Users API to get the name and ID of the users in your org. Note that you can include either "users" or "user_groups" array in the input.

  • user_groupsJSON array, mandatory if you do not include "users"

    Each JSON object in this array represents the record ID and name of the user groups you want to add to this calendar view. Use the Get User Groups API to get the name and ID of the user groups in your org. Note that you can include either "users" or "user_groups" array in the input.

Sample Input

Copied{
    "calendar": [
        {
            "name": "Calendar_Patricia",
            "users":[
                {
                    "id": "554023000000235011",
                    "name":"Patricia Boyle"
                }
            ]
        }
    ]
}

Possible Errors

  • INVALID_DATAHTTP 400

    The input has a value of an invalid JSON datatype.
    Resolution: Refer to the "details" key in the response for the exact error. Refer to the Request JSON section for the accepted keys and their datatypes.

  • MANDATORY_NOT_FOUNDHTTP 400

    You have not specified one or more mandatory fields in the input.
    Resolution: Refer to the Request JSON section for all the mandatory keys in the input.

  • AMBIGUITY_DURING_PROCESSINGHTTP 400

    You have included both "users" and "user_groups" in the input.
    Resolution: It is sufficient to input either of these keys in the input.

  • EXPECTED_FIELD_MISSINGHTTP 400

    You have not included users or user_groups in the input.
    Resolution: You must include either of these keys.

  • LIMIT_EXCEEDEDHTTP 400

    You have created more calendar views than the allowed limit.
    Resolution: You can create a maximum of 30 calendar views per user.

  • MANDATORY_NOT_FOUNDHTTP 400

    You have not include the "name" key in the input.
    Resolution: The "name" key is mandatory in the input. Refer to the "Request JSON section for the mandatory keys.

  • INVALID_REQUEST_METHODHTTP 400

    The request method is incorrect.
    Resolution: Use the HTTP POST method to make this API call. Any other request method will result in this error.

  • AUTHORIZATION_FAILEDHTTP 400

    You do not have sufficient permission to add calendar views.
    Resolution: Contact your system administrator.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    The access token you have used to make this API call does not have the required scope.
    Resolution: Generate a new access token with the scope ZohoCRM.settings.calendar.CREATE or ZohoCRM.settings.calendar.ALL.

  • NO_PERMISSIONHTTP 403

    You do not have permission to create calendar views.
    Resolution: Contact your system administrator.

  • INVALID_URL_PATTERNHTTP 404

    The request URL is incorrect.
    Resolution: Specify a valid request URL. Refer to the Request URL section for the right URL.

  • INTERNAL_ERRORHTTP 500

    Unexpected and unhandled exception in the server. 
    Resolution: Contact the support team at support@zohocrm.com.

Sample Response

Copied{
    "calendar": [
        {
            "code": "SUCCESS",
            "status": "success",
            "message": "calendar view created succesfully",
            "details": {
                "id": "554023000006088011"
            }
        }
    ]
}