---
sourceDocument: Xanadu API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - ja-JP

ft:publication_title :

    - Xanadu API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# メッセージング - スコープ対象

# メッセージング - スコープ対象 {#ariaid-title1}

* リリースバージョン: Xanadu
* 
* 更新日 2024年08月01日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：3分

Messaging API は、サードパーティのメッセージングアプリケーションでアクションを実行するためのメソッドを提供します。

このクラスでは、Messaging Notification プラグイン (com.glide.notification.messaging) と、Slack や Teams などのサードパーティのメッセージングアプリケーションとのデータ連携が必要です。ここで説明するメソッドは、メッセージアクション \[messaging_observer_handler\] テーブルのアクションスクリプトで使用します。

`sn_notification` 名前空間を使用して Messaging API にアクセスします。

## メッセージング - send(GlideRecord messagingApplication, String recipient, GlideRecord messagingContent, GlideRecord target) {#ariaid-title2}

メッセージングイベントに応答して、カスタムメッセージをサードパーティアプリケーションに送信します。たとえば、Now Actions アプリケーションのインストール時に、カスタムの歓迎メッセージを Slack のチャンネルに送信できます。
このメソッドは、メッセージアクション \[messaging_observer_handler\] テーブルのアクションスクリプトで使用します。
{#MessagingScoped-send_O_S_O_O__table_l3g_zyn_zdb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| messagingApplication | GlideRecord | メッセージングエンティティ \[messaging_application\] テーブルからメッセージを送信するサードパーティアプリケーション。 |
| recipient | 文字列 | テキストメッセージの受信者。インスタンスが受信メッセージを受け取ると、受信ペイロードにある Slack のチャンネル、チーム、または個々のユーザー ID に応答を送信できます。 |
| messagingContent | GlideRecord | メッセージングコンテンツ \[messaging_content\] テーブルから送信するメッセージコンテンツ。 |
| target | GlideRecord | メッセージの動的フィールド値を定義するために使用するレコード。テーブルは、メッセージングコンテンツレコードの \[ターゲットテーブル\] フィールドと一致する必要があります。メッセージングコンテンツレコードがターゲットテーブルを使用しない場合は、値を null に設定します。 |
[表 : 1. パラメーター]

{#MessagingScoped-send_O_S_O_O__table_l3g_zyn_zdb} {#MessagingScoped-send_O_S_O_O__table_m3g_zyn_zdb__entry__2}

| タイプ | 説明 |
|-|-|
| なし |   |
[表 : 2. 返される内容]

{#MessagingScoped-send_O_S_O_O__table_m3g_zyn_zdb}  

    //Send a message to a Teams user
    var app = new GlideRecord('messaging_application');
    app.get('1f2d26527f4213007f005212bdfa9102');

    var content = new GlideRecord('messaging_content');
    content.get('17f1f9617320130082999cfd7bf6a706');

    sn_notification.Messaging.send(app, '29:1ojsgDg1xuA_jZ70PDI2_6E7mn7P6Mc0wK7z0n2lblL-SaNXYVI1cR7i6qncllAGvdmhy2-kXh76IEVpUHXdz3w', content, null);

    //Send a message to a Slack user
    var app = new GlideRecord('messaging_application');
    app.get('5d2e38c07f6113007f005212bdfa9160');

    var content = new GlideRecord('messaging_content');
    content.get('69c48ba77310130082999cfd7bf6a7af');

    sn_notification.Messaging.send(app, 'U8P706QFQ', content, null);

    //Send a message to a Slack channel
    var app = new GlideRecord('messaging_application');
    app.get('5d2e38c07f6113007f005212bdfa9160');

    var content = new GlideRecord('messaging_content');
    content.get('69c48ba77310130082999cfd7bf6a7af');

    sn_notification.Messaging.send(app, 'CA6232N65', content, null);


