communications-mining
latest
false
Important :
Ce contenu a été traduit à l'aide d'une traduction automatique.
UiPath logo, featuring letters U and I in white
Guide du développeur Communications Mining
Last updated 19 nov. 2024

Commentaires

Ajouter ou mettre à jour des commentaires

/api/v1/sources/<project>/<source_name>/sync

Autorisations requises : Modifier les messages.

Important :

Opération facturable

Vous serez facturé 1 AI Unit par commentaire créé ou par commentaire mis à jour (en fonction de son ID unique) si son texte a été modifié.

  • Bash
    curl -X POST 'https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync' \
        -H "Authorization: Bearer $REINFER_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
      "comments": [
        {
          "id": "0123456789abcdef",
          "messages": [
            {
              "body": {
                "text": "Alice,\n\nHere are the figures for today.\n\nRegards,\nBob"
              },
              "from": "bob@organisation.org",
              "sent_at": "2011-12-11T11:05:10.000000+00:00",
              "subject": {
                "text": "Today'"'"'s figures"
              },
              "to": [
                "alice@company.com"
              ]
            }
          ],
          "timestamp": "2011-12-11T11:05:10.000000+00:00",
          "user_properties": {
            "string:Recipient Domain": "company.com",
            "string:Sender Domain": "organisation.org"
          }
        },
        {
          "id": "abcdef0123456789",
          "messages": [
            {
              "body": {
                "text": "Hi Bob,\n\nI think these are the wrong numbers - could you check?\n\nThanks again,\nAlice"
              },
              "from": "alice@company.com",
              "sent_at": "2011-12-11T11:18:43.000000+00:00",
              "subject": {
                "text": "Today'"'"'s figures"
              },
              "to": [
                "bob@organisation.org"
              ]
            }
          ],
          "timestamp": "2011-12-11T11:18:43.000000+00:00",
          "user_properties": {
            "string:Recipient Domain": "organisation.org",
            "string:Sender Domain": "company.com"
          }
        }
      ]
    }'curl -X POST 'https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync' \
        -H "Authorization: Bearer $REINFER_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
      "comments": [
        {
          "id": "0123456789abcdef",
          "messages": [
            {
              "body": {
                "text": "Alice,\n\nHere are the figures for today.\n\nRegards,\nBob"
              },
              "from": "bob@organisation.org",
              "sent_at": "2011-12-11T11:05:10.000000+00:00",
              "subject": {
                "text": "Today'"'"'s figures"
              },
              "to": [
                "alice@company.com"
              ]
            }
          ],
          "timestamp": "2011-12-11T11:05:10.000000+00:00",
          "user_properties": {
            "string:Recipient Domain": "company.com",
            "string:Sender Domain": "organisation.org"
          }
        },
        {
          "id": "abcdef0123456789",
          "messages": [
            {
              "body": {
                "text": "Hi Bob,\n\nI think these are the wrong numbers - could you check?\n\nThanks again,\nAlice"
              },
              "from": "alice@company.com",
              "sent_at": "2011-12-11T11:18:43.000000+00:00",
              "subject": {
                "text": "Today'"'"'s figures"
              },
              "to": [
                "bob@organisation.org"
              ]
            }
          ],
          "timestamp": "2011-12-11T11:18:43.000000+00:00",
          "user_properties": {
            "string:Recipient Domain": "organisation.org",
            "string:Sender Domain": "company.com"
          }
        }
      ]
    }'
    
  • Nœud
    const request = require("request");
    
    request.post(
      {
        url: "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
        json: true,
        body: {
          comments: [
            {
              id: "0123456789abcdef",
              messages: [
                {
                  body: {
                    text: "Alice,\n\nHere are the figures for today.\n\nRegards,\nBob",
                  },
                  from: "bob@organisation.org",
                  sent_at: "2011-12-11T11:05:10.000000+00:00",
                  subject: { text: "Today's figures" },
                  to: ["alice@company.com"],
                },
              ],
              timestamp: "2011-12-11T11:05:10.000000+00:00",
              user_properties: {
                "string:Recipient Domain": "company.com",
                "string:Sender Domain": "organisation.org",
              },
            },
            {
              id: "abcdef0123456789",
              messages: [
                {
                  body: {
                    text: "Hi Bob,\n\nI think these are the wrong numbers - could you check?\n\nThanks again,\nAlice",
                  },
                  from: "alice@company.com",
                  sent_at: "2011-12-11T11:18:43.000000+00:00",
                  subject: { text: "Today's figures" },
                  to: ["bob@organisation.org"],
                },
              ],
              timestamp: "2011-12-11T11:18:43.000000+00:00",
              user_properties: {
                "string:Recipient Domain": "organisation.org",
                "string:Sender Domain": "company.com",
              },
            },
          ],
        },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );const request = require("request");
    
    request.post(
      {
        url: "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
        json: true,
        body: {
          comments: [
            {
              id: "0123456789abcdef",
              messages: [
                {
                  body: {
                    text: "Alice,\n\nHere are the figures for today.\n\nRegards,\nBob",
                  },
                  from: "bob@organisation.org",
                  sent_at: "2011-12-11T11:05:10.000000+00:00",
                  subject: { text: "Today's figures" },
                  to: ["alice@company.com"],
                },
              ],
              timestamp: "2011-12-11T11:05:10.000000+00:00",
              user_properties: {
                "string:Recipient Domain": "company.com",
                "string:Sender Domain": "organisation.org",
              },
            },
            {
              id: "abcdef0123456789",
              messages: [
                {
                  body: {
                    text: "Hi Bob,\n\nI think these are the wrong numbers - could you check?\n\nThanks again,\nAlice",
                  },
                  from: "alice@company.com",
                  sent_at: "2011-12-11T11:18:43.000000+00:00",
                  subject: { text: "Today's figures" },
                  to: ["bob@organisation.org"],
                },
              ],
              timestamp: "2011-12-11T11:18:43.000000+00:00",
              user_properties: {
                "string:Recipient Domain": "organisation.org",
                "string:Sender Domain": "company.com",
              },
            },
          ],
        },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );
  • Python
    import json
    import os
    
    import requests
    
    response = requests.post(
        "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
        json={
            "comments": [
                {
                    "id": "0123456789abcdef",
                    "timestamp": "2011-12-11T11:05:10.000000+00:00",
                    "messages": [
                        {
                            "from": "bob@organisation.org",
                            "to": ["alice@company.com"],
                            "sent_at": "2011-12-11T11:05:10.000000+00:00",
                            "subject": {"text": "Today's figures"},
                            "body": {
                                "text": "Alice,\n\nHere are the figures for today.\n\nRegards,\nBob"
                            },
                        }
                    ],
                    "user_properties": {
                        "string:Sender Domain": "organisation.org",
                        "string:Recipient Domain": "company.com",
                    },
                },
                {
                    "id": "abcdef0123456789",
                    "timestamp": "2011-12-11T11:18:43.000000+00:00",
                    "messages": [
                        {
                            "from": "alice@company.com",
                            "to": ["bob@organisation.org"],
                            "sent_at": "2011-12-11T11:18:43.000000+00:00",
                            "subject": {"text": "Today's figures"},
                            "body": {
                                "text": "Hi Bob,\n\nI think these are the wrong numbers - could you check?\n\nThanks again,\nAlice"
                            },
                        }
                    ],
                    "user_properties": {
                        "string:Sender Domain": "company.com",
                        "string:Recipient Domain": "organisation.org",
                    },
                },
            ]
        },
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))import json
    import os
    
    import requests
    
    response = requests.post(
        "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
        json={
            "comments": [
                {
                    "id": "0123456789abcdef",
                    "timestamp": "2011-12-11T11:05:10.000000+00:00",
                    "messages": [
                        {
                            "from": "bob@organisation.org",
                            "to": ["alice@company.com"],
                            "sent_at": "2011-12-11T11:05:10.000000+00:00",
                            "subject": {"text": "Today's figures"},
                            "body": {
                                "text": "Alice,\n\nHere are the figures for today.\n\nRegards,\nBob"
                            },
                        }
                    ],
                    "user_properties": {
                        "string:Sender Domain": "organisation.org",
                        "string:Recipient Domain": "company.com",
                    },
                },
                {
                    "id": "abcdef0123456789",
                    "timestamp": "2011-12-11T11:18:43.000000+00:00",
                    "messages": [
                        {
                            "from": "alice@company.com",
                            "to": ["bob@organisation.org"],
                            "sent_at": "2011-12-11T11:18:43.000000+00:00",
                            "subject": {"text": "Today's figures"},
                            "body": {
                                "text": "Hi Bob,\n\nI think these are the wrong numbers - could you check?\n\nThanks again,\nAlice"
                            },
                        }
                    ],
                    "user_properties": {
                        "string:Sender Domain": "company.com",
                        "string:Recipient Domain": "organisation.org",
                    },
                },
            ]
        },
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))
    
  • Réponse
    {
      "new": 2,
      "status": "ok",
      "unchanged": 0,
      "updated": 0
    }{
      "new": 2,
      "status": "ok",
      "unchanged": 0,
      "updated": 0
    }

L'ID d'un commentaire l'identifie de manière unique dans une source. Si l'ID de commentaire fourni n'existe pas dans la source, un commentaire est créé. Sinon, un commentaire existant est mis à jour.

NomSaisie de texteRequisDESCRIPTION
commentsarray<Cmment>ouiUn lot de 16 384 commentaires maximum, au format décrit dans la Référence du commentaire (Comment Reference). Les lots plus volumineux sont plus rapides (par commentaire) que les plus petits.

Champs généraux attribués

Les champs généraux attribués seront conservés, à moins que le texte n’ait changé de façon significative. Les libellés attribués ne sont jamais supprimés.

Demandes importantes

Pour les requêtes volumineuses, ce point de terminaison peut prendre plus de temps à répondre. Vous devez augmenter le délai d'attente de votre client.

Ajouter ou mettre à jour les commentaires des e-mails bruts

/api/v1/sources/<project>/<source_name>/sync-raw-emails

Autorisations requises : Modifier les messages

Important :

Opération facturable

Vous serez facturé 1 unité d’IA par commentaire créé ou par commentaire mis à jour (en fonction de l’ID de message de l’e-mail) si son texte a été modifié.

  • Bash
    curl -X POST 'https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync-raw-emails' \
        -H "Authorization: Bearer $REINFER_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
      "documents": [
        {
          "raw_email": {
            "body": {
              "plain": "Hi Bob,\n\nCould you send me today'"'"'s figures?\n\nThanks,\nAlice"
            },
            "headers": {
              "parsed": {
                "Date": "Thu, 09 Jan 2020 16:34:45 +0000",
                "From": "alice@company.com",
                "Message-ID": "abcdef@company.com",
                "References": "<01234@company.com> <56789@company.com>",
                "Subject": "Figures Request",
                "To": "bob@organisation.org"
              }
            }
          },
          "user_properties": {
            "number:Deal Value": 12000,
            "string:City": "London"
          }
        }
      ],
      "include_comments": true,
      "transform_tag": "name.0.ABCD1234"
    }'curl -X POST 'https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync-raw-emails' \
        -H "Authorization: Bearer $REINFER_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{
      "documents": [
        {
          "raw_email": {
            "body": {
              "plain": "Hi Bob,\n\nCould you send me today'"'"'s figures?\n\nThanks,\nAlice"
            },
            "headers": {
              "parsed": {
                "Date": "Thu, 09 Jan 2020 16:34:45 +0000",
                "From": "alice@company.com",
                "Message-ID": "abcdef@company.com",
                "References": "<01234@company.com> <56789@company.com>",
                "Subject": "Figures Request",
                "To": "bob@organisation.org"
              }
            }
          },
          "user_properties": {
            "number:Deal Value": 12000,
            "string:City": "London"
          }
        }
      ],
      "include_comments": true,
      "transform_tag": "name.0.ABCD1234"
    }'
    
  • Nœud
    const request = require("request");
    
    request.post(
      {
        url: "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync-raw-emails",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
        json: true,
        body: {
          documents: [
            {
              raw_email: {
                body: {
                  plain:
                    "Hi Bob,\n\nCould you send me today's figures?\n\nThanks,\nAlice",
                },
                headers: {
                  parsed: {
                    Date: "Thu, 09 Jan 2020 16:34:45 +0000",
                    From: "alice@company.com",
                    "Message-ID": "abcdef@company.com",
                    References: "<01234@company.com> <56789@company.com>",
                    Subject: "Figures Request",
                    To: "bob@organisation.org",
                  },
                },
              },
              user_properties: {
                "number:Deal Value": 12000,
                "string:City": "London",
              },
            },
          ],
          include_messages: true,
          transform_tag: "name.0.ABCD1234",
        },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );const request = require("request");
    
    request.post(
      {
        url: "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync-raw-emails",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
        json: true,
        body: {
          documents: [
            {
              raw_email: {
                body: {
                  plain:
                    "Hi Bob,\n\nCould you send me today's figures?\n\nThanks,\nAlice",
                },
                headers: {
                  parsed: {
                    Date: "Thu, 09 Jan 2020 16:34:45 +0000",
                    From: "alice@company.com",
                    "Message-ID": "abcdef@company.com",
                    References: "<01234@company.com> <56789@company.com>",
                    Subject: "Figures Request",
                    To: "bob@organisation.org",
                  },
                },
              },
              user_properties: {
                "number:Deal Value": 12000,
                "string:City": "London",
              },
            },
          ],
          include_messages: true,
          transform_tag: "name.0.ABCD1234",
        },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );
  • Python
    import json
    import os
    
    import requests
    
    response = requests.post(
        "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync-raw-emails",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
        json={
            "transform_tag": "name.0.ABCD1234",
            "documents": [
                {
                    "raw_email": {
                        "headers": {
                            "parsed": {
                                "Message-ID": "abcdef@company.com",
                                "Date": "Thu, 09 Jan 2020 16:34:45 +0000",
                                "Subject": "Figures Request",
                                "From": "alice@company.com",
                                "To": "bob@organisation.org",
                                "References": "<01234@company.com> <56789@company.com>",
                            }
                        },
                        "body": {
                            "plain": "Hi Bob,\n\nCould you send me today's figures?\n\nThanks,\nAlice"
                        },
                    },
                    "user_properties": {
                        "string:City": "London",
                        "number:Deal Value": 12000,
                    },
                }
            ],
            "include_comments": True,
        },
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))import json
    import os
    
    import requests
    
    response = requests.post(
        "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/sync-raw-emails",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
        json={
            "transform_tag": "name.0.ABCD1234",
            "documents": [
                {
                    "raw_email": {
                        "headers": {
                            "parsed": {
                                "Message-ID": "abcdef@company.com",
                                "Date": "Thu, 09 Jan 2020 16:34:45 +0000",
                                "Subject": "Figures Request",
                                "From": "alice@company.com",
                                "To": "bob@organisation.org",
                                "References": "<01234@company.com> <56789@company.com>",
                            }
                        },
                        "body": {
                            "plain": "Hi Bob,\n\nCould you send me today's figures?\n\nThanks,\nAlice"
                        },
                    },
                    "user_properties": {
                        "string:City": "London",
                        "number:Deal Value": 12000,
                    },
                }
            ],
            "include_comments": True,
        },
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))
    
  • Réponse
    {
      "comments": [
        {
          "attachments": [],
          "id": "61626364656640636f6d70616e792e636f6d",
          "messages": [
            {
              "body": {
                "text": "Hi Bob,\n\nCould you send me today's figures?"
              },
              "from": "alice@company.com",
              "sent_at": "2020-01-09T16:34:45Z",
              "signature": {
                "text": "Thanks,\nAlice"
              },
              "subject": {
                "text": "Figures Request"
              },
              "to": ["bob@organisation.org"]
            }
          ],
          "source_id": "c1fb849b855841de",
          "text_format": "plain",
          "thread_id": "3c303132333440636f6d70616e792e636f6d3e",
          "timestamp": "2020-01-09T16:34:45Z",
          "uid": "c1fb849b855841de.61626364656640636f6d70616e792e636f6d",
          "user_properties": {
            "number:Deal Value": 12000,
            "number:Participant Count": 2,
            "number:Position in Thread": 3,
            "number:Recipient Count": 1,
            "string:City": "London",
            "string:Has Signature": "Yes",
            "string:Message ID": "abcdef@company.com",
            "string:Sender": "alice@company.com",
            "string:Sender Domain": "company.com",
            "string:Thread": "<01234@company.com>"
          }
        }
      ],
      "new": 1,
      "status": "ok",
      "unchanged": 0,
      "updated": 0
    }{
      "comments": [
        {
          "attachments": [],
          "id": "61626364656640636f6d70616e792e636f6d",
          "messages": [
            {
              "body": {
                "text": "Hi Bob,\n\nCould you send me today's figures?"
              },
              "from": "alice@company.com",
              "sent_at": "2020-01-09T16:34:45Z",
              "signature": {
                "text": "Thanks,\nAlice"
              },
              "subject": {
                "text": "Figures Request"
              },
              "to": ["bob@organisation.org"]
            }
          ],
          "source_id": "c1fb849b855841de",
          "text_format": "plain",
          "thread_id": "3c303132333440636f6d70616e792e636f6d3e",
          "timestamp": "2020-01-09T16:34:45Z",
          "uid": "c1fb849b855841de.61626364656640636f6d70616e792e636f6d",
          "user_properties": {
            "number:Deal Value": 12000,
            "number:Participant Count": 2,
            "number:Position in Thread": 3,
            "number:Recipient Count": 1,
            "string:City": "London",
            "string:Has Signature": "Yes",
            "string:Message ID": "abcdef@company.com",
            "string:Sender": "alice@company.com",
            "string:Sender Domain": "company.com",
            "string:Thread": "<01234@company.com>"
          }
        }
      ],
      "new": 1,
      "status": "ok",
      "unchanged": 0,
      "updated": 0
    }

Chaque e-mail brut sera converti en commentaire Communications Mining. Communications Mining générera l'ID du commentaire en fonction de l'en-tête « Message-ID » de l'e-mail. Si un commentaire avec cet ID de commentaire n'existe pas dans la source, un nouveau commentaire sera créé. Sinon, un commentaire existant sera mis à jour.

Lors de la conversion d'un e-mail brut en commentaire, Communications Mining nettoyera le corps de l'e-mail et générera des métadonnées à partir des en-têtes des e-mails. Vous pouvez définir include_comments sur true pour inclure les commentaires générés dans la réponse. Les commentaires seront renvoyés dans le format décrit dans la Référence du commentaire.
NomSaisie de texteRequisDESCRIPTION
transform_tagstringouiUne balise identifiant l'intégration de l'e-mail envoyant les données. Vous auriez dû recevoir cette balise lors de la configuration de l'intégration.
documentsarray<Document>ouiUn lot de 16 384 documents maximum au format décrit ci-dessous. Les lots plus volumineux sont plus rapides (par document) que les plus petits.
include_commentsbooleannonSi ce paramètre est défini sur true, les commentaires analysés à partir des e-mails seront renvoyés dans le corps de la réponse.
override_user_propertiesarray<string>nonLes propriétés utilisateur fournies dans documents remplaceront les propriétés utilisateur générées automatiquement si leurs noms apparaissent dans cette liste. Les noms de propriétés utilisateur dans cette liste doivent être spécifiés sans le préfixe de type , par exemple My Property et pas string:My Property.

Document a le format suivant :

NomSaisie de texteRequisDESCRIPTION
raw_emailRawEmailouiDonnées de l'e-mail, au format décrit dans la référence du commentaire.
comment_idstringnonIdentifie de manière unique un commentaire. Si aucun ID de commentaire n'est fourni, Communications Mining générera l'ID de commentaire à partir de l'ID de message de l'e-mail. Le format est décrit dans la Référence du commentaire.
user_propertiesmap<string, string | number>nonToutes les métadonnées définies par l'utilisateur qui s'appliquent au commentaire. Le format est décrit dans la référence du commentaire.
Remarque : Certaines propriétés utilisateur sont générées en fonction du contenu de l'e-mail. Si celles-ci sont en conflit avec les propriétés utilisateur téléchargées, la requête échouera avec 422 Unprocessable Entity.
Avertissement :

Champs généraux attribués

Communications Mining générera le contenu des « messages » du commentaire à partir du corps de l'e-mail brut ainsi qu'un sous-ensemble des en-têtes de l'e-mail bruts, en tenant compte de la balise de transformation spécifiée. Les champs généraux attribués seront conservés, à moins que le texte n’ait changé de façon significative. Les libellés attribués ne sont jamais supprimés.

Important :

Demandes importantes

Pour les requêtes volumineuses, ce point de terminaison peut prendre plus de temps à répondre. Vous devez augmenter le délai d'attente de votre client.

Supprimer des commentaires

/api/v1/sources/<project>/<source_name>/comments?id=<comment_id0>[&id=<comment_id1>...]

Autorisations requises : Modifier les messages

  • Bash
    curl -X DELETE 'https://<my_api_endpoint>/api/v1/sources/<project>/<source_name>/comments?id=abcdef0123456789' \
        -H "Authorization: Bearer $REINFER_TOKEN"curl -X DELETE 'https://<my_api_endpoint>/api/v1/sources/<project>/<source_name>/comments?id=abcdef0123456789' \
        -H "Authorization: Bearer $REINFER_TOKEN"
    
  • Nœud
    const request = require("request");
    
    request.delete(
      {
        url: "https://<my_api_endpoint>/api/v1/sources/<project>/<source_name>/comments?id=abcdef0123456789",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );const request = require("request");
    
    request.delete(
      {
        url: "https://<my_api_endpoint>/api/v1/sources/<project>/<source_name>/comments?id=abcdef0123456789",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );
  • Python
    import json
    import os
    
    import requests
    
    response = requests.delete(
        "https://<my_api_endpoint>/api/v1/sources/<project>/<source_name>/comments?id=abcdef0123456789",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))import json
    import os
    
    import requests
    
    response = requests.delete(
        "https://<my_api_endpoint>/api/v1/sources/<project>/<source_name>/comments?id=abcdef0123456789",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))
    
  • Réponse
    {
      "status": "ok"
    }{
      "status": "ok"
    }

Les commentaires individuels peuvent être supprimés d'une source, en utilisant l'ID fourni lors de l' ajout du commentaire.

Toutes les données associées à ce commentaire seront définitivement supprimées.

Obtenir un commentaire par ID

/api/v1/sources/<project>/<source_name>/comments/<comment_id>

Autorisations requises : afficher les sources

  • Bash
    curl -X GET 'https://<my_api_endpoint>/api/v1/sources/<project>/<source>/comments/0123456789abcdef' \
        -H "Authorization: Bearer $REINFER_TOKEN"curl -X GET 'https://<my_api_endpoint>/api/v1/sources/<project>/<source>/comments/0123456789abcdef' \
        -H "Authorization: Bearer $REINFER_TOKEN"
    
  • Nœud
    const request = require("request");
    
    request.get(
      {
        url: "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/comments/0123456789abcdef",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );const request = require("request");
    
    request.get(
      {
        url: "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/comments/0123456789abcdef",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );
  • Python
    import json
    import os
    
    import requests
    
    response = requests.get(
        "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/comments/0123456789abcdef",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))import json
    import os
    
    import requests
    
    response = requests.get(
        "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/comments/0123456789abcdef",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))
    
  • Réponse
    {
      "comment": {
        "context": "1596721237668",
        "created_at": "2020-08-06T13:20:28.531000Z",
        "id": "0123456789abcdef",
        "last_modified": "2020-08-06T13:40:37.668000Z",
        "messages": [
          {
            "body": {
              "text": "Alice,\n\nHere are the figures for today.\n\nRegards,\nBob"
            },
            "from": "bob@organisation.org",
            "sent_at": "2011-12-11T11:05:10Z",
            "subject": {
              "text": "Today's figures"
            },
            "to": ["alice@company.com"]
          }
        ],
        "source_id": "47194279497e141e",
        "text_format": "plain",
        "timestamp": "2011-12-11T11:05:10Z",
        "uid": "47194279497e141e.0123456789abcdef",
        "user_properties": {
          "string:Recipient Domain": "company.com",
          "string:Sender Domain": "organisation.org"
        }
      },
      "status": "ok"
    }{
      "comment": {
        "context": "1596721237668",
        "created_at": "2020-08-06T13:20:28.531000Z",
        "id": "0123456789abcdef",
        "last_modified": "2020-08-06T13:40:37.668000Z",
        "messages": [
          {
            "body": {
              "text": "Alice,\n\nHere are the figures for today.\n\nRegards,\nBob"
            },
            "from": "bob@organisation.org",
            "sent_at": "2011-12-11T11:05:10Z",
            "subject": {
              "text": "Today's figures"
            },
            "to": ["alice@company.com"]
          }
        ],
        "source_id": "47194279497e141e",
        "text_format": "plain",
        "timestamp": "2011-12-11T11:05:10Z",
        "uid": "47194279497e141e.0123456789abcdef",
        "user_properties": {
          "string:Recipient Domain": "company.com",
          "string:Sender Domain": "organisation.org"
        }
      },
      "status": "ok"
    }

Le commentaire sera renvoyé dans le format décrit dans la Référence du commentaire.

Obtenir les commentaires par ID de fil de discussion

/api/v1/sources/<project>/<source_name>/threads?id=<thread_id0>[&id=<thread_id1>...]

Autorisations requises : afficher les sources

  • Bash
    curl -X GET 'https://<my_api_endpoint>/api/v1/sources/<project>/<source>/threads?id=185521538102&id=81745162' \
        -H "Authorization: Bearer $REINFER_TOKEN"curl -X GET 'https://<my_api_endpoint>/api/v1/sources/<project>/<source>/threads?id=185521538102&id=81745162' \
        -H "Authorization: Bearer $REINFER_TOKEN"
    
  • Nœud
    const request = require("request");
    
    request.get(
      {
        url: "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/threads?id=185521538102&id=81745162",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );const request = require("request");
    
    request.get(
      {
        url: "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/threads?id=185521538102&id=81745162",
        headers: {
          Authorization: "Bearer " + process.env.REINFER_TOKEN,
        },
      },
      function (error, response, json) {
        // digest response
        console.log(JSON.stringify(json, null, 2));
      }
    );
  • Python
    import json
    import os
    
    import requests
    
    response = requests.get(
        "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/threads?id=185521538102&id=81745162",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))import json
    import os
    
    import requests
    
    response = requests.get(
        "https://<my_api_endpoint>/api/v1/sources/<project>/<source>/threads?id=185521538102&id=81745162",
        headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
    )
    
    print(json.dumps(response.json(), indent=2, sort_keys=True))
    
  • Réponse
    {
      "status": "ok",
      "threads": [
        {
          "messages": ["4321dcba.1234", "4321dcba.2345", "4321dcba.3456"],
          "thread_id": "185521538102"
        },
        {
          "messages": [],
          "thread_id": "81745162"
        }
      ]
    }{
      "status": "ok",
      "threads": [
        {
          "messages": ["4321dcba.1234", "4321dcba.2345", "4321dcba.3456"],
          "thread_id": "185521538102"
        },
        {
          "messages": [],
          "thread_id": "81745162"
        }
      ]
    }
Pour chaque ID de fil de discussion spécifié, la réponse contiendra une liste d'UID de commentaires (au format source_id.comment_id) qui appartiennent à ce fil de discussion. Notez que vous n'obtiendrez pas d'erreur si vous fournissez un ID de fil de discussion qui n'existe pas ; à la place, la liste de commentaires correspondante dans la réponse sera vide.

Cette page vous a-t-elle été utile ?

Obtenez l'aide dont vous avez besoin
Formation RPA - Cours d'automatisation
Forum de la communauté UiPath
Uipath Logo White
Confiance et sécurité
© 2005-2024 UiPath Tous droits réservés.