Create Unsubscribe Link

Purpose

To create an unsubscribe link, which can be used in your email templates or email footers.

Request Details

Request URL

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

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope = ZohoCRM.settings.unsubscribe.ALL
(or)
scope = ZohoCRM.settings.unsubscribe.CREATE

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v7/settings/unsubscribe_links"
-X POST
-d "newlink.json"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Input JSON Keys

  • namestring, mandatory

    The unique name for the unsubscribe link.

  • page_typestring, mandatory

    Specify whether the unsubscribe link should be hosted in the standard page designed by Zoho CRM, or a custom webpage. The possible values are standard and custom.

  • custom_location_urlstring, mandatory if the value of page_type is custom

    Specify the webpage URL where you want to host the unsubscribe link. Skip this field if you wish to use the standard page for hosting your unsubscribe link.

  • standard_page_messagestring, optional

    Specify the message to be displayed in the standard unsubscribe page. The message can either be in rich text (html) or plain text format.

  • submission_action_typestring, mandatory

    Specify the action to be performed when the user clicks the unsubscribe button. You can configure to display a message, or to redirect to another URL upon unsubscribe. The possible values are display_message and redirect.

  • submission_redirect_urlstring, mandatory if the value of submission_action_type is redirect

    Specify the web page URL to which the user will be redirected after clicking on the unsubscribe link.

  • submission_messagestring, mandatory if the value of submission_action_type is display_message

    The message to be displayed once the user clicks the unsubscribe button. You can specify the message either in rich text (html) or plain text format.

Sample Input

Copied{
  "unsubscribe_links": [
    {
      "name": "Test",
      "page_type": "standard",
      "standard_page_message": " You will not be sent any more newsletter once you click the unsubscribe button. Do you wish to continue?",
      "submission_action_type": "redirect",
      "submission_redirect_url": "https://redirecturl.com"
    }
  ]
}

Possible Errors

  • 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 the required OAUTH SCOPE. Generate a new token with valid scope. Refer to scope section above for more details.

  • INTERNAL_ERRORHTTP 500

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

  • 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.

  • INVALID_DATAHTTP 400

    You have specified an invalid value for the URL fields.
    Resolution: Specify a valid URL.

  • LIMIT_EXCEEDEDHTTP 400

    Unsubscribe Link limit exceededd 
    Resolution: You have already set up the maximum allowed number of unsubscribe links in your account. Please delete one or more links to create additional ones. For more information on edition-wise limits, refer here.

  • MANDATORY_NOT_FOUNDHTTP 400

    Required field not found 
    Resolution: You have not specified one or more of the mandatory keys in the input body. Specify all the mandatory keys. Refer to the Input JSON keys sections to know more.

  • DUPLICATE_DATAHTTP 400

    Unsubscribe Link name already exists
    Resolution: Specify another unique name for the unsubscribe link.

  • DEPENDENT_FIELD_MISSINGHTTP 400

    Required field not found 
    Resolution: You have not specified one of the dependent fields. Please specify all the dependent fields. Refer to the input JSON keys section above to know about the dependent fields.

Sample Response

Copied{
    "unsubscribe_links": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "2309216000000582123"
            },
            "message": "Unsubscribe Link created successfully",
            "status": "success"
        }
    ]
}