Apply OTT
POST/rest/v1.1/qr/apply-ott
This API is used to get one time token that will be used as authorization parameter upon redirecting to DANA.
For the easiest integration, use DANA's Libraries to implement DANA Widget Binding.
API Type
SNAP API
Expected Timeout
8 second
SNAP Service Code
49
Accept
application/json
Content Type
applciation/json
Content-Type
string
1 - 127 charactersRequiredContent type, value always
application/jsonAuthorization-Customer
string
1 - 512 charactersRequiredContains customer token, which has been obtained from binding process
X-TIMESTAMP
string
25 charactersRequiredTransaction date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
X-SIGNATURE
string
RequiredSignature need to be generated with
asymmetricSignature methodORIGIN
string
Origin domain
X-PARTNER-ID
string
1 - 36 charactersRequiredUnique identifier for partner was generated by DANA, or known as clientId
X-EXTERNAL-ID
string
1 - 36 charactersRequiredUnique messaging reference identifier generated by merchant and should be unique within the same day
X-IP-ADDRESS
string
15 charactersIP address of the end user (customer) using IPv4 format
X-DEVICE-ID
string
1 - 400 charactersRequiredDevice identification on which the API services is currently being accessed by the end user (customer). Sample:
- Web Application:
- Mozilla / 5.0 (Windows NT 10.0; Win64; x64)
- AppleWebKit / 537.36 (KHTML, like Gecko)
- Chrome / 75.0.3770.100
- Safari / 537.36 OPR / 62.0.3331.99
- Mobile Application:
- Android:android-20013adf6cdd8123f
- iOS: 72635bdfd223yvjm7246n sdj34hd4559393kjh42"
X-LATITUDE
string
1 - 10 charactersLocation on which the API services is currently being accessed by the end user (customer), refer to ISO 6709 standard representation of geographic point location by coordinates, as below:
New York City
Latitude: +40.75
- ±DD.DDDD format (without minutes and seconds)
- ±DD = three-digit integer degrees part of latitude
- .DDDD = variable-length fraction part in degrees
New York City
Latitude: +40.75
X-LONGITUDE
string
1 - 10 charactersLocation on which the API services is currently being accessed by the end user (customer), refer to ISO 6709 Standard representation of geographic point location by coordinates, as below:
New York City
Latitude: -074.00
- ±DDD.DDDD format (without minutes and seconds)
- ±DDD = four-digit integer degrees part of latitude
- .DDDD = variable-length fraction part in degrees
New York City
Latitude: -074.00
CHANNEL-ID
string
1 - 5 charactersRequiredDevice identification on which the API services is currently being accessed by the end user (customer)
userResources
string array
1 - 64 charactersRequiredValue always One Time Token (
OTT)additionalInfo
json object
Additional information
additionalInfo.accessToken
string
1 - 512 charactersRequiredContains customer token, which has been obtained from binding process
POST .../rest/v1.1/qr/apply-ott HTTP/1.2
Content-type: application/json
Authorization-Customer: Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a
X-TIMESTAMP: 2020-12-23T08:31:11+07:00
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
ORIGIN: www.hostname.com
X-PARTNER-ID: 82150823919040624621823174737537
X-EXTERNAL-ID: 41807553358950093184162180797837
X-IP-ADDRESS: 172.24.281.24
X-DEVICE-ID: 09864ADCASA
X-LATITUDE: -6.108841
X-LONGITUDE: 106.7782137
CHANNEL-ID: 95221
{
"userResources": [
"OTT"
],
"additionalInfo": {
"accessToken" : "fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a"
}
}
Content-Type
string
1 - 127 charactersRequiredContent type, value always
application/jsonX-TIMESTAMP
string
25 charactersRequiredTransaction date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
responseCode
string
7 charactersRequiredRefer to response code list
responseMessage
string
1 - 150 charactersRequiredRefer to response code list
userResources
array of json object
RequiredUser resources
resourceType
string
1 - 32 charactersConditionalInformation of resource type. List of resource retrieved:
OTTConditional Info
Y:= Successfully processed
value
string
1 - 64 charactersConditionalValue of OTT
Conditional Info
Y:= Successfully processed
additionalInfo
json object
Additional information
Content-type: application/json
X-TIMESTAMP: 2020-12-23T08:31:11+07:00
{
"responseCode": "2004900",
"responseMessage": "Successful",
"userResources": [
{
"resourceType": "OTT",
"value": "jadoijasod9879847120947201ifh0afhq08hd1038"
}
],
"additionalInfo": {}
}
| Response | Cause | Solution |
|---|---|---|
2004900Successful | Success to be processed | Mark Apply OTT process as Success |
4004900Bad Request | General request failed error | Mark Apply OTT process as Failed. Retry request with proper parameter |
4004901Invalid Field Format | Invalid format for certain field | Mark Apply OTT process as Failed. Retry request with proper parameter |
4004902Invalid Mandatory Field | Missing or invalid format on mandatory field | Mark Apply OTT process as Failed. Retry request with proper parameter |
4014900Unauthorized. [reason] | General unauthorized error | Mark Apply OTT process as Failed. Retry request with proper parameter |
4014902Invalid Customer Token | Customer token are invalid, perhaps due to token expiry | Mark Apply OTT process as Failed. Retry request with proper parameter |
4014904Customer Token Not Found | Customer token not found in the system. This occurs on any API that requires token as input parameter | Mark Apply OTT process as Failed. Retry request with proper parameter |
4034905Do Not Honor | Account or user status is abnormal | Mark Apply OTT process as Failed. Retry request with proper parameter or can contact DANA to check the user/account status |
4294900Too Many Requests | Maximum transaction limit exceeded | Mark Apply OTT process as Failed. Retry request periodically |
5004900General Error | General error non retry-able | Mark Apply OTT process as Failed. Retry request periodically |
5004901Internal Server Error | Unknown internal server failure, please retry the process again | Mark Apply OTT process as Failed. Retry request periodically |
Total timeout | Total timeout, the client side does not get any responses from the server side (Can be due to network issue, server slowing down, and so on) | Do a retry maximum 3 attempts, if still fails mark Apply OTT process as Failed |
Unexpected response (Empty field/field does not exist/undefined response code) | The server does not produce expected responses (Can be due to hardware failure, bugs, and so on) |
|