Skip to main content

Parameters Instructions

Instructions for API request parameters#

note

NOTE: The following parameters is included in all services (different values). If no parameters for body then pass blank, like body:””

NameDescriptionTypeMandatoryNotes
bodyBusiness parametersObjectNSome APIs may require body
timestampTimestampLongYAccurate into a second
appIdApply from AWDAStringY
vVersion codeStringNDefault 1.0
signatureSignatureStringYAll requests need signature

example:

{    "body": "1111",    "timestamp": 1488363493,    "signature": "B3C14758F4AF52AE8AA0D4CD1493B137",    "appId": "111",    "v":"1.0"}

Rules for signature#

Rules for signature:

  • Step 1:Sort the parameters alphabetically by key name. Result will be: appId、body、timestamp、v
  • Step 2:Combine key and value of all the parameters. Result will be: appId:123456body:{"orderNo":"1234567"}timestamp:1558923813v:1.0
  • Step 3:Add secret to the last of the result from step 2, which will become the signature. Result will be: appId:123456body:{"orderNo":"1234567"}timestamp:1558923813v:1.0yoursecret
  • Step 4:MD5 encryption of the signature string. Result will be: B6F6E3F9ADF4D7558F54BC8B7D9869CC

Java Sample Codes for Signature#

String[] keys = new String[map.size()];int i = 0;for (Map.Entry<String, Object> entry : map.entrySet()) {    keys[i++] = entry.getKey();}Arrays.sort(keys);StringBuilder stringBuilder = new StringBuilder();for (String key : keys) {    stringBuilder.append(key);    stringBuilder.append(":");    stringBuilder.append(map.get(key));}stringBuilder.append(secret);String str=stringBuilder.toString();String encodeStr = DigestUtils.md5Hex(str).toUpperCase();return encodeStr ;

API Response#

ParametersDescriptionTypeMandatoryNotes
codeStatus codeIntegerY

0: Success

Other codes all represent failure, find more details in Code List

messageStatus descriptionStringYCode description
resultReturn dataObjectNWhen code=0, there will be business data returned inside result object

Sample response for success request:#

{  "code": 0,  "message": "Permintaan berhasil",  "result": {    "state": true  }}