The general steps for signature generation are as follows:
In the first step, set all the sent or received data as set M. Sort M by ASCII code of the parameter name from smallest to largest (dictionary order), remove the space on both sides of the parameter value ,using the format of the URL key-value pairs (i.e. key1=value1&key2=value2...) to splice the string stringA.
Pay particular attention to the following important rules.
◆ ASCII codes of parameter names are sorted from small to large (dictionary order).
◆Parameter names are case-sensitive.
◆Parameter value needs URL_ Encode code
◆The interface may add fields, which must be supported when verifying the signatures.
The second step is to splice the key on the end of stringA to get stringSignTemp and perform MD5 operation on stringSignTemp, then convert all the characters of the obtained string to uppercase to get gntoken value.
◆ APPKEY Setting Path: Platform-->User Center-->Reseller-->API Settings
2、Generate signature string
Assume that the transmitted parameters are as follows, take PHP code as an example:
$appid="10015fskaswkk"; $gntime="1596529764"; $ym="gname.com"; $url="https://www.gname.com"
Step 1: The value needs to be url_encode encoded，according to the format of key=value for the parameters, and the parameter names are sorted in ASCII dictionary order as follows:
$stringA = "appid=11&gntime=1596529764&url=https%3A%2F%2Fwww.gname.com&ym=gname.com";
Step 2: Splice APPKEY：
$appkey = "192006250b9f6a2d" // Note: appkey $gntoken = strtoupper(md5($stringA.$appkey)); //note: MD5 signature method and convert to uppercase