---
sourceDocument: Référence de l’API Xanadu
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/fr-FR/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - fr-FR

ft:publication_title :

    - Référence de l’API Xanadu

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Interaction - Dans le champ d'application

# Interaction - Dans le champ d'application {#ariaid-title1}

* Rversion finale: Xanadu
* 
* Mis à jour 1 août 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes de lecture

L'API d'interaction fournit des méthodes qui vous permettent de définir le comportement des enregistrements d'interaction.

Cette classe nécessite le module d'extension Interaction Logging, Routing, and Queueing (com.glide.interaction) et s'exécute dans l'espace `de noms sn_interaction` .

## Interaction : accept() {#ariaid-title2}

Accepte une nouvelle interaction.
L'acceptation d'un transfert ne fonctionne que pour les transferts en attente. Recherchez tous les transferts en attente dans la table Transfert d'agent d'interaction \[interaction_agent_transfer\].
{#InteractionScoped-accept__table_spy_541_g2b__entry__3}

| Nom | Type | Description |
|-|-|-|
| Aucun |   |   |
[Tableau 1. Paramètres]

{#InteractionScoped-accept__table_spy_541_g2b} {#InteractionScoped-accept__table_tpy_541_g2b__entry__2}

| Type | Description |
|-|-|
| Booléen | Renvoie la valeur true si le transfert est accepté. |
[Tableau 2. Renvoie]

{#InteractionScoped-accept__table_tpy_541_g2b}  

    var now_GR = new GlideRecord('interaction');
    GR.get('b2c0a3af202a1300964f959e0488de75');
    var interaction = sn_interaction.Interaction.getInteraction(GR).accept();

## Interaction : créer (options de l'objet) {#ariaid-title3}

Crée une interaction.
{#interaction-create_Object__table_ubv_mql_d2b__entry__3}

| Nom | Type | Description |
|-|-|-|
| options | Objet | Valeurs de champ pour un enregistrement d'interaction. Le champ Canal avec l'sys_id du canal et les métadonnées du canal sont requis. Si une file d'attente n'est pas incluse dans le paramètre, le système renvoie `l'interaction b2c0a3af202a1300964f959e0488de75 n'a pas de file d'attente spécifiée... Règles de correspondance de file d'attente en cours d'exécution.` |
[Tableau 3. Paramètres]

{#interaction-create_Object__table_ubv_mql_d2b} {#interaction-create_Object__table_vbv_mql_d2b__entry__2}

| Type | Description |
|-|-|
| Objet | Interaction |
[Tableau 4. Renvoie]

{#interaction-create_Object__table_vbv_mql_d2b}  

    var interactionObj = sn_interaction.Interaction.create({
    	channel: '28a59893873103002ae97e2526cb0b5d',
    	channel_metadata:{},
    	opened_for: '46d44a23a9fe19810012d100cca80666',
    	queue: 'f3a50867b30303002186a72256a8dcb7'
    });

## Interaction : getInteraction(interaction GlideRecord) {#ariaid-title4}

Renvoie un enregistrement d'interaction.
{#InteractionScoped-getInteraction_GlideRecord__table_dys_bnd_c2b__entry__3}

| Nom | Type | Description |
|-|-|-|
| interaction | GlideRecord | Enregistrement d'interaction à partir de la table d'interaction \[interaction\] récupérée à partir du système. |
[Tableau 5. Paramètres]

{#InteractionScoped-getInteraction_GlideRecord__table_dys_bnd_c2b} {#InteractionScoped-getInteraction_GlideRecord__table_eys_bnd_c2b__entry__2}

| Type | Description |
|-|-|
| Objet | Interaction |
[Tableau 6. Renvoie]

{#InteractionScoped-getInteraction_GlideRecord__table_eys_bnd_c2b}  

    var now_GR = new GlideRecord('interaction');
    now_GR.get('608a21bd096a9300964ffbd57ba7dd8d');
    var interaction = sn_interaction.Interaction.getInteraction(now_GR);

## Interaction : transferToAgent(String sysID) {#ariaid-title5}

Transfère un enregistrement d'interaction à un agent à l'aide du sys_id de l'agent.
Lorsqu'une interaction est transférée d'un agent à un autre, elle doit être acceptée ou rejetée à l'aide des API GlideRecord. Utilisez l'API GlideRecord pour modifier l'état de l'interaction et effectuer la mise à jour. Pour plus d'informations, consultez la méthode de mise à jour GlideRecord.  
Remarque :  
Cette méthode a été déconseillée.
{#InteractionScoped-transferToAgent_String__table_ryp_4py_c2b__entry__3}

| Nom | Type | Description |
|-|-|-|
| SysID | Chaîne | sys_id de l'utilisateur auquel vous souhaitez transférer un enregistrement d'interaction. |
[Tableau 7. Paramètres]

{#InteractionScoped-transferToAgent_String__table_ryp_4py_c2b} {#InteractionScoped-transferToAgent_String__table_syp_4py_c2b__entry__2}

| Type | Description |
|-|-|
| nul |   |
[Tableau 8. Renvoie]

{#InteractionScoped-transferToAgent_String__table_syp_4py_c2b}  

    var now_GR = new GlideRecord('interaction');
    GR.get('24b927ef202a1300964f959e0488de2d');
    var interaction = sn_interaction.Interaction.getInteraction(GR);
    interaction.transferToAgent('6816f79cc0a8016401c5a33be04be441');

## Interaction : transferToQueue(String sysID) {#ariaid-title6}

Transfère un enregistrement d'interaction à une file d'attente des interactions.
Le transfert d'une interaction d'une file d'attente à une autre ferme l'interaction d'origine et crée une interaction dans la nouvelle file d'attente.  
Remarque :  
Cette méthode a été déconseillée.
{#InteractionScoped-transferToQueue_String__table_bzz_kqy_c2b__entry__3}

| Nom | Type | Description |
|-|-|-|
| SysID | Chaîne | Le sys_id de la file d'attente des interactions vers laquelle vous souhaitez transférer l'enregistrement d'interaction. |
[Tableau 9. Paramètres]

{#InteractionScoped-transferToQueue_String__table_bzz_kqy_c2b} {#InteractionScoped-transferToQueue_String__table_czz_kqy_c2b__entry__2}

| Type | Description |
|-|-|
| nul |   |
[Tableau 10. Renvoie]

{#InteractionScoped-transferToQueue_String__table_czz_kqy_c2b}  

    var now_GR = new GlideRecord('interaction');
    GR.get('24b927ef202a1300964f959e0488de2d');
    var interaction = sn_interaction.Interaction.getInteraction(GR);
    interaction.transferToQueue('86fee1933b101300088d832b44efc474');


