Mark a User Unavailable

Purpose

To mark oneself(user) unavailable during a particular time period.

Request Details

Request URL

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

Header

Authorization: Zoho-oauthtoken <access_token>

Scope

scope=ZohoCRM.settings.users_unavailability.ALL
(or)
scope=ZohoCRM.settings.users_unavailability.WRITE

Sample Request

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

Input JSON Keys

  • commentsstring, optional

    The comment you want other users to see while you are unavailable.

  • fromstring, mandatory

    The date and time in the ISO8601 format that you will be unavailable from.

  • tostring, mandatory

    The date and time in the ISO8601 format that you will be unavailable to.

  • userJSON object

    The name, id(mandatory, the key "id" from the Get Users API, and zuid(optional, the key "zuid" from the Get Users API.

Sample Input

Copied{
    "users_unavailability": [
        {
            "comments": "Unavailable",
            "from": "2021-02-18T19:00:00+05:30",
            "to": "2021-02-18T20:00:00+05:30",
            "user": {
                "name": "Patricia Boyle",
                "id": "554xxxx966",
                "zuid": "554xxx5011"
            }
        }
    ]
} 

Possible Errors

  • MANDATORY_NOT_FOUNDHTTP 400

    One or more required fields is not specified in the input.
    Resolution: The "details" key specifies the API name of the mandatory field you have not included in the input body. Include all the mandatory keys in the input.

  • INVALID_DATAHTTP 400

    You have specified an incorrect ID in the "user" object, or you have specified an incorrect time in either the "to" or "from" fields.
    Resolution: Specify the correct ID and the right time in the ISO8601 format. Ensure that the unavailability time period starts before the time it ends.

Sample Response

Copied{
    "users_unavailability": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "554023000002221001"
            },
            "message": "Unavailability created successfully.",
            "status": "success"
        }
    ]
}