Enable Notifications

Purpose

To enable instant notifications of actions performed on a module.

Request URL

https://www.zohoapis.com/crm/v2/actions/watch

Request Method

POST

Scope

scope=ZohoCRM.notifications.{operation_type}


Possible operation types
ALL - Full access to notification data
CREATE - Enable instant notifications
WRITE - Edit instant notification details

Input JSON Keys

KeyValuePurpose
token(optional)String(Maximum length is 50 characters)To ensure that the notification is sent from Zoho CRM, by sending back the given value in notification URL body. By using this value, user can validate the notifications.
notify_url
(mandatory)
StringURL to be notified (POST request). Whenever any action gets triggered, the notification will be sent through this notify url.
channel_id
(mandatory)
String(long)The given value is sent back in notification URL body to make sure that the notification is for a particular channel.
channel_expiryString (ISO Date time)To set the expiry time for instant notifications. Maximum of only one day from the time they were enabled. If it is not specified or set for more than a day, the default expiry time is for one hour.
events
(mandatory)
JSONArray
["{module_api_name}.{operation}",
"{module_api_name}.{operation}"]
Ex: ["Leads.create","Sales_Orders.edit","Contacts.delete"]
Possible operation types - create, delete, edit, all
To subscribe based on particular operations on selected modules.

To get notification on a URL

On trigger of any notification-enabled event in a module, Zoho CRM sends a notification to the user through the notify URL.

Possible Errors

MANDATORY_NOT_FOUND

HTTP Status Code: 202
One of the mandatory fields (events, channel_id, notify_url) is not found. Refer to the "details" key in the response to know which mandatory field is missing.

Resolution: Ensure that all the mandatory fields are given in the input.

MANDATORY_NOT_FOUND

HTTP Status Code: 202
One of the mandatory fields (events, channel_id, notify_url) is not found. Refer to the "details" key in the response to know which mandatory field is missing.

Resolution: Ensure that all the mandatory fields are given in the input.

INVALID_DATA

HTTP Status Code: 202
The length of the token is greater than 50 characters.

Resolution: Ensure that the token passed is less than 50 characters in length.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v2/actions/watch"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d "@inputData.json"

In the request, "@inputData.json" contains the sample input data.