{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":849,"path":"api-reference/server-api-reference/MessagingScopedAPI.md","title":"Messaging - Scoped","bundle":null,"doc_type":null,"release":"australia","body":"\n# Messaging- Scoped\n\nThe Messaging API provides methods to perform actions in a third-party messaging application.\n\nThis class requires the Messaging Notification plugin \\(com.glide.notification.messaging\\) and an integration with a third-party messaging application such as Slack or Teams. Use these methods in an action script in the Message Actions \\[messaging\\_observer\\_handler\\] table.\n\nUse the `sn_notification` namespace to access the Messaging API.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## Messaging - send\\(GlideRecord messagingApplication, String recipient, GlideRecord messagingContent, GlideRecord target\\)\n\nSends a custom message to a third-party application in response to a messaging event. For example, you can send a custom welcome message to a Slack channel when the Now Actions application installs.\n\nUse this method in an action script in the Message Actions \\[messaging\\_observer\\_handler\\] table.\n\n|Name|Type|Description|\n|----|----|-----------|\n|messagingApplication|GlideRecord|Third-party application to send a message to from the Messaging Entities \\[messaging\\_application\\] table.|\n|recipient|String|Recipient of the message. When the instance receives an inbound message, you can send a response to a Slack channel, Team, or individual user ID found in the inbound payload.|\n|messagingContent|GlideRecord|Message content to send from the Messaging Contents \\[messaging\\_content\\] table.|\n|target|GlideRecord|Record used to define dynamic field values in the message. Table must match the **Target table** field in the Messaging Contents record. If the Messaging Contents record does not use a target table, set the value to null.|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n```\n//Send a message to a Teams user\nvar app = new GlideRecord('messaging_application');\napp.get('1f2d26527f4213007f005212bdfa9102');\n\nvar content = new GlideRecord('messaging_content');\ncontent.get('17f1f9617320130082999cfd7bf6a706');\n\nsn_notification.Messaging.send(app, '29:1ojsgDg1xuA_jZ70PDI2_6E7mn7P6Mc0wK7z0n2lblL-SaNXYVI1cR7i6qncllAGvdmhy2-kXh76IEVpUHXdz3w', content, null);\n\n//Send a message to a Slack user\nvar app = new GlideRecord('messaging_application');\napp.get('5d2e38c07f6113007f005212bdfa9160');\n\nvar content = new GlideRecord('messaging_content');\ncontent.get('69c48ba77310130082999cfd7bf6a7af');\n\nsn_notification.Messaging.send(app, 'U8P706QFQ', content, null);\n\n//Send a message to a Slack channel\nvar app = new GlideRecord('messaging_application');\napp.get('5d2e38c07f6113007f005212bdfa9160');\n\nvar content = new GlideRecord('messaging_content');\ncontent.get('69c48ba77310130082999cfd7bf6a7af');\n\nsn_notification.Messaging.send(app, 'CA6232N65', content, null);\n```\n\n"}}