API documentation

API - Mars QA 1.2.1

Welcome to the MarsQA API (Application Programming Interface) documentation. MarsQA's API is a simple, convenient, and secure way to access MarsQA functionality from third-party applications programmatically. You can request a trial by visiting https://qa.marshub.comarrow-up-right and contacting us via the feedback form.

To use this document, you should have a basic familiarity with software development and the MarsQA user interface.

Create Session

This is a new API. The caller only provides data to be verified. Verification options and operations are set and operated by the user.

After creation, the caller and user interface cannot modify the file list and data, but can verify the data multiple times.

POST {{endpoint}}/api/v1/session
JSON Field
Description
Required

editorURLTemplate

Used to navigate to your translation editor

Y

callbackUrl

For receiving verification reports

N

files

Documents

Y

file.type

file or segment

Y

file.filename

File Name

Y

file.uri

if type=file URI is required

Y/N

file.content

Object Array, if type=segment content is required

Y/N

file.srcLang

if type=segment srcLang is required

Y/N

file.trgLang

if type=segment trgLang is required

Y/N

Create verify session example

POST /api/v1/session HTTP/1.1
Content-Type: application/json
Authorization: Bearer <your_token>
...

{
  "editorURLTemplate": "<Optional>",
  "callbackUrl": "<your_url>",
  "files": [  
    {
      "type": "file",
      "docId": "your_doc_id",
      "filename": "SamplePhotoPrinter.doc.sdlxliff",
      "uri": "https://marsqa.oss-cn-hongkong.aliyuncs.com/0rux4gwov7cp4ub7.sdlxliff"
    },
    {
      "type": "segment",
      "docId": "your_doc_id",
      "filename": "your_filename.mqxliff",
      "srcLang": "en-US",
      "trgLang": "zh-CN",
      "content": [
        {
          "source": "The world is beautiful",
          "target": "世界很美好"
        },
        ...
      ]
    },
    ...
  ]
}

You will get a Session ID

Then open the link in your browser: {{endpoint}}/verify/:sessionId, If authentication results already exist for the session, the results of the most recent request are displayed.

Every time the user clicks the "Verify" button, after the verification is successful, the URL of the message verification report will be sent to the callbackUrl

Get requests of session

GET {{endpoint}}/api/v1/session/:sessionId/requests

Response example

Get results: GET {{endpoint}}/api/v1/report/:requestId

Get the latest results of session: GET {{endpoint}}/api/v1/session/:sessionId/last

Verify

  • This API has added permission verification, you need API Token to access

  • Punctuation Checker Options

  • Space Checker Options

Example

Field Descriptions

JSON Field
Description
Required

editorURLTemplate

If you need to generate links for each Issue to link to your translation editor and navigate to rows, please specify this value; otherwise set to "". eg: https://www.example.com/editor/{docId}#{segId}

Y

async

If true, you will quickly obtain the Report ID and later obtain the report data by callback. OR: GET /api/v1/report/{id}

N (default: false)

callbackURL

if async=true callbackURL is required

N

input

Documents (JsonObject Array)

Y

input*.type

file or segment

Y

input*.filename

file name

Y

input*.uri

if type=file URI is required

Y/N

input*.content

if type=segment content is required

Y/N

input*.srcLang

if type=segment srcLang is required

Y/N

input*.trgLang

if type=segment trgLang is required

Y/N

filter

Exclude segments

Y

filter.excludeLockedSegments

Exclude locked segments

Y

filter.excludeICESegments

Exclude ICE segments

Y

filter.exclude100Segments

Exclude 100% match segments

Y

filter.excludeReviewed

Exclude reviewed/proofreading segments

Y

verify

Checker list and settings (JsonObject Array)

Y

verify*.id

Checker ID

Y

verify*.enable

false: this check is skipped

Y

verify*.group

Group name

N

verify*.description

description

N

verify*.options

checker options

N

Error Codes

Code
Description

UNSUPPORTED_FILETYPE

File type not supported

Synch API,Async API

INVALID_URI

Invalid URI, cannot download file

Synch API

READ_FILE_FAILED

Unable to read/parse file

Synch API

UNKNOWN_ERROR

Synch API

Synch Request

You need to set async to false, which will directly respond to the verification results.

Request

Response (Status is Succeeded)

Async Request

You need to set async to true before sending the request, and then you will get a request ID. You can then use the request ID to actively fetch the validation results, or receive the results via a callback.

Request example

Response example

Get result by callback

Callback on success

Callback on failure

The result will be send to callbackUrl when QA has been completed.

Get result by request_id

  • id path param, request_id

Example

Share

Generate shared links

Response

Shared link expires after seven days

Checker list

Basic Group

Standard Group

Advance Group

userAvailableChars is the number of characters available to the user. If the number of characters in the machine translation spot-check is greater than this value, an error message will be returned.

Example

Request body example

Response Example

Last updated