RESTful APIs
This document is intended to guide partners using APIs for the services provided https://daily.gate.vn
Request Methods
HTTP has multiple request "verbs", such as GET
, POST
, etc.
An HTTP Method (verb) defines how a request should be interpreted by a server.
The endpoints in this section demonstrate various HTTP Verbs. API supports
all the HTTP Verbs, including some rarely used ones, such as PROPFIND
, UNLINK
,
etc.
The HTTP GET
request method is meant to retrieve data from a server. The data
is identified by a unique URI (Uniform Resource Identifier).
A GET
request can pass parameters to the server using "Query String
Parameters". For example, in the following request,
The parameter "hand" has the value "wave".
This endpoint echoes the HTTP headers, request parameters and the complete URI requested.
The HTTP POST
request method is meant to transfer data to a server
(and elicit a response). What data is returned depends on the implementation
of the server.
A POST
request can pass parameters to the server using "Query String
Parameters", as well as the Request Body. For example, in the following request,
POST /hi/there?hand=wave
The parameter "hand" has the value "wave". The request body can be in multiple
formats. These formats are defined by the MIME type of the request. The MIME
Type can be set using the Content-Type
HTTP header. The most commonly used
MIME types are:
multipart/form-data
application/x-www-form-urlencoded
application/json
This endpoint echoes the HTTP headers, request parameters, the contents of the request body and the complete URI requested.
This is expected to be sent back as part of response body.
The HTTP POST
request method is meant to transfer data to a server
(and elicit a response). What data is returned depends on the implementation
of the server.
A POST
request can pass parameters to the server using "Query String
Parameters", as well as the Request Body. For example, in the following request,
POST /hi/there?hand=wave
The parameter "hand" has the value "wave". The request body can be in multiple
formats. These formats are defined by the MIME type of the request. The MIME
Type can be set using the Content-Type
HTTP header. The most commonly used
MIME types are:
multipart/form-data
application/x-www-form-urlencoded
application/json
This endpoint echoes the HTTP headers, request parameters, the contents of the request body and the complete URI requested when data is sent as a form parameter.
Headers
The following set of endpoints allow one to see the headers being sent as part of a request and to get a custom set of headers as part of response.
HTTP header fields provide required information about the request or response, or about the object sent in the message body. Both request headers and response headers can be controlled using these endpoints.
A GET
request to this endpoint returns the list of all request headers as part of the response JSON.
In Postman, sending your own set of headers through the Headers tab will reveal the headers as part of the response.
This endpoint causes the server to send custom set of response headers. Providing header values as part of the URL parameters of a GET
request to this endpoint returns the same as part of response header.
To send your own set of headers, simply add or replace the the URL parameters with your own set.
Authentication Methods
This endpoint simulates a basic-auth protected endpoint.
The endpoint accepts a default username and password and returns a status code of 200 ok
only if the same is provided.
Otherwise it will return a status code 401 unauthorized
.
Username:
[account on https://daily.gate.vn]
Password:
password
Password encrypt with RSA Public key length 1024 bit
[GATE,MOBI,VINA,VIETTEL,GARENA,ZING,BEELINE,KASPERSKY,VCOIN,VN MOBI,ECASH,STEAM,NINTENDO_USD,XBOX_USD,PLAYSTATION_USD]
{
"requestId": "81232317238743",
"codeType": "GATE",
"amount": "10000",
"quantity": "2",
}
{
"balance": 1994639030,
"cards": [
{
"serial": "CA00005779",
"pin": "5266D3A37FE3DF51623DDD936A7641B1",
"expireDate": "12/22/2019 2:54:41 PM",
"saleDate": "12/22/2018 2:54:41 PM"
},
{
"serial": "CA00005780",
"pin": "665487EE97FC9C5B6BF98F59A1B0AF4D",
"expireDate": "12/22/2019 2:54:41 PM",
"saleDate": "12/22/2018 2:54:41 PM"
}
],
"orderInfo": {
"status": 1,
"createDate": "12/22/2018 2:54:40 PM",
"decription": "Mua thẻ Gate 10000 - Số lượng : 2 thẻ - Hình thức: API - PARTNERTRANSID:81232317238743",
"quantity": 2,
"total": 18800,
"price": 9400,
"total_buy": 18800,
"total_sale": 20000,
"total_profit": 1200
},
"code": 0,
"message": "Thực hiện giao dịch thành công",
"systemTradeId": "6894FF4BF1B9",
"requestId": "81232317238743",
"requestIp": "10.8.37.60",
"responseTime": "1545490481",
"signature": "RkgcfVf6AxwoKXgUm+ycXsOboqxnO0fzdPP1RNaA88iIW+3lVrLIUu2eYt74BvmAENekXeQLD0I9RBIdCNMyu4uWpWdf9bUnems8c7RYKx0/feM+a3CFrN85vQcUhBzfJvYP5UlqytbnsIQK2kKBj9zE8s8fgZl/6t9lo/sB4uU="
}
[GATE]
{
"requestId": "81232317238743",
"codeType": "GATE",
"serialNumber": "FC00000000",
"pinNumber": "1111111111",
}
{
CardValue: 100000,
balance: 487740530,
orderInfo:
{ status: 1,
createDate: '2/10/2020 3:21:45 PM',
decription: 'Giao dich thanh cong ! Gach the GATE 100000 - vao tai khoan: 0903886637. Hinh thuc API!',
quantity: 1,
total: 100000,
price: 100000,
total_buy: 100000,
total_sale: 86000,
total_profit: 14000
},
code: 0,
message: 'Giao dich thanh cong',
systemTradeId: '42622A181F1A',
requestId: '0829109137728703',
requestIp: '127.0.0.1',
responseTime: '1581347854904',
signature:
'SoqKO+CHjx4GE/lGZswgm21nmZ9bDJ4QCjLB1AJhs0dUkD1/cbABWxfk6B/6waMwpJNutImI6dD6eqNy5HXJBJOeSI+b5Gxw/DfBKjxfSDgfxFwv6/kwJvrOwnkcK5pS1VuYhDjPASWEw7mywGRGQF0GwKwoy72cTcYUfewKQJg='
}
{
"requestId": "34539845",
}
{
"balance": 9107000,
"code": 0,
"message": "Giao dich thanh cong",
"systemTradeId": "1545439105682",
"requestId": "34539845",
"requestIp": "10.8.37.60",
"responseTime": "1545439106",
"signature": "hzE8SEDLYD6d0YvSZYRIcmPafakd7bgBamR29TlJa7DSvvAOmhg5r3WpeSo9kE17TskBiUfDbN6fyazkBkcc1rwuIZbU54UKw+aOCfQjbOQbS+OAGKW57jnu6LnlBvuTSZy2VEFw0esTj0YISYWP65MFgyHpEBdpgpy9V3OjKyQ="
}
{
"requestId": "12345678",
"reloadRequestId": "81232317238743",
}
{
"cards": [
{
"serial": "CA00005779",
"pin": "5266D3A37FE3DF51623DDD936A7641B1",
"expireDate": "12/22/2019 2:54:41 PM",
"saleDate": "12/22/2018 2:54:41 PM"
},
{
"serial": "CA00005780",
"pin": "665487EE97FC9C5B6BF98F59A1B0AF4D",
"expireDate": "12/22/2019 2:54:41 PM",
"saleDate": "12/22/2018 2:54:41 PM"
}
],
"orderInfo": {
"status": 1,
"createDate": "12/22/2018 2:54:40 PM",
"decription": "Mua thẻ Gate 10000 - Số lượng : 2 thẻ - Hình thức: API - PARTNERTRANSID:81232317238743",
"quantity": 2,
"total": 18800,
"price": 9400,
"total_buy": 18800,
"total_sale": 20000,
"total_profit": 1200
},
"code": 0,
"message": "Giao dịch thành công",
"systemTradeId": "6894FF4BF1B9",
"requestId": "6436873164",
"requestIp": "10.8.37.60",
"responseTime": "1545490565",
"signature": "UB/cAZn+VEkcSDr2UZz07auEX6IkMVwoxRMkkAM8ctS0PsVhXdZZoBjsjhLJMCxFbWUagP8Hst4w8P5mMMpSa2xTbyMwnf2B9PPPhje8iwRksM4bKTNhPQXBHjuEIIbweX+YU06/TDiGa0p8wz0mrNrjb2RTDyNDQoX/J71ccmo="
}
{
"requestId": "81232317238743",
"topupType": "prepaid",
"target": "0978883586",
"targetVendor": "viettel",
"amount": 10000,
}
{
"balance": 1958531410,
"orderInfo": {
"status": 1,
"createDate": "1/23/2019 4:29:22 PM",
"decription": "Nap tien vao so: 0978883586, Hinh thuc API",
"quantity": 1,
"total": 9510,
"price": 9510,
"total_buy": 9510,
"total_sale": 10000,
"total_profit": 490
},
"code": 0,
"message": "Thuc hien giao dich thanh cong",
"systemTradeId": "664BE0C900B5",
"requestId": "81232317238743",
"requestIp": "113.161.93.54",
"responseTime": "1548260963",
"signature": "EoMXM2Q/HdtBm3GQD2i4YJ3vYC4fTy5Ei1wUCozLGR83oMo1Ecd1h63rLdOfHVIJ+jx0id5uYRvEOhCW0Un0ZGEmQ6nAqlFN4ZWn/nFo35+8Du6YAh6CZANJM5HnMHpgjit86adft1YZLje8+tHitLhith08k2Jrb+hzXBQ3CtM="
}
{
"requestId": "12345678",
"checkRequestId": "81232317238743",
}
{
"orderInfo": {
"status": 1,
"createDate": "12/22/2018 2:54:40 PM",
"decription": "Mua thẻ Gate 10000 - Số lượng : 2 thẻ - Hình thức: API - PARTNERTRANSID:81232317238743",
"quantity": 2,
"total": 18800,
"price": 9400,
"total_buy": 18800,
"total_sale": 20000,
"total_profit": 1200
},
"code": 0,
"message": "Giao dịch thành công",
"systemTradeId": "6894FF4BF1B9",
"requestId": "6436873164",
"requestIp": "10.8.37.60",
"responseTime": "1545492636",
"signature": "UprGgMZFaoBfOJnQECYIeU1P+FiubEDQJ8UonQQVdtBP/rh5d1enExBRKkxpWLKzOoXJ6nVk4mr1J+SZtdM7MpwcC9QalE/fUzAiLiuLdKSGWfftP2ux3F3qtRSGmY4LKDoiSquZ5L/ISQFs5g5lrF8Jjh1Ytbdw6Pt6Du0XiPQ="
}
Utilities
Use the RSA with SHA1 data signature of RSA Private key.
Data input is a sequence of all elements arranged in alphabetical sort by key ex:
a=x&b=xx&c=vcc
{
"requestId": "6436873164",
"reloadRequestId": "81232317238732",
}
reloadRequestId=81232317238732&requestId=6436873164
Use the RSA with SHA1 verify signature for RSA Public key.
Data input is a sequence of all elements arranged in alphabetical sort by key ex:
a=x&b=xx&c=vcc
{
"cards": [
{
"serial": "CA00005769",
"pin": "5CD1C1B6CD265B47CEAC15DFF301314C",
"expireDate": "12/22/2019 12:39:48 AM",
"saleDate": "12/22/2018 12:39:48 AM"
},
{
"serial": "CA00005770",
"pin": "FDCA69D808CCB2FACB82478836F433A5",
"expireDate": "12/22/2019 12:39:48 AM",
"saleDate": "12/22/2018 12:39:48 AM"
}
],
"code": 0,
"message": "Giao dịch thành công",
"systemTradeId": "1545440125751",
"requestId": "6436873164",
"requestIp": "10.8.37.60",
"responseTime": "1545440126",
"signature": "cvYem9fTPfN3aSCy/NCUN4LqS9AnxVacELpQQ31c4BvAWYhH7M821rKJMlp11MU4YN8oHa6bDy/yOeiCDrSwbcSB7+/fsuY3ffoSqpgPK2i5DkpHVSOsnSHPHyNfNozZ+qKzKom5eYVbLda9SBXiX9tcFwYLNkLhe5P8k+j1MTQ="
}
cards=[{"serial":"CA00005769","pin":"5CD1C1B6CD265B47CEAC15DFF301314C","expireDate":"12/22/2019 12:39:48 AM","saleDate":"12/22/2018 12:39:48 AM"},{"serial":"CA00005770","pin":"FDCA69D808CCB2FACB82478836F433A5","expireDate":"12/22/2019 12:39:48 AM","saleDate":"12/22/2018 12:39:48 AM"}]&code=0&message=Giao dịch thành công&requestId=1545440760588&requestIp=10.8.37.60&responseTime=1545440752&systemTradeId=1545440752438
Template response with error code
{
"dataRequest": {
"signature": "xICPw4XHF5vtLtqb7m3Xo/3DMBcnzRk561YsBo/y/B0TafzkKQhJKjY8YugxOcTq3TvIAKd1FWla4Dhtur3X/mf2lnxnFWFC9zCHEhDxkOkGbAwC5ilohjPKkWvk3ofR4d+65utK1vT8knMKq18uzUuaSeQY1JX5wHIDoLI7P3/0=",
"original": "checkRequestId=81232317238743&requestId=6436873164"
},
"code": 20,
"message": "Chữ ký điện tử không hợp lệ.",
"systemTradeId": "1545493539346",
"requestId": "6436873164",
"requestIp": "10.8.37.60",
"responseTime": "1545493539",
"signature": "UIOrcqE4coK1V2YyJIk93OJ5Ab+gPlptbQWVFENxzTS3eTXoFpuoLSwxl9pxFqLit2sKQ/aZ6K9ebosDp0lcRLIMQAv4ejCa8oqXNizWT+Cu2qvQbbsNHpfYH8k4kHWohDe56EqIwEyL38W/FnmOV3YAc5Dswq1ZecG+vWpuMhc="
}
{
"code": 807,
"message": "Account does not exist.",
"systemTradeId": "1545493688407",
"requestId": "6436873164",
"requestIp": "10.8.37.60",
"responseTime": "1545493688",
"signature": null
}
{
"code": 99,
"message": "Lỗi hệ thống",
"systemTradeId": "1545493921007",
"requestId": "34539845",
"requestIp": "::1",
"responseTime": "1545493921",
"signature": "PamU872pGst6SMAdCH408p3Z29vEndE2L0hPd3w08CYF3LLRkjMM8Y3m+mbUes7k84SSYrQBxWb8VhG381jXAPZa+gKi8i6oyoIzqvyWSJpc5aM03fhDPz19gFtp+Sq7TtnPKEiGOA9GyhjIkKpZzy/RdbDXOahb9tLHtkjPSBs="
}
Note that if an invalid status code is requested to be sent, the server returns a status code of 0
.
Developers please use the information below to develop before going live.
https://developer-daily.gate.vn:17443/api/rest
Username:
0903886637
Password:
123456
RSA Public key
-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCI6T12WztLVpN3yV1JIzbqT4Tc GohOXOtEjNmSvutblJZSSiesqLbNTPy9prmn1xswECPpO+YaxZkuD8PCQYtI+HGM i51ICZfxTW6EKiIwFbfy9M4hSvqE5o7W8SgC163+s72WrT1WIVyk6lUfV4u36Wz2 I0qVvZ0ZiQlqWGt8/wIDAQAB -----END PUBLIC KEY-----
RSA Private key
-----BEGIN RSA PRIVATE KEY----- MIICXAIBAAKBgQCI6T12WztLVpN3yV1JIzbqT4TcGohOXOtEjNmSvutblJZSSies qLbNTPy9prmn1xswECPpO+YaxZkuD8PCQYtI+HGMi51ICZfxTW6EKiIwFbfy9M4h SvqE5o7W8SgC163+s72WrT1WIVyk6lUfV4u36Wz2I0qVvZ0ZiQlqWGt8/wIDAQAB AoGAJRmHBS59p9GjDl+rfqkjNWUs7HPoIcv+GMpOHvzLTDq8bToY/CmPt5w4FLA8 OOYKQQDuqkIH/ZM0Cg5NjrMyKcDSN/BzUV09cvor3skAd7gSVL2XYpvQrntm+/uC v0/zhmDUE0b2MNIadTknDM6uvIAueGJBfSq3IVYCz78ZBTkCQQDqnPGfvqV/fBWw SGHDJBfVk+2C6uZQM1NF6MUrLi+Ci9YxR+49fT4DiIzrOCzdcnpvhIY1/3QdmAm2 w9YqswuFAkEAlWRFUGmDjZmZR8xxh4J5STxqHzboa7Pqmj3bMK5oWNrbFJDX8tXv uIdXpTc9unC5N7pjB3zfSIPbffgsLI5jswJAGakQxGgVsdvgg2dnSfCoqrODRs5q Yls6wGq1JgPnLmAdDUbQx+jq33gP8aozPgVHXusfwsgt6w62AUdqJUFwAQJAR1Wv +2vG05Cqrqwi8fANdjkQ+4K+jN9GgQxUY/SEAxnOTw2y8FPTuit2YH/2S9aTutaX fvXTsM61unsMrOH5HQJBALvwC7glJMe+ZkZubg188LB5c5gchrqiEr4JQH/1N0dF ILNTMRQ6bUFVdpHKG6gUYZVSNAtQNeZfh/fmKvd0Ds8= -----END RSA PRIVATE KEY-----
Sample Code