Current position: document > > signature algorithm

signature algorithm:  

(1)  All request parameters are sorted in ascending order by parameter names; 

(2)  Compose a string by interconnecting the requested parameter name and parameter value:

<paramName1><paramValue1><paramName2><paramValue2>…; 

(3)  Add the application key to the head and tail of the above request parameter string, respectively:<apikey><Request parameter string><apikey>; 

(4)  MD5 signature for this string, 32 lowercase characters; 

(5)  The signature value is sent to the API server with the sign parameter and other request parameters. 

The hypothetical parameters are as follows:

agentid:a0001

ti:1468920835

cardNum:13800000000

method:test

format:json


According to the signature algorithm, first, all parameter names and parameter values are assembled into a string according to the alphabetical order of the parameter name: 

agentida0001cardNum13800000000formatjsonmethodtestti1468920835


Suppose that AgentID (a0001) apikey (application key) is "ABCDEF", then add ABCDEF to the head and tail of the above request parameter string. 

abcdefagentida0001cardNum13800000000formatjsonmethodtestti1468920835abcdef

The MD5 signature operation for the above string is obtained.2c87eb59e5622e29b262737d8a2c5611

Finally, the client can use the following URL request string to initiate a request for the service method

http://<server>/<url>?agentid=a0001&ti=1468920835&cardNum=13800000000&method=test&format=json&sign=2c87eb59e5622e29b262737d8a2c5611


DK downloads (Java and PHP versions): Click this download/a>