communications-mining
latest
false
- API 文档
- CLI
- 集成指南
- 博客
重要 :
请注意,此内容已使用机器翻译进行了本地化。
Communications Mining 开发者指南
Last updated 2024年11月19日
来源
/api/v1/sources
所需权限:查看来源
- 重击
curl -X GET 'https://<my_api_endpoint>/api/v1/sources' \ -H "Authorization: Bearer $REINFER_TOKEN"
curl -X GET 'https://<my_api_endpoint>/api/v1/sources' \ -H "Authorization: Bearer $REINFER_TOKEN" - 节点
const request = require("request"); request.get( { url: "https://<my_api_endpoint>/api/v1/sources", 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", 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", 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", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - 响应
{ "sources": [ { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An optional long form description.", "id": "18ba5ce699f8da1f", "last_modified": "2016-02-10T23:13:28.340295+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-10T23:13:28.340295+00:00" } ], "status": "ok" }
{ "sources": [ { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An optional long form description.", "id": "18ba5ce699f8da1f", "last_modified": "2016-02-10T23:13:28.340295+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-10T23:13:28.340295+00:00" } ], "status": "ok" }
/api/v1/sources/<project>
所需权限:查看来源
- 重击
curl -X GET 'https://<my_api_endpoint>/api/v1/sources/<project>' \ -H "Authorization: Bearer $REINFER_TOKEN"
curl -X GET 'https://<my_api_endpoint>/api/v1/sources/<project>' \ -H "Authorization: Bearer $REINFER_TOKEN" - 节点
const request = require("request"); request.get( { url: "https://<my_api_endpoint>/api/v1/sources/<project>", 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>", 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>", 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>", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - 响应
{ "sources": [ { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An optional long form description.", "id": "18ba5ce699f8da1f", "last_modified": "2016-02-10T23:13:28.340295+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-10T23:13:28.340295+00:00" } ], "status": "ok" }
{ "sources": [ { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An optional long form description.", "id": "18ba5ce699f8da1f", "last_modified": "2016-02-10T23:13:28.340295+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-10T23:13:28.340295+00:00" } ], "status": "ok" }
/api/v1/sources/<project>/<source_name>
所需权限:查看来源
- 重击
curl -X GET 'https://<my_api_endpoint>/api/v1/sources/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN"
curl -X GET 'https://<my_api_endpoint>/api/v1/sources/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" - 节点
const request = require("request"); request.get( { url: "https://<my_api_endpoint>/api/v1/sources/<project>/example", 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>/example", 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>/example", 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>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - 响应
{ "source": { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An optional long form description.", "id": "18ba5ce699f8da1f", "last_modified": "2016-02-10T23:13:28.340295+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-10T23:13:28.340295+00:00" }, "status": "ok" }
{ "source": { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An optional long form description.", "id": "18ba5ce699f8da1f", "last_modified": "2016-02-10T23:13:28.340295+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-10T23:13:28.340295+00:00" }, "status": "ok" }
/api/v1/sources/id:<source_id>
所需权限:查看来源
- 重击
curl -X GET 'https://<my_api_endpoint>/api/v1/sources/id:18ba5ce699f8da1f' \ -H "Authorization: Bearer $REINFER_TOKEN"
curl -X GET 'https://<my_api_endpoint>/api/v1/sources/id:18ba5ce699f8da1f' \ -H "Authorization: Bearer $REINFER_TOKEN" - 节点
const request = require("request"); request.get( { url: "https://<my_api_endpoint>/api/v1/sources/id:18ba5ce699f8da1f", 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/id:18ba5ce699f8da1f", 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/id:18ba5ce699f8da1f", 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/id:18ba5ce699f8da1f", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - 响应
{ "source": { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An optional long form description.", "id": "18ba5ce699f8da1f", "language": "en", "last_modified": "2016-02-10T23:13:28.340295+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-10T23:13:28.340295+00:00" }, "status": "ok" }
{ "source": { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An optional long form description.", "id": "18ba5ce699f8da1f", "language": "en", "last_modified": "2016-02-10T23:13:28.340295+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-10T23:13:28.340295+00:00" }, "status": "ok" }
/api/v1/sources/<project>/<source_name>
所需权限:来源管理员
- 重击
curl -X PUT 'https://<my_api_endpoint>/api/v1/sources/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "source": { "description": "An optional long form description.", "title": "An Example Source" } }'
curl -X PUT 'https://<my_api_endpoint>/api/v1/sources/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "source": { "description": "An optional long form description.", "title": "An Example Source" } }' - 节点
const request = require("request"); request.put( { url: "https://<my_api_endpoint>/api/v1/sources/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { source: { description: "An optional long form description.", title: "An Example Source", }, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.put( { url: "https://<my_api_endpoint>/api/v1/sources/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { source: { description: "An optional long form description.", title: "An Example Source", }, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.put( "https://<my_api_endpoint>/api/v1/sources/<project>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={ "source": { "title": "An Example Source", "description": "An optional long form description.", } }, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.put( "https://<my_api_endpoint>/api/v1/sources/<project>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={ "source": { "title": "An Example Source", "description": "An optional long form description.", } }, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - 响应
{ "source": { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An optional long form description.", "id": "18ba5ce699f8da1f", "language": "en", "last_modified": "2016-02-10T23:13:28.340295+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-10T23:13:28.340295+00:00" }, "status": "ok" }
{ "source": { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An optional long form description.", "id": "18ba5ce699f8da1f", "language": "en", "last_modified": "2016-02-10T23:13:28.340295+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-10T23:13:28.340295+00:00" }, "status": "ok" }
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
language | 字符串 | 否 | 来源的主要语言。 支持的值为en (英语)和“多语言”。 默认为en 。 |
title | 字符串 | 否 | 人类可读的单行来源标题。 |
description | 字符串 | 否 | 更长的来源说明。 |
should_translate | boolean | 否 | 是否应根据需要将上传到此来源的消息翻译为language 。 默认为false 。
|
sensitive_properties | array<string> | 否 | 应标记为敏感并对非特权用户隐藏的一组属性。 |
bucket_id | 字符串 | 否 | 要从中加载数据的存储桶 ID。 数据将解析为注释并加载到此源中。 |
/api/v1/sources/<project>/<source_name>
所需权限:来源管理员
- 重击
curl -X POST 'https://<my_api_endpoint>/api/v1/sources/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "source": { "description": "An alternative description." } }'
curl -X POST 'https://<my_api_endpoint>/api/v1/sources/<project>/example' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "source": { "description": "An alternative description." } }' - 节点
const request = require("request"); request.post( { url: "https://<my_api_endpoint>/api/v1/sources/<project>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { source: { description: "An alternative description." } }, }, 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>/example", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { source: { description: "An alternative description." } }, }, 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>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={"source": {"description": "An alternative description."}}, ) 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>/example", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={"source": {"description": "An alternative description."}}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - 响应
{ "source": { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An alternative description.", "id": "18ba5ce699f8da1f", "language": "en", "last_modified": "2016-02-11T08:06:14.944290+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-11T08:06:14.944290+00:00" }, "status": "ok" }
{ "source": { "created_at": "2016-02-10T23:13:28.340295+00:00", "description": "An alternative description.", "id": "18ba5ce699f8da1f", "language": "en", "last_modified": "2016-02-11T08:06:14.944290+00:00", "name": "example", "owner": "<project>", "sensitive_properties": [], "should_translate": false, "title": "An Example Source", "updated_at": "2016-02-11T08:06:14.944290+00:00" }, "status": "ok" }
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
title | 字符串 | 否 | 人类可读的单行来源标题。 |
description | 字符串 | 否 | 更长的来源说明。 |
should_translate | boolean | 否 | 是否应根据需要将上传到此来源的消息翻译成英语。 默认为false 。 |
sensitive_properties | array<string> | 否 | 应标记为敏感并对非特权用户隐藏的一组属性。 |
bucket_id | 字符串 | 否 | 要从中加载数据的存储桶 ID。 数据将解析为注释并加载到此源中。 |
/api/v1/sources/id:<source_id>
所需权限:来源管理员
- 重击
curl -X DELETE 'https://<my_api_endpoint>/api/v1/sources/id:18ba5ce699f8da1f' \ -H "Authorization: Bearer $REINFER_TOKEN"
curl -X DELETE 'https://<my_api_endpoint>/api/v1/sources/id:18ba5ce699f8da1f' \ -H "Authorization: Bearer $REINFER_TOKEN" - 节点
const request = require("request"); request.delete( { url: "https://<my_api_endpoint>/api/v1/sources/id:18ba5ce699f8da1f", 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/id:18ba5ce699f8da1f", 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/id:18ba5ce699f8da1f", 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/id:18ba5ce699f8da1f", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - 响应
{ "status": "ok" }
{ "status": "ok" }