communications-mining
latest
false
Importante :
Este conteúdo foi traduzido com auxílio de tradução automática.
UiPath logo, featuring letters U and I in white
Guia do desenvolvedor do Communications Mining
Last updated 26 de nov de 2024

Comments

Adicionar ou atualizar comentários

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

Permissões necessárias: editar mensagens.

Importante:

Operação Faturável

Será cobrado 1 AI Unit por comentário criado ou por comentário atualizado (com base em seu ID exclusivo) se o texto tiver sido modificado.

  • 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"
          }
        }
      ]
    }'
    
  • 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))
    
  • Resposta
    {
      "new": 2,
      "status": "ok",
      "unchanged": 0,
      "updated": 0
    }{
      "new": 2,
      "status": "ok",
      "unchanged": 0,
      "updated": 0
    }

O ID de um comentário identifica exclusivamente ele dentro de uma origem. Se o ID de comentário fornecido não existir na origem, um novo comentário será criado. Caso contrário, um comentário existente será atualizado.

NomeTipoRequiredDescrição
commentsarray<Cmment>simUm lote com o máximo de 16384 comentários, no formato descrito na Referência do comentário. Lotes maiores são mais rápidos (por comentário) do que os menores.

Campos gerais atribuídos

Os campos gerais atribuídos serão preservados, a menos que o texto seja alterado significativamente. Os rótulos atribuídos nunca são descartados.

Solicitações grandes

Para solicitações grandes, esse ponto de extremidade pode levar mais tempo para responder. Você deve aumentar o tempo limite do cliente.

Adicionar ou atualizar comentários de emails brutos

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

Permissões necessárias: editar mensagens

Importante:

Operação Faturável

Você será cobrado 1 AI Unit por comentário criado ou por comentário atualizado (com base no ID da mensagem do e-mail) se seu texto tiver sido modificado.

  • 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"
    }'
    
  • 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))
    
  • Resposta
    {
      "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
    }

Cada e-mail bruto será convertido em um comentário do Communications Mining. O Communications Mining gerará o ID do comentário com base no cabeçalho “Message-ID” do e-mail. Se um comentário com esse ID não existir na origem, um novo comentário será criado. Caso contrário, um comentário existente será atualizado.

Ao converter um e-mail bruto para um comentário, o Communications Mining limpará o corpo do e-mail e gerará metadados a partir dos cabeçalhos de e-mail. Você pode definir include_comments como true para incluir os comentários gerados na resposta. Os comentários serão retornados no formato descrito na Referência do Comentário.
NomeTipoRequiredDescrição
transform_tagStringsimUma tag que identifica a integração de email que envia os dados. Você deve ter recebido essa tag durante a configuração da integração.
documentsarray<Document>simUm lote de até 16384 documentos no formato descrito abaixo. Lotes maiores são mais rápidos (por documento) do que os menores.
include_commentsBooleanonãoSe definido como true, os comentários analisados dos e-mails serão retornados no corpo da resposta.
override_user_propertiesarray<string>nãoAs propriedades do usuário fornecidas em documents substituirão as propriedades do usuário geradas automaticamente se seus nomes aparecerem nesta lista. Os nomes de propriedades do usuário nesta lista devem ser especificados sem o prefixo do tipo , por exemplo, como My Property e não string:My Property.

Onde Document tem o seguinte formato:

NomeTipoRequiredDescrição
raw_emailRawEmailsimDados de email, no formato descrito na Referência do comentário.
comment_idStringnãoIdentifica exclusivamente um comentário. Se nenhum ID de comentário for fornecido, o Communications Mining gerará o ID do comentário a partir do ID da mensagem do e-mail. O formato é descrito na Referência de comentários.
user_propertiesmap<string, string | number>nãoQualquer metadado definido do usuário que se aplique ao comentário. O formato é descrito na Referência de comentários.
Observação: algumas propriedades de usuário são geradas com base no conteúdo de e-mail. Se eles entrarem em conflito com as propriedades do usuário carregadas, a solicitação falhará com 422 Unprocessable Entity.
AVISO:

Campos gerais atribuídos

O Communications Mining gerará o conteúdo das "mensagens" do comentário a partir do corpo bruto do e-mail e um subconjunto dos cabeçalhos brutos do e-mail, levando em consideração a tag de transformação especificada. Os campos gerais atribuídos serão preservados, a menos que o texto seja alterado significativamente. Os rótulos atribuídos nunca são descartados.

Importante:

Solicitações grandes

Para solicitações grandes, esse ponto de extremidade pode levar mais tempo para responder. Você deve aumentar o tempo limite do cliente.

Excluir comentários

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

Permissões necessárias: editar mensagens

  • 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"
    
  • 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))
    
  • Resposta
    {
      "status": "ok"
    }{
      "status": "ok"
    }

Os comentários individuais podem ser excluídos de uma origem usando o ID fornecido quando o comentário foi adicionado.

Todos os dados associados a este comentário serão excluídos permanentemente.

Obter um comentário por id

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

Permissões necessárias: exibir origens

  • 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"
    
  • 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))
    
  • Resposta
    {
      "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"
    }

O comentário será retornado no formato descrito na Referência do Comentário.

Obter comentários por ID do thread

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

Permissões necessárias: exibir origens

  • 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"
    
  • 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))
    
  • Resposta
    {
      "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"
        }
      ]
    }
Para cada ID de thread especificado, a resposta conterá uma lista de UIDs de comentários (no formato source_id.comment_id) que pertencem a esse thread. Observe que você não receberá um erro se fornecer um ID de thread que não existe; em vez disso, a lista de comentários correspondente na resposta estará vazia.

Esta página foi útil?

Obtenha a ajuda que você precisa
Aprendendo RPA - Cursos de automação
Fórum da comunidade da Uipath
Uipath Logo White
Confiança e segurança
© 2005-2024 UiPath. Todos os direitos reservados.