openapi文档 (0.1.0)

Download OpenAPI specification:

Question API

创建问题

创建或复用一个问题记录。创建执行任务时,需要使用返回的 question_id。

Authorizations:
APIKeyHeaderHTTPBearer
Request Body schema: application/json
required
content
required
string (Content)

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "content": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

查询问题列表

分页查询当前 api_key 可访问的问题记录,可按 ID、内容和时间范围过滤。

Authorizations:
APIKeyHeaderHTTPBearer
query Parameters
page
integer (Page) >= 1
Default: 1

Page number, starting at 1.

page_size
integer (Page Size) [ 1 .. 200 ]
Default: 50

Items per page. Maximum 200.

Id (string) or Id (null) (Id)

Filter by question ID.

Id In (string) or Id In (null) (Id In)

Comma-separated ID list.

Content (string) or Content (null) (Content)

Filter by contained question content.

Created At From (string) or Created At From (null) (Created At From)

Filter by created_at greater than or equal to this timestamp.

Created At To (string) or Created At To (null) (Created At To)

Filter by created_at less than or equal to this timestamp.

Updated At From (string) or Updated At From (null) (Updated At From)

Filter by updated_at greater than or equal to this timestamp.

Updated At To (string) or Updated At To (null) (Updated At To)

Filter by updated_at less than or equal to this timestamp.

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "page": 0,
  • "page_size": 0,
  • "total": 0
}

删除问题

删除一个问题,并同步删除该问题关联的任务、结果和引用来源。

Authorizations:
APIKeyHeaderHTTPBearer
path Parameters
question_id
required
string (Question Id)

Responses

Response samples

Content type
application/json
{
  • "property1": "string",
  • "property2": "string"
}

查询可用平台

分页查询支持的平台。创建任务时,请使用已启用平台的 platform_id。

Authorizations:
APIKeyHeaderHTTPBearer
query Parameters
page
integer (Page) >= 1
Default: 1

Page number, starting at 1.

page_size
integer (Page Size) [ 1 .. 200 ]
Default: 50

Items per page. Maximum 200.

Enabled (boolean) or Enabled (null) (Enabled)

Filter by enabled state. Omit to return all platforms.

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "page": 0,
  • "page_size": 0,
  • "total": 0
}

创建执行任务

为一个问题创建异步执行任务。如果不传 platform_ids,服务会为所有已启用平台创建任务。

Authorizations:
APIKeyHeaderHTTPBearer
Request Body schema: application/json
required
question_id
required
string (Question Id)
Array of Platform Ids (strings) or Platform Ids (null) (Platform Ids)

Responses

Request samples

Content type
application/json
{
  • "question_id": "string",
  • "platform_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "question": {
    },
  • "tasks": [
    ]
}

查询任务列表

分页查询任务状态。可用于轮询 queued、running、succeeded、failed 等执行状态。

Authorizations:
APIKeyHeaderHTTPBearer
query Parameters
page
integer (Page) >= 1
Default: 1

Page number, starting at 1.

page_size
integer (Page Size) [ 1 .. 200 ]
Default: 50

Items per page. Maximum 200.

Id (string) or Id (null) (Id)

Filter by task ID.

Id In (string) or Id In (null) (Id In)

Comma-separated ID list.

Question Id (string) or Question Id (null) (Question Id)

Filter by question ID.

Question Id In (string) or Question Id In (null) (Question Id In)

Comma-separated ID list.

Platform Id (string) or Platform Id (null) (Platform Id)

Filter by platform ID.

Platform Id In (string) or Platform Id In (null) (Platform Id In)

Comma-separated ID list.

Status (string) or Status (null) (Status)

Filter by task status.

Status In (string) or Status In (null) (Status In)

Comma-separated value list, for example queued,running.

Created At From (string) or Created At From (null) (Created At From)

Filter by created_at greater than or equal to this timestamp.

Created At To (string) or Created At To (null) (Created At To)

Filter by created_at less than or equal to this timestamp.

Started At From (string) or Started At From (null) (Started At From)

Filter by started_at greater than or equal to this timestamp.

Started At To (string) or Started At To (null) (Started At To)

Filter by started_at less than or equal to this timestamp.

Finished At From (string) or Finished At From (null) (Finished At From)

Filter by finished_at greater than or equal to this timestamp.

Finished At To (string) or Finished At To (null) (Finished At To)

Filter by finished_at less than or equal to this timestamp.

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "page": 0,
  • "page_size": 0,
  • "total": 0
}

查询结果列表

分页查询执行结果。设置 include_citations=true 时,会在每条结果中包含引用来源。

Authorizations:
APIKeyHeaderHTTPBearer
query Parameters
page
integer (Page) >= 1
Default: 1

Page number, starting at 1.

page_size
integer (Page Size) [ 1 .. 200 ]
Default: 50

Items per page. Maximum 200.

Id (string) or Id (null) (Id)

Filter by run ID.

Id In (string) or Id In (null) (Id In)

Comma-separated ID list.

Task Id (string) or Task Id (null) (Task Id)

Filter by task ID.

Task Id In (string) or Task Id In (null) (Task Id In)

Comma-separated ID list.

Question Id (string) or Question Id (null) (Question Id)

Filter by question ID.

Question Id In (string) or Question Id In (null) (Question Id In)

Comma-separated ID list.

Platform Id (string) or Platform Id (null) (Platform Id)

Filter by platform ID.

Platform Id In (string) or Platform Id In (null) (Platform Id In)

Comma-separated ID list.

Profile Id (string) or Profile Id (null) (Profile Id)

Filter by profile ID.

Profile Id In (string) or Profile Id In (null) (Profile Id In)

Comma-separated ID list.

Status (string) or Status (null) (Status)

Filter by run status.

Status In (string) or Status In (null) (Status In)

Comma-separated value list, for example queued,running.

Started At From (string) or Started At From (null) (Started At From)

Filter by started_at greater than or equal to this timestamp.

Started At To (string) or Started At To (null) (Started At To)

Filter by started_at less than or equal to this timestamp.

Finished At From (string) or Finished At From (null) (Finished At From)

Filter by finished_at greater than or equal to this timestamp.

Finished At To (string) or Finished At To (null) (Finished At To)

Filter by finished_at less than or equal to this timestamp.

Updated At From (string) or Updated At From (null) (Updated At From)

Filter by updated_at greater than or equal to this timestamp.

Updated At To (string) or Updated At To (null) (Updated At To)

Filter by updated_at less than or equal to this timestamp.

include_citations
boolean (Include Citations)
Default: false

Include citations in each run item.

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "page": 0,
  • "page_size": 0,
  • "total": 0
}

查询单个结果

按 run_id 查询单个执行结果。可通过 include_citations 控制是否返回引用来源。

Authorizations:
APIKeyHeaderHTTPBearer
path Parameters
run_id
required
string (Run Id)
query Parameters
include_citations
boolean (Include Citations)
Default: true

Include citations in the run detail.

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "task_id": "string",
  • "question_id": "string",
  • "platform_id": "string",
  • "platform_name": "string",
  • "question_content": "string",
  • "profile_id": "string",
  • "status": "string",
  • "answer": "string",
  • "actual_question": "string",
  • "started_at": "2019-08-24T14:15:22Z",
  • "finished_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "citations": [
    ]
}

查询引用来源

分页查询结果中的引用来源。可按 run_id 过滤,查看某个结果对应的来源。

Authorizations:
APIKeyHeaderHTTPBearer
query Parameters
page
integer (Page) >= 1
Default: 1

Page number, starting at 1.

page_size
integer (Page Size) [ 1 .. 200 ]
Default: 50

Items per page. Maximum 200.

Id (string) or Id (null) (Id)

Filter by citation ID.

Id In (string) or Id In (null) (Id In)

Comma-separated ID list.

Run Id (string) or Run Id (null) (Run Id)

Filter by run ID.

Run Id In (string) or Run Id In (null) (Run Id In)

Comma-separated ID list.

Source (string) or Source (null) (Source)

Filter by source.

Source In (string) or Source In (null) (Source In)

Comma-separated value list, for example queued,running.

Url (string) or Url (null) (Url)

Filter by contained URL text.

Title (string) or Title (null) (Title)

Filter by contained title text.

Published At (string) or Published At (null) (Published At)

Filter by published_at string.

Published At In (string) or Published At In (null) (Published At In)

Comma-separated value list, for example queued,running.

Created At From (string) or Created At From (null) (Created At From)

Filter by created_at greater than or equal to this timestamp.

Created At To (string) or Created At To (null) (Created At To)

Filter by created_at less than or equal to this timestamp.

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "page": 0,
  • "page_size": 0,
  • "total": 0
}

检查服务状态

返回最小健康检查结果。该接口不需要 API 认证。

Responses

Response samples

Content type
application/json
{
  • "status": "string"
}