Skip to main content

Authentication Mechanism

Introduction

The main purpose of authentication is to obtain the Access_token. The Access_token is the user's access token, which carries information such as the user's identity and permissions. Authentication consists of the following two steps:

  1. Obtain AK/SK
  2. Obtain Access_token
  • Code form → Suitable for users with a computer background
  • Web debugging tool → Suitable for users with no background

Obtain AK/SK

  • The API is a paid call
  • Priority service support for companies
  • Price: $ 0.056/call【For large-scale calls, please contact business support】
  • Contact Us

Obtain Access_token

ShengBang API Open Platform uses OAuth2.0 authorization to call open APIs. When calling the API, the Access_token parameter must be included in the URL. The default validity period of the Access_token is 30 days. The process to obtain the Access_token is as follows:

Request URL Data Format
URL
https://openapi.ocr.sys303.com/api/v1/oauth/token?client_id={API Key}&client_secret={Secret Key}&grant_type=client_credentials
  • grant_type: Required parameter, fixed as client_credentials;
  • client_id: Required parameter, the API Key of the application;
  • client_secret: Required parameter, the Secret Key of the application;

POST request example:

https://openapi.ocr.sys303.com/api/v1/oauth/token?client_id=Fq5eR3LT0vuXV&client_secret=0rDSjzQ20XUj5itV6WRtz&grant_type=client_credentials
request example
curl -X 'POST' \
'https://openapi.ocr.sys303.com/api/v1/oauth/token?client_id=【client_id】&client_secret=【client_secret】&grant_type=client_credentials' \
-H 'accept: application/json' \
-d ''
Response Format

JSON Format

Successful Response
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.xxxxxE1MTQ5NDcsImlzcyI6Imh0dHBzOi8vYXBpLm9jci5zeXxxxxxxxaHR0cHM6Ly9vY3Iuc3lzMzAzLmNvbSIsIm5hbWUxxxxxx.xxxxxx8csbHvSKSXtjDcc0zxxxxxxx",
"expires": 1731514947
}
Error Response
{
"error_code": 6,
"error_msg": "No permission to access data",
"details": null
}