API Request

Request Parameters

Parameter Type Required Sample Description
client_key string Y 12345 Your client key
time int Y 1496734816 Current time(10 bit)
token string Y b4d230910ae5f97ada8ee8907afd0cd278b1455b79c83c480892da8014ada1aa API token
start_date int Y 2025-05-25 The start time of request data
end_date int Y 2025-05-25 The end time of request data
per_page int N 50 The number of data in a page, default value is 50
page int N 1 Page number

Token Generation

  1. Pass client_key and token in the request parameters for authentication. The token is generated from client_key, client_secret_key, request time, and request content
  2. Form key-value pairs with client_key, client_secret_key, request parameter content, and request UNIX timestamp
  3. Sort the key-value pairs by key in ascending order
  4. Then urlencode the parameter values
  5. Connect parameter names and values with "=" and connect parameters with "&" to get string A
  6. Hash string A using SHA256 algorithm to generate the token value
  7. Remove client_secret_key from the key-value pairs and add the token field with the value generated in the previous step
  8. Then urlencode the parameter values again
  9. Connect parameter names and values with "=" and connect parameters with "&" to get string B
  10. Add string B to the interface for the request

The client_key and client_secret_key mentioned above need to be requested from your channel manager

PHP Example for TOKEN Generation and Request

$client_key = 'your_client_key';
$client_secret_key = 'your_client_secret_key';
$base_url = 'https://open.3s.mobvista.com/channel/iaa/v1';

$params = [
    'time' => time(),
    'client_key' => $client_key,
    'client_secret_key' => $client_secret_key,
    'return_type' => 'json'
];
ksort($params);
$token = hash('sha256', http_build_query($params));
unset($params['client_secret_key']);
$params['token'] = $token;
$url = sprintf('%s?%s', $base_url, http_build_query($params));
echo file_get_contents($url) . PHP_EOL;

results matching ""

    No results matching ""