- Documentos da API
- CLI
- Guias de integração
- Integração do Exchange com usuário do serviço do Azure
- Integração do Exchange com Autenticação de Aplicativo do Azure
- Automação em tempo real
- Como buscar dados para o Tableau com o Python
- Integração do Elasticsearch
- Integração do EWS auto-hospedado
- Estrutura de automação da UiPath
- Atividades do UiPath Marketplace
- Atividades oficiais da UiPath
- Blog
- Como as máquinas aprendem a entender as palavras: um guia para incorporações ao NLP
- Aprendizado baseado em solicitação com Transformers
- Efficient Transformers II: extração de conhecimento e ajustes finos
- Transformers eficientes I: mecanismos de atenção
- Modelagem de intenção hierárquica profunda não supervisionada: obtenção de valor sem dados de treinamento
- Corrigindo viés de anotação com Communications Mining
- Aprendizado ativo: melhores modelos de ML em menos tempo
- Está tudo nos números - avaliando o desempenho do modelo com métricas
- Por que a validação de modelos é importante
- Comparação do Communications Mining e do Google AutoML para inteligência de dados conversacional
Comments
/api/v1/sources/<project>/<source_name>/sync
Permissões necessárias: editar mensagens.
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" } } ] }' - Nó
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.
Nome | Tipo | Required | Descrição |
---|---|---|---|
comments | array<Cmment> | sim | Um 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.
/api/v1/sources/<project>/<source_name>/sync-raw-emails
Permissões necessárias: editar mensagens
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" }' - Nó
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.
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.
Nome | Tipo | Required | Descrição |
---|---|---|---|
transform_tag | String | sim | Uma 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. |
documents | array<Document> | sim | Um lote de até 16384 documentos no formato descrito abaixo. Lotes maiores são mais rápidos (por documento) do que os menores. |
include_comments | Booleano | não | Se definido como true , os comentários analisados dos e-mails serão retornados no corpo da resposta.
|
override_user_properties | array<string> | não | As 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 .
|
Document
tem o seguinte formato:
Nome | Tipo | Required | Descrição |
---|---|---|---|
raw_email | RawEmail | sim | Dados de email, no formato descrito na Referência do comentário. |
comment_id | String | não | Identifica 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_properties | map<string, string | number> | não | Qualquer 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 .
|
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.
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.
/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" - Nó
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.
/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" - Nó
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.
/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" - Nó
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" } ] }
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.