Skip to main content

Calling Method

Request Format

POST Request

warning

Note: The Content-Type must be application/x-www-form-urlencoded, and the request body should be formatted using urlencode.

Request Restrictions

The request image must be base64-encoded and then passed in after urlencode: Base64 encoding of an image means converting image data into a string, using this string instead of an image URL. You can first obtain the binary data of the image, remove the encoding header, and then apply urlencode.

warning

Note:

  • The base64 encoding of the image does not include the image header, such as (data:image/jpg;base64,).
  • When using tools like Postman or request libraries in Python, PHP, etc., urlencode is automatically handled, so manual processing is not required.
  • Supported image formats: PNG, JPG, JPEG, BMP, TIFF. If other formats are needed, please contact technical support.

Request URL Data Format

To send a POST request to the API service address, parameters must be included in the URL:

  • access_token: Required parameter, refer to "Access Token Retrieval."
warning

Note: The access_token is valid for 30 days and must be refreshed every 30 days.

Parameters in the POST request should be structured according to the API documentation.

For example, when calling the Text Recognition API, use an HTTPS POST request:

https://openapi.ocr.sys303.com/api/v1/ocr/general?access_token=24.f9ba9c5241b67688bb4adbed8bc91dec.2592000.1485570332.282335-8574074

Request Example

curl --request POST \
--url 'https://openapi.ocr.sys303.com/api/v1/ocr/general?access_token=【access_token】' \
--header 'content-type: multipart/form-data' \
--form 'image=【image path】' --form language_type=0

Response Format

JSON Format

Refer to the corresponding API for the specific format.