{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":4581,"path":"conversational-interfaces/agent-chat/agent-init-messg-validate-recipient.md","title":"Validate recipient IDs for agent-initiated messages","bundle":null,"doc_type":null,"release":"australia","body":"\n# Validate recipient IDs for agent-initiated messages\n\nUse scripted extension points to call custom scripts for validating the format of a recipient ID associated with a messaging channel.\n\n## Before you begin\n\nInstall the Agent-Initiated Messaging Interface application. For more information, see [Install agent-initiated messaging interface](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/conversational-interfaces/agent-chat/install-agent-init-messg.md).\n\nRole required: admin\n\n## About this task\n\nBy using extension points, you can easily integrate customizations without having to alter the base code. You can extend standard base functionality using customized scripts. For more information, see [Using extension points to extend application functionality](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/web-services/extension-points.md).\n\n## Procedure\n\n1.  Navigate to **All** &gt; **System Extension Points** &gt; **Scripted Extension Points**.\n\n2.  In the **API Name** column, search for and select **global.ChannelSendToValidation**.\n\n3.  On the Extension Point form, either modify a script include to use the global.ChannelSendToValidation extension point or create and register a custom script include.\n\n    -   Create and register a custom script include.\n    -   Modify the existing script include by going to the Implementations related list and selecting a script include in the **Class** column.\n\n        **Note:** The PhoneNumberValidationExtPointImpl script include that use the global.ChannelSendToValidation extension point is available for validating recipient IDs profiles associated with the [Conversational SMS service channel](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/conversational-interfaces/advanced-work-assignment/conversation-sms-service-channel-store-app.md) application.\n\n4.  Associate user profiles for an agent-initiated messages by adding the global.ChannelSendToValidation extension point to the script include.\n\n    You can create multiple implementations for an extension point and provide an order number for each implementation. The implementation that has the lowest order number is executed first.\n\n    |Customization|Implementation|\n    |-------------|--------------|\n    |Associate a channel ID for which the message was initiated|Include the isValid method in the global.ChannelSendToValidation extension point.|\n    |Retrieve the recipient ID associated with the channel for which the message was initiated|Include the channelSendToValidation method in the sn\\_agent\\_initiated.AgentInitiatedMessagingUserDocument extension point.|\n\n    **Note:** Based on the channel ID set in the isValid method, the recipient details are retrieved for validating a recipient ID in the channelSendToValidation method.\n\n5.  On the Extension Point form, click **Update**.\n\n\n**Parent Topic:**[Configuring Agent-Initiated Messaging Interface](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/conversational-interfaces/agent-chat/config-agent-init-messg-interface.md)\n\n"}}