Text Compare - Compare API

Important Notice:

  • All request and response parameters are strictly subject to the official API documentation.
  • The API response may contain fields not defined in the documentation. These fields are for internal debugging purposes only and are not guaranteed to be stable or compatible. Do not rely on these fields in production environments. ZOLOZ reserves the right to modify or remove these fields at any time without prior notice.

Overview

API URL: /api/v1/zoloz/textcompare/compare

API Description: Provides the capability to compare two texts and return a similarity score.

Request Parameters

Field Name

Type

Max Length

Default Value

Description

Example

bizId

String

32

-

Required. A unique business ID for tracing purposes. For example, the sequence ID from the merchant's business-related database.

Note: The ZOLOZ server does not perform uniqueness checks on the value of this field. For better tracking, it is strongly recommended to enable the merchant server to guarantee the uniqueness of the business ID. 

"1759743058709"

textData1

String

512

-

Required. Text 1 for comparison.

"fff"

textData2

String

512

-

Required. Text 2 for comparison.

"fff"

Response Parameters

Field Name

Type

Description

Example

result

Result

Required. The API request result, which contains information about the result of the API request, such as status and error codes. 

{

"resultStatus": "S",

"resultCode": "SUCCESS",

"resultMessage": "Success"

}

transactionId

String

Optional. Transaction ID

Note: The system will only return the transactionIdafter the transaction enters the processing stage. If an error occurs before the transaction begins processing, the system will not return a transactionId. This includes, but is not limited to, the following situations:

  • Invalid request parameters, such as incorrect input format or missing required parameters.
  • The request fails to reach the server successfully, such as due to network issues or gateway failures.
  • The request is denied due to system rate limiting.

"G000000006FTC2025100600000014509101****"

score

Double

Optional. Text comparison score. The score ranges from 0 to 100. Higher scores indicate higher similarity.

"88.2"

Result

Field Name

Type

Description

Example

resultCode

String

Required. Result codes:

  • SUCCESS: The API call succeeds.
  • SYSTEM_ERROR: Internal error. See resultMessage for details.
  • INVALID_ARGUMENT: Invalid input parameters. See resultMessage for details.

"SUCCESS"

resultStatus

String

Required. Result status:

  • S: Success
  • F: Failure

"S"

resultMessage

String

Required. Result message.

"Success"

Sample

Request sample

copy
POST /api/v1/zoloz/textcompare/compare HTTP/1.1
Content-Type: application/json; charset=UTF-8
Client-Id: 5X67656YXXXXXX
Request-Time: 2025-10-06T21:56:11-0800
Signature: algorithm=RSA256, signature=xxxxxxxxxxxx
{
  "bizId": "1759743058709",
  "textData2": "fff",
  "textData1": "fff"
}

Response Sample

copy
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Response-Time: 2025-10-06T21:56:15-0800
Signature: algorithm=RSA256, signature=xxxxxxxxxxxxxxxxxx
{
  "result": {
    "resultCode": "SUCCESS",
    "resultMessage": "Success",
    "resultStatus": "S"
  },
  "score": 88.2,
  "transactionId": "G000000006FTC2025100600000014509101****"
}