[AI66-5]FTO Search - Generate Query

post
https://connect.patsnap.com/fto_steps/query_generation
Try in Sandbox

Generates and aggregates queries from the expanded keywords, covering keyword query generation, validation, classification-code combination and aggregation. When the keywords are omitted, they are read back from this task's expansion result. POST returns running immediately; poll GET /fto_steps/query_generation/{task_id} for the result.

Request Parameters

List of parameters supported by this API endpoint

NameTypeExampleDescription
task_id
stringfto-20260928-a1b2c3d4
Task ID. Auto-generated as fto-{yyyymmdd}-{8-hex} on first call when omitted (same format as resolve_task_id in app/fto_mcp/context.py). Later steps must reuse the same task_id to read upstream artifacts.
input_lang
stringcn
Input language: cn / en / tw / jp. This step does not currently use this field (kept for compatibility, safe to ignore).
technical_proposal
string一种折叠屏电子设备的转轴结构,包括壳体、同步旋转机构与快拆锁定件……
Technical proposal description. When omitted, it is read back by task_id from a prior artifact (usually the refined result of proposal_refine, or an earlier raw proposal already persisted). Returns 422 when neither is available.
search_elements_with_keywords
array[ { "element_type": "CORE_INNOVATION", "keyword_type": "STRUCTURAL", "classifications": [ "A61F13/475" ], "relevance_score": 0.95, "chinese_keywords": [ "防漏隔边" ], "chinese_synonyms": [ [ "防漏侧边", "立体护围", "防侧漏边", "防护边缘" ] ], "english_keywords": [ "leakage barrier" ], "english_synonyms": [ [ "leakagebarrier", "standinggather", "legcuff", "sidebarrier" ] ] } ]
Feature elements with expanded keywords, taken from search_elements returned by keyword_expansion. When omitted, it is read back from this task's persisted expanded_keywords and format-converted; returns 422 when neither is available.
country
array[ "CN" ]
List of patent authorities. When omitted, reads back user_input_filter.country persisted by create_task, defaulting to ["CN"] if still unavailable.
legal_status
array[ "1", "2" ]
Legal status list of strings. When omitted, reads back user_input_filter.legal_status (normalized to strings), defaulting to ["1", "2"] if still unavailable.
include_company
array[ "华为技术有限公司" ]
Include-only company list (applicant/assignee whitelist). When omitted, reads back user_input_filter.include_company.
exclude_company
array[ "某公司A" ]
Excluded company list (applicant/assignee blacklist). When omitted, reads back user_input_filter.exclude_company.
apd_start
string2020-01-01
Start date (application/publication date filter, format YYYY-MM-DD). When omitted, reads back user_input_filter.apd_start.
apd_end
string2023-12-31
End date (application/publication date filter, format YYYY-MM-DD). When omitted, reads back user_input_filter.apd_end.

Response Schema

Structure of the API response data

Field NameTypeExampleDescription
status
Required
stringrunning
Status right after submission, always running; the actual execution happens in the background, poll with GET for the terminal state.
task_id
Required
stringfto-20260928-a1b2c3d4
Task ID; when the request body omits it, this is the value generated for this call. Later steps must carry it to continue the chain.
step_name
Required
stringproposal_refine
The submitted step name, matching the URL path.

Success Response Example

Example of a successful API response

JSON
{
  "status": true,
  "task_id": "fto-20260928-a1b2c3d4",
  "step_name": "proposal_refine",
  "error_code": 0
}

Error Codes

List of possible error codes returned by this endpoint

Business Errors

Error CodeDescription
68300004Invalid parameter!
68300005Search api failure!
68300006Analytic basic access error!
68300007Bad request!
68300008Service error, please try again later!
68300010The file does not comply with upload specifications!

Platform Errors

Error CodeDescription
67200000API call exceeds the total limit set by the platform!
67200001API call exceeds the total limit set by the platform!
67200002The current call rate is too fast, exceeding the current configuration limit QPS!
67200003The key and secret parameters for applying for the token are incorrect or the client has been disabled!
67200004The requested api does not have permission. Please contact our support personnel!
67200005Insufficient account balance/number of calls!
67200006The client has exceeded the activation validity period!
67200007The current call exceeds the configured usage limit of the day!
67200008Please check if the required apikey in the query parameter has been transmitted!
67200009The apikey does not match the passed bearerToken. Please check if a valid token is being used!
67200012The request is illegal!
67200100The current server status is busy, request response timeout!
67200101The API requested currently does not exist. Please check the request path!

HTTP Status Codes

Status CodeDescription
0Success
422Validation Error
409同一 task_id 已有步骤正在运行