KM Api

Base URI

http://api.km.com
API Methods
Device Group
GET /device/{deviceId}
GET /device/active/{deviceId}
POST /device/active
checkDevice
GET /device/{deviceId}

Kiểm tra Device thuộc Hanet hay không?

Path variables

deviceId
string optional

Responses

200 OK
Body
boolean
Examples
true
404 Not Found
checkActive
GET /device/active/{deviceId}

Kiểm tra Device đã được kích hoạt hay chưa?

Path variables

deviceId
string required

Responses

200 OK
Body
boolean
Examples
true
400 Bad Request
404 Not Found
deviceActive
POST /device/active

Kích hoạt thiết bị

Request headers

Content-Type
string optional
Default:
application/json

Request body

Responses

201 Created
Body
string
Examples
"DEVICE_ACTIVED_KEY"
400 Bad Request
Song
GET /song/{name}/{style}/{singer}/{listmvonbox}/{number}/{page}
getSongList
GET /song/{name}/{style}/{singer}/{listmvonbox}/{number}/{page}

Get Danh sách bài hát từ server

Path variables

name
string optional
style
string optional
singer
string required
listmvonbox
string optional
number
string optional
page
string optional

Request parameters

name
string required

Tên bài hát

style
string required

Thể loại bài hát

singer
string optional

Tên ca sỹ

listmvonbox
string optional
number
integer optional
page
integer optional

Request headers

Content-Type
string required

application/json

token
string optional
deviceId
string required

Responses

200 OK
Body
404 Not Found
Payment
GET /payment/checkMoney
POST /payment/buySong
POST /payment/payCoin
GET /payment/getPayments/{pageIndex}/{pageNumber}
checkMoney
GET /payment/checkMoney

Kiểm tra số tiền hiện có của user

Request headers

Content-Type
string required

application/json

deviceId
string required
token
string required

Responses

200 OK
Body
number
Examples
100000
404 Not Found
buySong
POST /payment/buySong

Thanh toán tiền cho bài hát

Request headers

Content-Type
string optional
Default:
application/json
deviceId
string required
token
string required

Request body

Object
songid
number
Example:
1
price
number
Example:
12000

Responses

201 Created
Body
number
Examples
800000
400 Bad Request
404 Not Found
payCoin
POST /payment/payCoin

Request headers

Content-Type
string required
Default:
application/json
token
string required

Request body

Object
songid
string
Example:
1
price
string
Example:
12000

Responses

200 OK
Body
string
Examples
"mp3.km.com/bai-hat/nothing-s-gonna-my-love-for-you.../zw67cfez.htm"
404 Not Found
getPayments
GET /payment/getPayments/{pageIndex}/{pageNumber}

Lấy về danh sách các lần thanh toán tiền qua payment provider

Path variables

pageIndex
string required
pageNumber
string required

Request headers

Content-Type
string optional

application/json

deviceId
string required
token
string required

Responses

200 OK
Body
Array of Payment
401 Unauthorized
400 Bad Request
404 Not Found
Account
POST /account
createAccount
POST /account

Add new Account

Request headers

Content-Type
string required

application/json

Request body

Responses

201 Created
Body
400 Bad Request

Examples

POST http://api.km.com/account HTTP/1.1 

Content-Type: application/json

{
    "id": "",
    "username": "nguyengiap1467@gmail.com",
    "email": "nguyengiap1467@gmail.com",
    "password": "admin@123",
    "createdAt": "2015-01-01",
    "isValidate": true,
    "validateKey": "",
    "validateExpired": "2015-01-01",
    "coins": 1
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "",
    "username": "nguyengiap1467@gmail.com",
    "email": "nguyengiap1467@gmail.com",
    "password": "admin@123",
    "createdAt": "2015-01-01",
    "isValidate": true,
    "validateKey": "",
    "validateExpired": "2015-01-01",
    "coins": 1
}

HTTP/1.1 400 Bad Request 
Data Reference
Device object

Properties

id
string
activeAt
string date
isActive
boolean
activePhone
string
createBy
string
createAt
string date
updateBy
string
updateAt
string date
Methods: deviceActive
Song object

Properties

id
number
Example:
1
name
string
Example:
Nothing's Gonna Change My Love For You
urlMovie
string
Example:
mp3.km.com/bai-hat/nothing-s-gonna-my-love-for-you.../zw67cfez.htm
style
number
price
number
Example:
12000
isActive
boolean
Example:
true
activePhone
string
createBy
string
createAt
string
Example:
2015-01-01T13:00:00
updateBy
string
updateAt
string
Example:
2015-01-01T13:00:00
Methods: getSongList
Payment object

Properties

id
number
Example:
1
transactionId
number
Example:
1
price
string
Example:
12000
accountId
string
isActive
string
Example:
true
createBy
string
createAt
string
Example:
2015-01-01T13:00:00
updateBy
string
updateAt
string
Example:
2015-01-01T13:00:00
Methods: getPayments
Account object

Properties

id
string
username
string
Example:
nguyengiap1467@gmail.com
email
string
Example:
nguyengiap1467@gmail.com
password
string
Example:
admin@123
createdAt
string
Example:
2015-01-01
isValidate
boolean
validateKey
string
validateExpired
string
Example:
2015-01-01
coins
number
Methods: createAccount