The signature (sign) algorithm is described as follows:1.
Arrange non-empty request parameters in alphabetical order based on the ASCII code of the parameter names (dictionary order), using the URL key-value pair format (i.e., key1=value1&key2=value2...), and concatenate them into a string StringParm.
2.
Concatenate secret at the end of StringParm to obtain the string StringParmSign.
3.
Perform a sha1 operation on StringParmSign, and convert all characters of the obtained string to uppercase to get the final sign.
4.
This signature value, along with the system-level parameter sign, is sent to the service open platform along with other request parameters.
Assuming the values of these business-level parameters and system-level parameters are as shown in the table below:| System-Level Parameter Name | Parameter Value | Business-Level Parameter Name | Parameter Value |
|---|
| appkey | 000001 | userName | wx |
| timestamp | 1556595508 | age | 24 |
| nonce | 24523 | sex | 1 |
According to the signature algorithm, first, assemble all parameter names and values into a string by sorting them in ascending order based on the ASCII code of the parameter names:
age=24&appkey=000001&nonce=24523&sex=1×tamp=1556595508&userName=wx
Assuming the secret (application key) for appkey 000001 is "a1b1c1d1", add "a1b1c1d1" to the end of the above request parameters to obtain:
age=24&appkey=000001&nonce=24523&sex=1×tamp=1556595508&userName=wx&secret=a1b1c1d1
Note: The secret does not participate in sorting and does not need to be passed in the interface call; it is only used for signature generation.
Perform a sha1 signature operation on the above string and convert the characters to uppercase to obtain:
963A56BAEBED746F2746E4D9B3B77BE0F2E171E7
Finally, the client can initiate a request to the service method with the following message (JSON format) via a POST request to the business URL address (format such as: baseURL/api/v1/xxx/xxx):POST baseURL/api/specific_interface_address (do not concatenate parameters) HTTP/1.1
Content-Type: application/json;charset=utf-8
{
"appkey": "000001",
"timestamp": 1556595508,
"nonce": 24523,
"sign": "963A56BAEBED746F2746E4D9B3B77BE0F2E171E7",
"userName": "wx",
"age": "24",
"sex": "1"
}
Java signature generation code example: Modified at 2025-11-06 06:50:44