Intervention Platform External API

Marco Translator

GET/POST/ai/intervention/translation/rule/add

Glossary Import API. Up to 100 intervention glossaries can be imported per request.

Resquest Parameters

Parameter

Type

Required

Description

secretKey

String

Yes

Termbase Key: Obtain the key from the Terminology library management. Fill in the key corresponding to the glossary. Glossary URL: https://aidge.com/intervention Sample:"bUFuNHc3eWkrRUZoSlhadzZOblNldz0"

glossaryId

String

Yes

Glossary id.You can obtain it from the glossary management page.

uploadedRuleList

List

Yes

Uploaded Glossary List: A maximum of 100 intervention rules can be uploaded per request. Each intervention rule consists of four fields, as outlined below.

sourceLanguage

String

Yes

Source Language Code: The supported language pairs are shown below. Sample:"en"

targetLanguage

String

Yes

Target Language Code: The supported language pairs are shown below.

Sample:"zh"

sourceText

String

Yes

Source Text for the glossary: When the input contains the specified phrase, it will be directly replaced with the target text without being processed by the translation model.

Sample:"test"

targetText

String

Yes

Target Text for the glossary: The source text in the input will be translated into the target text. Sample:"测试"

Sample Request

The maximum response time for the interface is 30 seconds. It is recommended to set the request timeout to not exceed 30 seconds when making a call.

For other programming languages, please refer to Quick Start

/*The domain url of the API.
 *for api purchased on global site. set api_domain to "https://api.aidc-ai.com"
 *for api purchased on chinese site"https://cn-api.aidc-ai.com"URL (for api purchased on chinese site) set api_domain to "https://cn-api.aidc-ai.com"*/
IopClient client = new IopClientImpl("domain url", "your key", "your secret");
IopRequest request = new IopRequest();
request.setApiName("/ai/intervention/translation/rule/add");
// If a formal quota has not been purchased, please include the trial flag; otherwise, a NoResource error code will be returned.
// request.addHeaderParameter("x-iop-trial","true");
request.addApiParameter("secretKey", "bUFuNHc3eWkrRUZoSlhadzZOblNldz0");
request.addApiParameter("glossaryId", "glossary_123");
request.addApiParameter("uploadedRuleList", "[{\"targetLanguage\":\"zh\",\"sourceText\":\"test\",\"sourceLanguage\":\"en\",\"targetText\":\"测试\"}]");
IopResponse response = client.execute(request);
System.out.println(response.getBody());
Thread.sleep(10);

Parameter Response

Parameter

Type

Description

resCode

Number

Response code;200 indicates a successful call. For other response codes,please refer to the error code information.

requestId

String

request ID

success

Boolean

Success Status: true indicates success, false indicates failure.

resMessage

String

Error message,e.g. "content has sensitive data, please try other input".

Sample Response

{
  "requestId": "0be295cd17588601710544530e0ec1",
  "success": true,
  "resCode": 200,
  "resMessage": "success",
  "code": "0",
  "request_id": "2151fa1917588601712315576",
  "_trace_id_": "0be295cd17588601710544530e0ec1"
}

Errors

Error Code

Error Message

Description

500

system error

system error

501

rate limit exceed

The current interface has reached the current limit. Please contact us via Discord or email us ([email protected]) to increase the current limit value.

700

invalid input

The format of the input parameters does not meet the requirements, and resMessage will return detailed fields that do not meet the requirements.

3001

No permission. Contact the glossary admin or super admin.

Accessed a glossary without permission. Please provide the ID and key from the intervention platform.

Last updated

Was this helpful?