You are on page 1of 85

PROTOCOLS v8.

3
StarCom Music
Tng HM

DESCRIPTION
Protocols for interchange between CLIENT & WEB SERVER

Mc lc
Sample Protocol .................................................................................................................................................... 6
Description ........................................................................................................................................................ 6
Definition .......................................................................................................................................................... 6
Params .............................................................................................................................................................. 6
API check version .................................................................................................................................................. 7
Description ........................................................................................................................................................ 7
Definition .......................................................................................................................................................... 7
Params .............................................................................................................................................................. 8
API get list item ..................................................................................................................................................... 9
Description ........................................................................................................................................................ 9
Definition .......................................................................................................................................................... 9
Params ............................................................................................................................................................ 10
Notes ............................................................................................................................................................... 13
Lc nhiu th loi ........................................................................................................................................ 13
Lc danh sch tin ........................................................................................................................................ 15
Lc danh sch feed ca blog ....................................................................................................................... 16
API get node detail.............................................................................................................................................. 18
Description ...................................................................................................................................................... 18
Definition ........................................................................................................................................................ 18
Params ............................................................................................................................................................ 19
Notes ............................................................................................................................................................... 20
Lc chi tit tin.............................................................................................................................................. 20
Lc chi tit blog ........................................................................................................................................... 21
API get album detail ............................................................................................................................................ 23
Description ...................................................................................................................................................... 23
Definition ........................................................................................................................................................ 23
Params ............................................................................................................................................................ 24
API filter .............................................................................................................................................................. 25
Description ...................................................................................................................................................... 25
Definition ........................................................................................................................................................ 25
Params ............................................................................................................................................................ 26
1

References ...................................................................................................................................................... 27
Search field & value table ........................................................................................................................... 27
API get list artist .................................................................................................................................................. 28
Description ...................................................................................................................................................... 28
Definition ........................................................................................................................................................ 28
Params ............................................................................................................................................................ 29
API get list album of an artist .............................................................................................................................. 30
Description ...................................................................................................................................................... 30
Definition ........................................................................................................................................................ 30
Params ............................................................................................................................................................ 31
API get artist detail ............................................................................................................................................. 32
Description ...................................................................................................................................................... 32
Definition ........................................................................................................................................................ 32
Params ............................................................................................................................................................ 32
API get top list category ...................................................................................................................................... 34
Description ...................................................................................................................................................... 34
Definition ........................................................................................................................................................ 34
Params ............................................................................................................................................................ 35
API get list music type ......................................................................................................................................... 36
Description ...................................................................................................................................................... 36
Definition ........................................................................................................................................................ 36
Params ............................................................................................................................................................ 37
API create playlist ............................................................................................................................................... 38
Description ...................................................................................................................................................... 38
Definition ........................................................................................................................................................ 38
Params ............................................................................................................................................................ 38
API get list playlist ............................................................................................................................................... 40
Description ...................................................................................................................................................... 40
Definition ........................................................................................................................................................ 40
Params ............................................................................................................................................................ 41
Notes ............................................................................................................................................................... 41
Danh sch playlist rng ............................................................................................................................... 41
API delete playlist ............................................................................................................................................... 42
2

Description ...................................................................................................................................................... 42
Definition ........................................................................................................................................................ 42
Params ............................................................................................................................................................ 42
API edit playlist ................................................................................................................................................... 44
Description ...................................................................................................................................................... 44
Definition ........................................................................................................................................................ 44
Params ............................................................................................................................................................ 45
API playlist........................................................................................................................................................... 46
Description ...................................................................................................................................................... 46
Definition ........................................................................................................................................................ 46
Params ............................................................................................................................................................ 47
API get list item from playlist .............................................................................................................................. 48
Description ...................................................................................................................................................... 48
Definition ........................................................................................................................................................ 48
Params ............................................................................................................................................................ 49
API favorite ......................................................................................................................................................... 51
Description ...................................................................................................................................................... 51
Definition ........................................................................................................................................................ 51
Params ............................................................................................................................................................ 52
API get list item from favorite............................................................................................................................. 53
Description ...................................................................................................................................................... 53
Definition ........................................................................................................................................................ 53
Params ............................................................................................................................................................ 54
API get list recent item........................................................................................................................................ 56
Description ...................................................................................................................................................... 56
Definition ........................................................................................................................................................ 56
Params ............................................................................................................................................................ 57
API login .............................................................................................................................................................. 59
Description ...................................................................................................................................................... 59
Definition ........................................................................................................................................................ 59
Params ............................................................................................................................................................ 60
Notes ............................................................................................................................................................... 60
Login from other systems ........................................................................................................................... 60
3

API change profile ............................................................................................................................................... 62


Description ...................................................................................................................................................... 62
Definition ........................................................................................................................................................ 62
Params ............................................................................................................................................................ 63
Notes ............................................................................................................................................................... 64
Cp nht ti khon Facebook...................................................................................................................... 64
ng b ti khon Facebook ...................................................................................................................... 65
API create node................................................................................................................................................... 67
Description ...................................................................................................................................................... 67
Definition ........................................................................................................................................................ 67
Params ............................................................................................................................................................ 68
Notes ............................................................................................................................................................... 69
API edit blog ........................................................................................................................................................ 71
Description ...................................................................................................................................................... 71
Definition ........................................................................................................................................................ 71
Params ............................................................................................................................................................ 72
API delete blog .................................................................................................................................................... 73
Description ...................................................................................................................................................... 73
Definition ........................................................................................................................................................ 73
Params ............................................................................................................................................................ 74
API get list comment ........................................................................................................................................... 75
Description ...................................................................................................................................................... 75
Definition ........................................................................................................................................................ 75
Params ............................................................................................................................................................ 77
API create comment ........................................................................................................................................... 78
Description ...................................................................................................................................................... 78
Definition ........................................................................................................................................................ 78
Params ............................................................................................................................................................ 78
Notes ............................................................................................................................................................... 79
Create comment from other systems ......................................................................................................... 79
API edit comment ............................................................................................................................................... 80
Description ...................................................................................................................................................... 80
Definition ........................................................................................................................................................ 80
4

Params ............................................................................................................................................................ 81
Notes ............................................................................................................................................................... 81
Create comment from other systems ......................................................................................................... 81
API delete comment ........................................................................................................................................... 82
Description ...................................................................................................................................................... 82
Definition ........................................................................................................................................................ 82
Params ............................................................................................................................................................ 83
Notes ............................................................................................................................................................... 83
Create comment from other systems ......................................................................................................... 83

Sample Protocol
Description

Definition
Request
../api?data=
[{
"id":1,
"version":"",
"method":"",
"params":{
}
}]

Success Response
[{
"id":1,
"method":"",
"version":"",
"error":null,
"result":{
}
}]

Failure Response
[{
"id":1,
"method":"",
"version":"",
"result":null,
"error":{
"code":"001",
"message":""
}
}]

Params
Params

Values

Description

Request
Success
Failure

API check version


Description
API cho php ng dng kim tra tnh trng cp nht v ly nhng cu hnh c bn

Definition
Request
../api?data=
[{
"id":1,
"version":"-1",
"method":"checkVersion",
"params":{
"version":1
}
}]

Success Response
[
{
"id": 1,
"method": "checkVersion",
"version": "1",
"error": null,
"result": {
"updateLink": "http://tmh.com/xxx.html",
"configs": {
"root": "http://music.starmobile.vn:81/",
"androidPrefixAudio": "rtsp://music.starmobile.vn/",
"androidPostfixAudio": ".mp3",
"iOSPrefixAudio": "http://music.starmobile.vn/",
"iOSPostfixAudio": ".mp3/playlist.m3u8",
"androidPrefixVideo": "rtsp://music.starmobile.vn/",
"androidPostfixVideo": ".mp4",
"iOSPrefixVideo": "http://music.starmobile.vn/",
"iOSPostfixVideo": ".mp4/playlist.m3u8",
"avatarUploadDestination":
"http://ms.api.starmobile.vn/sites/default/files/avatars/index.php",
"coverUploadDestination":
"http://ms.api.starmobile.vn/sites/default/files/covers/index.php"
}
}
}
]

Failure Response
[{
"id":1,
"method":"",
"version":"",
"result":null,
"error":{

"code":"001",
"title":"Li",
"message":""
}
}]

Params
Params

Values

Description

Request
updateLink
configs

ng dn update
Cc ng dn config

root
androidPrefixAudio
androidPostfixAudio

Success

iOSPrefixAudio
iOSPostfixAudio
androidPrefixVideo
androidPostfixVideo
iOSPrefixVideo
iOSPostfixVideo
code

Failure

title
message

M li
Tiu thng bo
Ni dung bo li

API get list item


Description
API cho php ngi dng ly danh sch item.

Definition
Request
../api?data=
[{
"id":1,
"version":"",
"method":"listItem",
"params":{
"page":1,
"perPage":20,
"group":["all"],
"order":"-2",
"uid":"1"
}
}]

Success Response
[
{
"id":1,
"method":"listItem",
"version":"",
"error":null,
"result":{
"item":[
{
"group":"audio",
"id":"75",
"title":"Wish ",
"view":"0",
"artist":"lee_seung_chul",
"artistName":"Lee Seung Chul",
"uploader":"lyltc",
"album":"my_love_vol_11",
"file":"wish",
"description":""
},
{
"group":"video",
"id":"74",
"title":"Recalling You ",
"view":"0",
"artist":"lee_seung_chul",
"artistName":"Lee Seung Chul",
"uploader":"lyltc",
"album":"my_love_vol_11",
"file":"recalling_you",

"description":""
},
{
"group":"album",
"id":"73",
"title":"Beach Voice",
"view":"0",
"artist":"lee_seung_chul",
"artistName":"Lee Seung Chul",
"uploader":"lyltc",
"album":"my_love_vol_11",
"file":"beach_voice",
"description":""
}
]
}
}
]

Failure Response
[{
"id":1,
"method":"listItem",
"version":"",
"result":null,
"error":{
"code":"001",
"title":"Li",
"message":"C li trong qu trnh thc hin. Vui lng th li sau"
}
}]

Params
Params

Values
-1
-2
-3
-4
-5

Request

order

-6
-7
-8
-9
-10
-11
-12
-13

Description
Danh sch bi ht/album mi nht
Danh sch bi ht/album s hin th ln
trang ch
Danh sch bi ht/album c nghe nhiu
nht
Bng xp hng Vit Nam
Bng xp hng US UK
Bng xp hng Chu
Danh sch bi ht/album ni bt
Danh sch album ch mi nht
Danh sch album xu hng
Danh sch album ch ni bt
Danh sch tin Ni bt
Danh sch tin Gii tr
Danh sch tin Ngi sao
10

-14
-15
-16
-17
-18
-19
-20
Mc nh
all
audio
group

video
album
news
blog

Page
perPage
item
id
title
file
video
group

audio
album
news
blog

album
artist

Success

artistName
uploader
view
description
collectionId
collectionName
body
image
userLike
likeCount
commentCount
shareCount
createTime
image

Danh sch tin Thi trang


Danh sch tin Th gin
Danh sch tin Yu
Danh sch tin i sng
Danh sch tin Th thao
Trang wall
Trang thng tin c nhn
Lc tt c cc th loi (audio, video, album)
Lc tt c cc th loi (audio, video, album)
Nhc s
Video
Album
Tin tc
Trang c nhn
Trang hin th
S bi hin th trong mt trang
Danh sch cc item tr v
M ca item
Tiu bi ht
Tn file nhc
Tn nhm ca item
Video
Nhc s
Album
Tin tc
Trang c nhn
Tn folder album
Tn folder ca s
Tn ca s
Tn thnh vin upload
Lt nghe
M t item
M b su tp
Tn b su tp
Ni dung trng thi ngi dng
nh ngi dng upload
Ngi dng like hay cha
S lt yu thch
S lt bnh lun
S lt chia s
Thi gian ng bi
Link nh
11

author
uid
name
code

Failure

title
message

Thng tin ngi ng bi


M ngi dng
Tn ngi ng bi
M li
Tiu thng bo
Ni dung bo li

12

Notes
Lc nhiu th loi
C th lc nhiu th loi bng cch truyn mt array group
V d:"group":["audio","album"]

Request
../api?data=
[{
"id":1,
"version":"",
"method":"listItem",
"params":{
"page":1,
"perPage":20,
"group":["audio","video"],
"order":"-1"
}
}]

Success Response
[
{
"id":1,
"method":"listItem",
"version":"",
"error":null,
"result":{
"item":[
{
"group":"audio",
"id":"75",
"title":"Wish ",
"view":"0",
"artist":"lee_seung_chul",
"artistName":"Lee Seung Chul",
"uploader":"lyltc",
"album":"my_love_vol_11",
"file":"wish",
"description":""
},
{
"group":"audio",
"id":"74",
"title":"Recalling You ",
"view":"0",
"artist":"lee_seung_chul",
"artistName":"Lee Seung Chul",
"uploader":"lyltc",
"album":"my_love_vol_11",
"file":"recalling_you",
"description":""
},
{
"group":"video",

13

"id":"73",
"title":"Beach Voice",
"view":"0",
"artist":"lee_seung_chul",
"artistName":"Lee Seung Chul",
"uploader":"lyltc",
"album":"my_love_vol_11",
"file":"beach_voice",
"description":""
}
]
}
}
]

14

Lc danh sch tin


Ly danh sch tin theo group l news. Nu group l all vn ch ly danh sch nhc (album, video, audio)

Request
../api?data=
[{
"id":1,
"version":"",
"method":"listItem",
"params":{
"page":1,
"perPage":20,
"group":["news"],
"order":"-10"
}
}]

Success Response
[
{
"id": 1,
"method": "listItem",
"version": "",
"error": null,
"result": {
"item": [
{
"group": "news",
"id": "63880",
"title": "Th ci",
"summary": "Vin cnh st ui kp chic xe t, ra hiu
cho xe dng li: \"Anh c nghe thy ting ci ca ti khng?\".",
"timeCreate": "1384334601",
"category": "Th gin",
"displayImage":
"http://ms.api.starmobile.vn/sites/default/files/styles/news_image/public/138
4334601-thucoi-1383815353_210x158.jpg"
},
{
"group": "news",
"id": "63882",
"title": "Nokia Lumia 625 'tr ti' dng phim ti
Bollywood",
"summary": "Ti kinh in nh ca n , gii tr ang
tn dng ti a li th mn hnh ln ca chic in thoi Lumia 625 to
nn mt loi hnh gii tr mi.",
"timeCreate": "1384334603",
"category": "Th gin",
"displayImage":
"http://ms.api.starmobile.vn/sites/default/files/styles/news_image/public/138
4334604-Hinh-1-1245-1383876092_210x158.jpg"
}
]
}
}
]

15

Lc danh sch feed ca blog


Ly danh sch tin theo group l blog. Nu group l all vn ch ly danh sch nhc (album, video, audio)
Lu : Ring group l blog th phi gi username, password v uType

Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "listItem",
"params": {
"username": "hanoi",
"password": "yahoo",
"uType": "regular",
"page": 1,
"perPage": 20,
"group": [
"blog"
],
"order": "-20"
}
}
]

Success Response
[
{
"id": 1,
"method": "listItem",
"version": "",
"error": null,
"result": {
"item": [
{
"group": "blog",
"id": "65792",
"title": "Auto title",
"body": "body",
"image":
"http://localhost/starmusic/sites/default/files/styles/news_image/public/demo
.jpg",
"timeCreate": "1385092409",
"collectionId": null,
"collectionName": null,
"author": {
"uid": "779",
"name": "Quang t",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/779.jpg"
},
"commentCount": "0",
"likeCount": 0,
"shareCount": 0,

16

"userLike": false
},
{
"group": "blog",
"id": "65791",
"title": "Auto title",
"body": "Hello moto",
"image":
"http://localhost/starmusic/sites/default/files/styles/collection/public/demo
3.jpg",
"timeCreate": "1384756832",
"collectionId": null,
"collectionName": null,
"author": {
"uid": "4",
"name": "Po Panda",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/4.jpg"
},
"commentCount": "1",
"likeCount": "2",
"shareCount": 0,
"userLike": true
},
{
"group": "blog",
"id": "65784",
"title": "Demo blog",
"body": "<p>Body</p>\r\n",
"image": null,
"timeCreate": "1384674000",
"collectionId": null,
"collectionName": null,
"author": {
"uid": "1",
"name": "admin",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/1.jpg"
},
"commentCount": "7",
"likeCount": 0,
"shareCount": 0,
"userLike": false
}
]
}
}
]

17

API get node detail


Description
API cho php ly chi tit bi ht.

Definition
Request
../api?data=
[{
"id":1,
"version":"",
"method":"nodeDetail",
"params":{
"nid":"81",
"uid":"1"
}
}]

Success Response
[
{
"id": 1,
"method": "nodeDetail",
"version": "App01",
"error": null,
"result": {
"nid": "56166",
"artist": [
{
"sid": "9706",
"artistName": "Hyorin",
"artist": "hyorin"
}
],
"album": [
{
"aid": "9708",
"albumName": "Masters Sun OST Part.3",
"album": "masters_sun_ost_part_3",
"artistName": "Hyorin",
"artist": "hyorin"
}
],
"lyric": "lyrics",
"favorite ": false,
"relatedNodeId": "0"
}
}
]

18

Failure Response
[{
"id":1,
"method":"",
"version":"",
"result":null,
"error":{
"code":"001",
"title":"Li",
"message":""
}
}]

Params
Params
nid

Request

uid
nid
lyric
sid
artistName

Success

artist
aid
albumName
album
favorite
perPage
code

Failure

title
message

Values

Description
M bi ht
M khch hng. Nu khch hng cha ng
nhp th mc nh l 0
M bi ht
Li bi ht
M ca s
Tn ca s
Tn folder ca s
M album
Tn album
Tn folder album
Bi ht c yu thch hay cha
S comment ca mt trang
M li
Tiu thng bo
Ni dung bo li

19

Notes
Lc chi tit tin
Khi ly chi tit tin khng nht thit phi gi uid

Request
../api?data=
[{
"id":1,
"version":"",
"method":"nodeDetail",
"params":{
"nid":1,
"uid":20
}
}]

Success Response
[
{
"id": 1,
"method": "nodeDetail",
"version": "App01",
"error": null,
"result": {
"nid": "1",
"displayImage": "https://fbcdn-profile-a.akamaihd.net/hprofileak-ash2/1118604_100006956649478_1386810483_q.jpg",
"summary": "n qu nh k trng cy",
"body": "La y =))",
"timeCreates": 1378196336
}
}
]

20

Lc chi tit blog


Khi ly chi tit blog s tr v cc comment mi nht. ly cc comment trc gi api listComment

Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "nodeDetail",
"params": {
"username": "yahoo",
"password": "hanoi",
"userType": "regular",
"nid": 65784,
"perPage": 5
}
}
]

Success Response
[
{
"id": 1,
"method": "nodeDetail",
"version": "App01",
"result": {
"group": "blog",
"id": "65784",
"title": "Demo blog",
"body": "<p>Body</p>\r\n",
"image": null,
"timeCreate": "1384674000",
"collectionId": null,
"collectionName": null,
"author": {
"uid": "1",
"name": "admin",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/1.jpg"
},
"commentCount": "7",
"likeCount": 0,
"shareCount": 0,
"userLike": false,
"comments": [
{
"cid": "1",
"author": {
"uid": "4",
"name": "yahoo",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/4.jpg"
},
"createTime": "1384674109",
"body": "<p>Hay qua</p>\r\n",

21

"userLike": true
},
{
"cid": "2",
"author": {
"uid": "1",
"name": "admin",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/1.jpg"
},
"createTime": "1384674200",
"body": "<p>C ci o j u ?</p>\r\n",
"userLike": false
},
{
"cid": "3",
"author": {
"uid": "1",
"name": "admin",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/1.jpg"
},
"createTime": "1384674812",
"body": "<p>Tnh v ni u ?</p>\r\n",
"userLike": false
},
{
"cid": "5",
"author": {
"uid": "4",
"name": "yahoo",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/4.jpg"
},
"createTime": "1384828803",
"body": "<p>FAP FAP FAP</p>\r\n",
"userLike": false
},
{
"cid": "6",
"author": {
"uid": "4",
"name": "yahoo",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/4.jpg"
},
"createTime": "1384828819",
"body": "<p>Comment multi level =))</p>\r\n",
"userLike": false
}
]
},
"error": null
}
]

22

API get album detail


Description
API cho php ly chi tit album

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "albumDetail",
"params": {
"page": 1,
"perPage": 10,
"aid": 10514,
"order": -1
}
}
]

Success Response
[
{
"id":1,
"method":"albumDetail",
"version":null,
"error":null,
"result":{
"albumName":"Xa",
"album":"xoa_single",
"artist":dong_nhi,
"description":"",
"item":[
{
"group":"audio",
"id":"4",
"title":"I wanna dance",
"view":"2",
"artist":"dong_nhi",
"uploader":"admin",
"album":"xoa_single",
"file":"i_wanna_dance",
"description":"",
"artistName":"ng Nhi"
}
]
}
}

23

Failure Response
[{
"id":1,
"method":"",
"version":"",
"result":null,
"error":{
"code":"001",
"title":"Li",
"message":""
}
}]

Params
Params
Request

Values

aid
page
item
id
title
file

group

Success

audio
album

album
artist
artistName
uploader
view
description
code

Failure

video

title
message

Description
M album
Trang bt u t trang 1
Danh sch cc item tr v
M ca item
Tiu bi ht
Tn file nhc
Tn nhm ca item
Video
Nhc s
Album
Tn folder album
Tn folder ca s
Tn ca s
Tn thnh vin upload
Lt nghe
M t item
M li
Tiu thng bo
Ni dung bo li

24

API filter
Description
API cho php ngi dng tm kim & lc d liu nhc

Definition
Request
../api?data=
[{
"id":1,
"method":"searchFilter",
"params":{
"page":0,
"perPage":20,
"fields":[{
"name":"itemName",
"value":"hello"
},{
"name":"type",
"value":["video","audio"]
},{
"name":"tagId",
"value":["15","7"]
}],
"order":-1,
"uid":"99"
}
}]

Success Response
[{
"id":1,
"method":"searchFilter",
"error":null,
"result":{
"item":[{
"id":"82",
"title":"Hello",
"file":"hello",
"group":"audio",
"album":"uncat",
"artist":"lionel",
"artistName":"Lionel Richie",
"uploader":"phuthuybeo",
"view":"1234",
"description":"Nhc sn"
},
{
"id":"83",
"title":"Tnh cha",
"file":"tc",
"group":"video",

25

"album":"nscollec",
"artist":"ns",
"artistName":"Ngc Sn",
"uploader":"phumo",
"view":"111",
"description":"Nhc bc hc"
}]
}
}]

Failure Response
[{
"id":1,
"method":"searchFilter",
"result":null,
"error":{
"code":"001",
"message":"Lc khng c trong t in ca h thng >:)"
}
}]

Params
Params

Request

Values

fields

page
item
id
title
file
group
video
audio

Success

album
album
artist
artistName
uploader
view
description

Description
Trng tm kim. L 1 mng object bao gm 2
thuc tnh name (tn trng tm kim) v
value (gi tr tm kim). Chi tit bng trng
tm kim v gi tr xem thm trong mc
References
Page bt u t 0
Danh sch cc item tr v
M ca item
Tiu bi ht
Tn file nhc
Tn nhm ca item
Video
Nhc s
Album
Tn folder album
Tn folder ca s
Tn ca s
Tn thnh vin upload
Lt nghe
M t item

Failure

26

References
Search field & value table
Field

Values

tagId
keyword
video
audio
album

Description
Tm kim theo taxonomy id. y l 1 mng
kiu string. Gi tr mi phn t trong mng l
taxonomy id.
Tm kim theo tn bi ht. Gi tr l 1 chui k
t nm trong tn phim.
Ly tt c video
Ly tt c audio
Ly tt c album

27

API get list artist


Description
API cho php ngi dng ly danh sch cc ca s theo quc gia

Definition
Request
../api?data=
[{
"id":1,
"version":"",
"method":"listArtist",
"params":{
"page":1,
"perPage":20,
"order":"-4"
}
}]

Success Response
[
{
"id":1,
"method":"listArtist",
"version":"",
"error":null,
"result":{
"item":[
{
"id":"5",
"artist":"365daband",
"artistName":"365DaBand"
},
{
"id":"60",
"artist":"bich_phuong",
"artistName":"Bch Phng"
},
{
"id":"131",
"artist":"bui_anh_tuan",
"artistName":"Bi Anh Tun"
},
{
"id":"61",
"artist":"cao_thai_son",
"artistName":"Cao Thi Sn"
},
{
"id":"134",
"artist":"chau_gia_kiet",
"artistName":"Chu Gia Kit"

28

},
{
"id":"62",
"artist":"huong_tram",
"artistName":"Hng Trm"
},
{
"id":"63",
"artist":"lam_chan_khang",
"artistName":"Lm Chn Khang"
}
]
}
}
]

Failure Response
[{
"id":1,
"method":"listArtist",
"version":"",
"result":null,
"error":{
"code":"001",
"title":"Li",
"message":"C li trong qu trnh thc hin. Vui lng th li sau"
}
}]

Params
Params

Values
-4

order

Request

-6
page
perPage
item

Success

id
artist
artistName
code

Failure

-5

title
message

Description
Danh sch cc ca s Vit Nam
Danh sch cc ca s US UK
Danh sch cc ca s Chu
Trang hin th, page bt u t 1
S bi hin th trong mt trang
Danh sch cc item tr v
M ca ca s
Tn folder ca s
Tn ca s
M li
Tiu thng bo
Ni dung bo li

29

API get list album of an artist


Description
API cho php ngi dng ly danh sch album ca mt ca s

Definition
Request
../api?data=
[{
"id":1,
"version":"",
"method":"listAlbum",
"params":{
"page":1,
"perPage":20,
"sid":"60"
}
}]

Success Response
[
{
"id":1,
"method":"listAlbum",
"version":"",
"error":null,
"result":{
"item":[
{
"group":"album",
"id":"68",
"title":"C l em (single)",
"view":"0",
"artist":"bich_phuong",
"album":"co_le_em",
"uploader":"",
"file":"",
"description":"",
"artistName":"Bch Phng"
},
{
"group":"album",
"id":"137",
"title":"C l em (Remix)",
"view":"0",
"artist":"bich_phuong",
"album":"co_le_em_remix",
"uploader":"",
"file":"",
"description":"",
"artistName":"Bch Phng"
}

30

]
}
}
]

Failure Response
[{
"id":1,
"method":"listAlbum",
"version":"",
"result":null,
"error":{
"code":"001",
"title":"Li",
"message":"C li trong qu trnh thc hin. Vui lng th li sau"
}
}]

Params
Params

Values

sid

Request

page
perPage
item
id
title
file

group

Success

audio
album

album
artist
artistName
uploader
view
description
code

Failure

video

title
message

Description
M ca s
Trang hin th, page bt u t 1
S bi hin th trong mt trang
Danh sch cc item tr v
M ca item
Tiu bi ht
Tn file nhc
Tn nhm ca item
Video
Nhc s
Album
Tn folder album
Tn folder ca s
Tn ca s
Tn thnh vin upload
Lt nghe
M t item
M li
Tiu thng bo
Ni dung bo li

31

API get artist detail


Description
API cho php ngi dng ly thng tin chi tit ca mt ca s

Definition
Request
../api?data=
[{
"id":1,
"version":"",
"method":"artistDetail",
"params":{
"sid":"60"
}
}]

Success Response
[
{
"id":1,
"method":"artistDetail",
"version":"",
"error":null,
"result":{
"id":"60",
"artistName":"Bch Phng",
"artist":"bich_phuong",
"description":"phuthuybeo"
}
}
]

Failure Response
[
{
"id":1,
"method":"artistDetail",
"version":"",
"error":{
"code":"001",
"title":"Ca s khng tn ti",
"message":"Ca s khng tn ti"
},
"result":null
}
]

Params
Params

Values

Description
32

Request

sid
id
artist
artistName
description
code

Failure

title
message

M ca s
M ca item
Tn folder ca s
Tn ca s
Thng tin ca s
M li
Tiu thng bo
Ni dung bo li

33

API get top list category


Description
API ly danh sch cc khu vc trong bng xp hng

Definition
Request
../api?data=
[{
"id":1,
"version":"-1",
"method":"listTopCategory",
"params":{}
}]

Success Response
[
{
"id":1,
"method":"listTopCategory",
"version":null,
"error":null,
"result":{
"cats":[
{
"tcid":-4,
"title":"Vit Nam"
},
{
"tcid":-5,
"title":"US - UK"
},
{
"tcid":-6,
"title":"Chu "
}
]
}
}
]

Failure Response
[{
"id":1,
"method":"",
"version":"",
"result":null,
"error":{
"code":"001",
"title":"Li",
"message":""
}

34

}]

Params
Params

Values

Description

Request
Success

tcid
title
code

Failure

title
message

M khu vc ly trong listItem


Tn khu vc
M li
Tiu thng bo
Ni dung bo li

35

API get list music type


Description
API ly danh sch cc th loi nhc theo quc gia

Definition
Request
../api?data=
[{
"id":1,
"version":"-1",
"method":"listMusicType",
"params":{
"tcid":-5
}
}]

Success Response
[
{
"id":1,
"method":"listMusicType",
"version":"App01",
"error":null,
"result":{
"item":[
{
"id":"33",
"imgLink":"Acoustic",
"fileName":"acoustic"
},
{
"id":"39",
"imgLink":"Alternative",
"fileName":"alternative"
}
]
}
}
]

Failure Response
[{
"id":1,
"method":"",
"version":"",
"result":null,
"error":{
"code":"001",
"title":"Li",
"message":""
}

36

}]

Params
Params
Request

tcid
id

Success

title
fileName
code

Failure

title
message

Values

Description
M khu vc ly t api listTopCategory
M th loi
Tn th loi
Tn folder nh
M li
Tiu thng bo
Ni dung bo li

37

API create playlist


Description
API cho php to danh sch bi ht.

Definition
Request
../api?data=
[{
"id":1,
"version":"",
"method":"createPlaylist",
"params":{
"uid":"81",
"name":"Ti i tm ti"
}
}]

Success Response
[{
"id": 1,
"method": "createPlaylist",
"version": "",
"result": {
"pid": "390",
"name": "Ti i tm ti"
},
"error": null
}]

Failure Response
[{
"id":1,
"method":"createPlaylist",
"version":"",
"result":null,
"error":{
"code":"001",
"title":"Li",
"message":""
}
}]

Params
Params
Request
Success

uid
name
pid
name

Values

Description
M khch hng
Tn playlist
M playlist va c to
Tn playlist
38

code

Failure

title
message

M li
Tiu thng bo
Ni dung bo li

39

API get list playlist


Description
API cho php ly danh sch cc playlist ca mt khch hng xc nh

Definition
Request
../api?data=
[{
"id":1,
"version":"",
"method":"getListPlaylist",
"params":{
"uid":"81",
"page":1,
"perPage":10
}
}]

Success Response
[
{
"id": 1,
"method": "getListPlaylist",
"version": "",
"result": [
{
"pid": "395",
"name": "Ch Ly",
"total": 10
}
],
"error": null
}
]

Failure Response
[{
"id":1,
"method":"getListPlaylist",
"version":"",
"result":null,
"error":{
"code":"001",
"title":"Li",
"message":""
}
}]

40

Params
Params

Values

Description

uid

Request

M khch hng
S trang. Page bt u t 1
S playlist hin th / trang
M playlist
Tn playlist
M li
Tiu thng bo
Ni dung bo li

page
perPage

Success

pid
name
code

Failure

title
message

Notes
Danh sch playlist rng
Trng hp ngi dng cha to mt playlist no c, result tr v s l null

Request
../api?data=
[{
"id":1,
"version":"",
"method":"getListPlaylist",
"params":{
"uid":"81",
"page":1,
"perPage":10
}
}]

Success Response
[
{
"id": 1,
"method": "getListPlaylist",
"version": "",
"result": null,
"error": null
}
]

41

API delete playlist


Description
API cho php xa danh sch bi ht.

Definition
Request
../api?data=
[{
"id":1,
"version":"",
"method":"deletePlaylist",
"params":{
"uid":"81",
"pid":"1102"
}
}]

Success Response
[
{
"id": 1,
"method": "deletePlaylist",
"version": "",
"result": {
"title": "Playlist c xa",
"message": "Playlist c xa thnh cng."
},
"error": null
}
]

Failure Response
[
{
"id": 1,
"method": "deletePlaylist",
"version": "",
"result": null,
"error": {
"code": "001",
"title": "Playlist khng tn ti",
"message": "Playlist khng tn ti"
}
}
]

Params
Params
Request

uid

Values

Description
M khch hng
42

pid

Success

title
message
code

Failure

title
message

M playlist
Tiu thng bo
Ni dung thng bo
M li
Tiu thng bo
Ni dung bo li

43

API edit playlist


Description
API cho php thay i thng tin playlist.

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "editPlaylist",
"params": {
"uid": "81",
"pid": "392",
"name": "Ti i tm ti"
}
}
]

Success Response
[
{
"id": 1,
"method": "editPlaylist",
"version": "",
"result": {
"pid": 392,
"name": "Ti i tm ti"
},
"error": null
}
]

Failure Response
[
{
"id": 1,
"method": "editPlaylist",
"version": "",
"result": null,
"error": {
"code": "001",
"title": "Playlist khng tn ti",
"message": "Playlist khng tn ti"
}

}
]

44

Params
Params
uid

Request

pid
name

Success

pid
name
code

Failure

title
message

Values

Description
M khch hng
M playlist
Tn mi ca playlist
M playlist
Tn mi ca playlist
M li
Tiu thng bo
Ni dung bo li

45

API playlist
Description
API cho php thm hoc xa bi ht trong playlist.

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "addNodeToPlaylist",
"params": {
"pid": 289,
"nid": [11,12,13]
}
}
]

Success Response
[
{
"id": 1,
"method": "addNodeToPlaylist",
"version": "",
"result": {
"title": "Thm bi ht thnh cng.",
"message": "Bi ht bn chn c thm vo playlist."
},
"error": null
}
]

Failure Response
[
{
"id": 1,
"method": "editPlaylist ",
"version": "",
"result": null,
"error": {
"code": "001",
"title": "Playlist khng tn ti",
"message": "Playlist khng tn ti"
}
}
]

46

Params
Params

Values

pid

M playlist
M cc bi ht

nid

Request

Description

method
addNodeToPlaylist

Success

title
message
code

Failure

title
message

Thm bi ht vo playlist
removeNodeFromPlaylist Xa bi ht khi playlist
Tiu thng bo
Ni dung bo li
M li
Tiu thng bo
Ni dung bo li

47

API get list item from playlist


Description
API cho php ly danh sch bi ht t playlist.

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "listItemFromPlaylist",
"params": {
"pid": 391,
"page": 1,
"perPage": 10
}
}
]

Success Response
[
{
"id": 1,
"method": "listItemFromPlaylist",
"version": "",
"result": {
"item": [
{
"group": "audio",
"id": "952",
"title": "Em V Gia Tim Ti",
"view": "0",
"artist": "dan_truong",
"artistName": "an Trng",
"uploader": "admin",
"album": "tuyen_tap_cac_bai_hat_hay_nhat_cua_dan_truong",
"file": "em_ve_giua_tim_toi",
"description": ""
},
{
"group": "audio",
"id": "953",
"title": "V u Mi Tc Ngi Thng",
"view": "7",
"artist": "truong_vu",
"artistName": "Trng V ft Mai Thin Vn",
"uploader": "admin",
"album": "nhat_ky_doi_toi",
"file": "ve_dau_mai_toc_nguoi_thuong_ft_mai_thien_van",
"description": ""

48

},
{
"group": "audio",
"id": "954",
"title": "Anh Phi Lm Sao",
"view": "0",
"artist": "dan_truong",
"artistName": "an Trng",
"uploader": "admin",
"album": "tuyen_tap_cac_bai_hat_hay_nhat_cua_dan_truong",
"file": "anh_phai_lam_sao",
"description": ""
}
]
},
"error": null
}
]

Failure Response
[
{
"id": 1,
"method": "listItemFromPlaylist",
"version": "",
"result": null,
"error": null
}
]

Params
Params

Values

pid

Request

page
perPage
item
id
title
file

group

Success

video
audio
album

album
artist
artistName
uploader
view
description

Description
M playlist
Trang hin th. Page bt du t 1
S bi hin th trong mt trang
Danh sch cc item tr v
M ca item
Tiu bi ht
Tn file nhc
Tn nhm ca item
Video
Nhc s
Album
Tn folder album
Tn folder ca s
Tn ca s
Tn thnh vin upload
Lt nghe
M t item
49

code

Failure

title
message

M li
Tiu thng bo
Ni dung bo li

50

API favorite
Description
API cho php thm hoc xa bi ht ca mc yu thch

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "addNodeToFavorite",
"params": {
"uid": 1,
"nid": [951,949,954],
"action": "favorite"
}
}
]

Success Response
[
{
"id": 1,
"method": "addNodeToFavorite",
"version": "",
"result": {
"title": "X l thnh cng.",
"message": " c thm vo yu thch."
},
"error": null
}
]

Failure Response
[
{
"id": 1,
"method": "addNodeToFavorite",
"version": "",
"result": null,
"error": {
"code": "001",
"title": "Ti khon khng tn ti",
"message": "Ti khon khng tn ti"
}
}
]

51

Params
Params

Values

uid
nid

Description
M khch hng
M cc bi ht

method

Thm bi ht vo danh sch yu


thch
Xa bi ht khi danh sch yu
removeNodeFromFavorite
thch
action
Tng tc ngi dng
favorite
Thm / xa danh sch yu thch
likeStatus
Thch / b thch status
likeComment
Thch / b thch comment
title
Tiu thng bo
message
Ni dung bo li
code
M li
title
Tiu thng bo
message
Ni dung bo li
addNodeToFavorite

Request

Success
Failure

52

API get list item from favorite


Description
API cho php ly bi ht t danh sch yu thch.

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "listItemFromFavorite",
"params": {
"uid": 1,
"page": 1,
"perPage": 10
}
}
]

Success Response
[
{
"id": 1,
"method": "listItemFromFavorite",
"version": "",
"result": {
"item": [
{
"group": "audio",
"id": "952",
"title": "Em V Gia Tim Ti",
"view": "0",
"artist": "dan_truong",
"artistName": "an Trng",
"uploader": "admin",
"album": "tuyen_tap_cac_bai_hat_hay_nhat_cua_dan_truong",
"file": "em_ve_giua_tim_toi",
"description": ""
},
{
"group": "audio",
"id": "953",
"title": "V u Mi Tc Ngi Thng",
"view": "7",
"artist": "truong_vu",
"artistName": "Trng V ft Mai Thin Vn",
"uploader": "admin",
"album": "nhat_ky_doi_toi",
"file": "ve_dau_mai_toc_nguoi_thuong_ft_mai_thien_van",

53

"description": ""
},
{
"group": "audio",
"id": "954",
"title": "Anh Phi Lm Sao",
"view": "0",
"artist": "dan_truong",
"artistName": "an Trng",
"uploader": "admin",
"album": "tuyen_tap_cac_bai_hat_hay_nhat_cua_dan_truong",
"file": "anh_phai_lam_sao",
"description": ""
}
]
},
"error": null
}
]

Failure Response
[
{
"id": 1,
"method": "listItemFromFavorite",
"version": "",
"result": null,
"error": null
}
]

Params
Params

Values

uid

Request

page
perPage
item
id
title
file

Success

group

video
audio
album

album
artist
artistName
uploader
view

Description
M khch hng
Trang hin th. Page bt u t 1
S bi hin th trong mt trang
Danh sch cc item tr v
M ca item
Tiu bi ht
Tn file nhc
Tn nhm ca item
Video
Nhc s
Album
Tn folder album
Tn folder ca s
Tn ca s
Tn thnh vin upload
Lt nghe
54

description
code

Failure

title
message

M t item
M li
Tiu thng bo
Ni dung bo li

55

API get list recent item


Description
API cho php ly bi ht nghe gn y

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "listItemRecent",
"params": {
"uid": 1,
"page": 1,
"perPage": 10
}
}
]

Success Response
[
{
"id": 1,
"method": "listItemRecent",
"version": "",
"result": {
"item": [
{
"group": "audio",
"id": "952",
"title": "Em V Gia Tim Ti",
"view": "0",
"artist": "dan_truong",
"artistName": "an Trng",
"uploader": "admin",
"album": "tuyen_tap_cac_bai_hat_hay_nhat_cua_dan_truong",
"file": "em_ve_giua_tim_toi",
"description": ""
},
{
"group": "audio",
"id": "953",
"title": "V u Mi Tc Ngi Thng",
"view": "7",
"artist": "truong_vu",
"artistName": "Trng V ft Mai Thin Vn",
"uploader": "admin",
"album": "nhat_ky_doi_toi",
"file": "ve_dau_mai_toc_nguoi_thuong_ft_mai_thien_van",
"description": ""

56

},
{
"group": "audio",
"id": "954",
"title": "Anh Phi Lm Sao",
"view": "0",
"artist": "dan_truong",
"artistName": "an Trng",
"uploader": "admin",
"album": "tuyen_tap_cac_bai_hat_hay_nhat_cua_dan_truong",
"file": "anh_phai_lam_sao",
"description": ""
}
]
},
"error": null
}
]

Failure Response
[
{
"id": 1,
"method": "listItemRecent",
"version": "",
"result": null,
"error": null
}
]

Params
Params

Values

uid

Request

page
perPage
item
id
title
file

group

Success

video
audio
album

album
artist
artistName
uploader
view
description

Description
M khch hng
Trang hin th. Page bt u t 1
S bi hin th trong mt trang
Danh sch cc item tr v
M ca item
Tiu bi ht
Tn file nhc
Tn nhm ca item
Video
Nhc s
Album
Tn folder album
Tn folder ca s
Tn ca s
Tn thnh vin upload
Lt nghe
M t item
57

code

Failure

title
message

M li
Tiu thng bo
Ni dung bo li

58

API login
Description
API cho php ngi dng ang nhp vo h thng. Vi nhng ti khon m uType khng phi l regular th
phi kim tra xem ti khon tn ti trong h thng hay cha. Nu cha th s tin hnh to ti khon
trc khi cho php ng nhp h thng.

Definition
Request
../api?data=
[
{
"id": 1,
"method": "login",
"params": {
"username": "UN",
"password": "PN",
"uType": "regular"
}
}
]

Success Response
[
{
"id": 1,
"method": "login",
"result": {
"uid": "3",
"username": "thanhnv",
"displayName": "Po Panda",
"birthDay": "2013-10-10",
"email": "demo@test.com",
"gender": "male",
"city": "H Ni",
"phone": "0973",
"avatarLink":
"http://ms.api.starmobile.vn/sites/default/files/_avatars/3.jpg",
"coverLink":
"http://ms.api.starmobile.vn/sites/default/files/_covers/3.jpg"
},
"error": null
}
]

Failure Response
[
{
"id": 1,
"method": "login",
"result": null,
"error": {

59

"code": "001",
"title": "ng nhp tht bi",
"message": "Ti khon hoc mt khu khng chnh xc."
}
}
]

Params
Params

Values

username
password
uType

Request

regular
facebook
linkFacebook
displayName
birthDay
email

Success

gender
city
phone
uid
code
title

Failure

message

Description
Ti khon
Mt khu
Loi user
Khch hng ng k thng thng
Khch hng ng b ti khon facebook
Link facebook ca khch hng
Tn hin th
Ngy sinh
a ch email
Gii tnh: male hoc female
Thnh ph
S in thoi
M khch hng
M li
Tiu thng bo
Ni dung bo li

Notes
Login from other systems
Khi ng nhp vi uType != regular th ty vo mi uType li c kiu gn username, password khc nhau.
Ngoi ra cng c th thm cc tham s ph i km.

Facebook
Vi uType == facebook th username l email ng k facebook, mt khu l facebook ID. Ngoi ra cn gi
thm tn hin th, gii tnh, thnh ph, ngy sinh v link facebook

Sample Request
../api?data=
[
{
"id": 1,

60

"method": "login",
"params": {
"username": "demo@test.com",
"password": "facebook_id_123",
"uType": "facebook",
"linkFacebook": "www.facebook.com/quananngon",
"displayName": "Po Panda",
"birthDay": "2013-10-10",
"gender": "male",
"city": "H Ni",
"phone": "0973"
}
}
]

61

API change profile


Description
API cho php cp nht thng tin khch hng

Definition
Request
../api?data=
[
{
"id": 1,
"method": "changeProfile",
"params": {
"username": "UN",
"password": "PN",
"uType": "regular",
"fields": [
{
"field": "displayName",
"newValue": "Po Panda"
},
{
"field": "birthDay",
"newValue": "2013-10-10"
},
{
"field": "email",
"newValue": "demo@test.com"
},
{
"field": "gender",
"newValue":"male"
},
{
"field": "city",
"newValue": "H Ni"
},
{
"field": "phone",
"newValue": "0973"
}
]
}
}
]

Success Response
[
{
"id": 1,
"method": "changeProfile",
"version": null,

62

"result": {
"title": "Cp nht thnh cng",
"message": "Ti khon ca bn dc cp nht thnh cng"
},
"error": null
}
]

Failure Response
[
{
"id": 1,
"method": "changeProfile ",
"version": "",
"result": null,
"error": {
"code": "001",
"title": "Ti khon khng tn ti",
"message": "Ti khon khng tn ti"
}
}
]

Params
Params

Values

username
password
uType
regular
facebook
fields
facebookId
field
displayName
birthDay

Request

email
gender
city
phone
facebookId

updateField

profile
playlist
favorite

Description
Ti khon
Mt khu
Loi user
Khch hng ng k thng thng
Khch hng ng b ti khon facebook
Cc trng d liu update
M ti khon facebook ca khch hng
Tn trng d liu
Tn hin th
Ngy sinh
a ch email
Gii tnh: male hoc female
Thnh ph
S in thoi
M facebook ca khch hng
Khch hng la chn cc thng tin ng b
Thng tin c nhn
Playlist ca khch hng
Cc bi ht yu thch ca khch hng

63

Gi tr mi
Tiu thng bo
Ni dung bo li
M li
Tiu thng bo
Ni dung bo li

newValue
title

Success

message
code
title

Failure

message

Notes
Cp nht ti khon Facebook
Khi khch hng cha c ti khon regular v ch ng nhp bng ti khon facebook (thng tin ti khon
facebook c thay i. V d: mail, tn hin th ). Ta s tin hnh cp nht thng tin cho ti khon ng
nhp bng facebook ny. Trng username v password s trng hiu l cp nht thng tin cho ti
khon facebook ch khng phi l ng b ti khon facebook.

Sample Request
../api?data=
[
{
"id": 1,
"method": "changeProfile",
"params": {
"username": "",
"password": "",
"uType": "facebook",
"facebookId": "facebook_id_1234",
"updateField": [
"profile"
],
"fields": [
{
"field": "displayName",
"newValue": "Po Panda"
},
{
"field": "birthDay",
"newValue": "2013-10-10"
},
{

64

"field": "email",
"newValue": "demo@test.com"
},
{
"field": "gender",
"newValue": "male"
},
{
"field": "city",
"newValue": "H Ni"
},
{
"field": "phone",
"newValue": "0973"
}
]
}
}
]

ng b ti khon Facebook
ng b ti khon facebook vi ti khon regular, gi username, password (ca ti khon regular) v
facebookId l bt buc. Cc thng tin khc nu ly c s gi thm trong fileds

Sample Request
../api?data=
[
{
"id": 1,
"method": "changeProfile",
"params": {
"username": "UN",
"password": "PN",
"uType": "facebook",
"facebookId": "facebook_id_123",
"updateField": [
"profile",

65

"playlist",
"recent",
"favorite"
],
"fields": [
{
"field": "displayName",
"newValue": "Po Panda"
},
{
"field": "birthDay",
"newValue": "2013-10-10"
},
{
"field": "email",
"newValue": "demo@test.com"
},
{
"field": "gender",
"newValue": "male"
},
{
"field": "city",
"newValue": "H Ni"
},
{
"field": "phone",
"newValue": "0973"
}
]
}
}
]

66

API create node


Description
Api to node dng cho Crawler, ng status ln MyTune

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "createNode",
"params": {
"type": "blog",
"public": 1,
"username": "yahoo",
"password": "hanoi",
"uType": "regular",
"fields": {
"collectionId": 0,
"collectionName": "Hot girls",
"body": "body",
"image": "public://styles/news_image/public/demo.jpg"
}
}
}
]

Success Response
[
{
"id": 1,
"method": "createNode",
"version": "",
"error": null,
"result": {
"nid": "65826",
"message": "Create node successfully"
}
}
]

Failure Response
[
{
"id": 1,
"method": "createNode",
"version": "",
"error": {
"code": "001",
"title": "Ti khon khng tn ti",

67

"message": "Ti khon khng tn ti"


},
"result": null
}
]

Params
Params

Values

type
news
glog
public
sticky
promote
fields
title
categoryTid
summary

Request

body
image
collectionId
collectionName
body
image
usernamme
password
uType
regular
facebook

== 0
!= 0

Description
Loi node
Tin tc
Blog c nhn
Hin th hay khng
Hin th u trang
Hin th trang ch
Cc trng to node
Tiu
M chuyn mc
Sample text ca tin tc
Ni dung tin tc
nh hin th
To chuyn mc mi
nh vo b su tp c trc
Tn chuyn mc mi
Ni dung status
ng dn nh sau khi upload nh xong
Tn ti khon
Mt khu
Loi ti khon
Ti khon ng k bnh thng
Ti khon ng k qua facebook

Success
Failure

68

Notes
Facebook
Vi uType == facebook th username l email ng k facebook, mt khu l facebook ID.

Sample Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "createNode",
"params": {
"type": "blog",
"public": 1,
"username": "mail@yahoo.com",
"password": "facebook_id",
"uType": "facebook",
"fields": {
"collectionId": 0,
"collectionName": "Hot girls",
"body": "body",
"image":
"public://styles/news_image/public/demo.jpg"
}
}
}
]

69

Crawler
Vi type == news l dnh cho vic cp nht tin ca Crawler t ng

Sample Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "createNode",
"params": {
"type": "news",
"public": 1,
"promote": 0,
"sticky": 0,
"fields": {
"title": "title",
"categoryTid": "11095",
"summary": "summary",
"body": "body",
"image":
"http://baothainguyen.org.vn/Upload/Advertising/693c67e9fcd645
07a699f1149794a19e.jpg"
}
}
}
]

70

API edit blog


Description
Api sa blog

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "editBlog",
"params": {
"username": "yahoo",
"password": "hanoi",
"uType": "regular",
"nid": 65784,
"fields": {
"collectionId": 0,
"collectionName": "Hot girls",
"body": "body"
}
}
}
]

Success Response
[
{
"id": 1,
"method": "editBlog",
"version": "",
"error": null,
"result": {
"nid": 65784,
"title": "Thao tc thnh cng",
"message": "Bi vit dc cp nht thnh cng"
}
}
]

Failure Response
[
{
"id": 1,
"method": "editBlog",
"version": "",
"error": {
"code": "001",
"title": "Bi vit khng tn ti",
"message": "Bi vit khng tn ti"

71

},
"result": null
}
]

Params
Params
username

Request

password
nid

Values

Description
Ti khon
Mt khu
M bi vit mun xa

Success
Failure

72

API delete blog


Description
Api xa status.

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "deleteBlog",
"params": {
"username": "yahoo",
"password": "hanoi",
"nid": 1
}
}
]

Success Response
[
{
"id": 1,
"method": "deleteBlog",
"version": "",
"error": null,
"result": {
"title": "Thao tc thnh cng",
"message": "Bi vit c xa khi h thng"
}
}
]

Failure Response
[
{
"id": 1,
"method": "deleteBlog",
"version": "",
"error": {
"code": "001",
"title": "Bi vit khng tn ti",
"message": "Bi vit khng tn ti"
},
"result": null
}
]

73

Params
Params
username

Request

password
nid

Values

Description
Ti khon
Mt khu
M bi vit mun xa

Success
Failure

74

API get list comment


Description
API cho php danh sch comment

Definition
Request
../api?data=
[
{
"id": 1,
"version": "",
"method": "listComment",
"params": {
"username": "yahoo",
"password": "hanoi",
"userType": "regular",
"nid": 65784,
"page": 1,
"perPage": 5
}
}
]

Success Response
[
{
"id": 1,
"method": "listComment",
"version": "App01",
"result": {
"group": "blog",
"id": "65784",
"title": "Demo blog",
"body": "<p>Body</p>\r\n",
"image": null,
"timeCreate": "1384674000",
"collectionId": null,
"collectionName": null,
"author": {
"uid": "1",
"name": "admin",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/1.jpg"
},
"commentCount": "7",
"likeCount": 0,
"shareCount": 0,
"userLike": false,
"comments": [
{
"cid": "1",

75

"author": {
"uid": "4",
"name": "yahoo",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/4.jpg"
},
"createTime": "1384674109",
"body": "<p>Hay qua</p>\r\n",
"userLike": true
},
{
"cid": "2",
"author": {
"uid": "1",
"name": "admin",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/1.jpg"
},
"createTime": "1384674200",
"body": "<p>C ci o j u ?</p>\r\n",
"userLike": false
},
{
"cid": "3",
"author": {
"uid": "1",
"name": "admin",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/1.jpg"
},
"createTime": "1384674812",
"body": "<p>Tnh v ni u ?</p>\r\n",
"userLike": false
},
{
"cid": "5",
"author": {
"uid": "4",
"name": "yahoo",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/4.jpg"
},
"createTime": "1384828803",
"body": "<p>FAP FAP FAP</p>\r\n",
"userLike": false
},
{
"cid": "6",
"author": {
"uid": "4",
"name": "yahoo",
"avatarLink":
"http://ms.api.starmobile.vn/photos/_avatars/4.jpg"
},
"createTime": "1384828819",
"body": "<p>Comment multi level =))</p>\r\n",

76

"userLike": false
}
]
},
"error": null
}
]

Params
Params
nid

Request

uid
cid
author
uid

Success

name
avatarLink
createTime
body
userLike
code

Failure

title
message

Values

Description
M bi ht
M khch hng. Nu khch hng cha ng
nhp th mc nh l 0
M bnh lun
Thng tin ngi bnh lun
M ngi bnh lun
Tn ngi bnh lun
Link nh ngi bnh lun
Thi gian to bnh lun
Ni dung bnh lun
Ngi s dng app like hay cha
M li
Tiu thng bo
Ni dung bo li

77

API create comment


Description
Api comment trn status

Definition
Request
../api?data=
[
{
"id": 1,
"method": "createComment",
"params": {
"username": "yahoo",
"password": "hanoi",
"uType": "regular",
"nid": 65784,
"body": "y l comment"
}
}
]

Success Response
[{
"id":1,
"method":"",
"version":"",
"error":null,
"result":{
}
}]

Failure Response
[{
"id":1,
"method":"",
"version":"",
"result":null,
"error":{
"code":"001",
"message":""
}
}]

Params
Params
nid

Request

body
usernamme

Values

Description
M bi vit mun comment
Ni dung comment
Tn ti khon
78

password

Mt khu

Success
Failure

Notes
Create comment from other systems
Khi to comment vi uType != regular th ty vo mi uType li c kiu gn username, password khc nhau.

Facebook
Vi uType == facebook th username l email ng k facebook, mt khu l facebook ID.

Sample Request
../api?data=
[
{
"id": 1,
"method": "login",
"params": {
"username": "demo@test.com",
"password": "facebook_id_123",
"uType": "facebook",
"linkFacebook": "www.facebook.com/quananngon",
"displayName": "Po Panda",
"birthDay": "2013-10-10",
"gender": "male",
"city": "H Ni",
"phone": "0973"
}
}
]

79

API edit comment


Description
Api cp nht bnh lun

Definition
Request
../api?data=
[
{
"id": 1,
"method": "editComment",
"params": {
"username": "yahoo",
"password": "hanoi",
"uType": "regular",
"cid": 1,
"fields": {
"body": "y l comment mi"
}
}
}
]

Success Response
[
{
"id": 1,
"method": "editComment",
"version": null,
"error": null,
"result": {
"cid": "1",
"title": "Thao tc thnh cng",
"message": "Bnh lun ca bn c cp nht"
}
}
]

Failure Response
[
{
"id": 1,
"method": "editComment",
"version": null,
"error": {
"code": "001",
"title": "Bi vit khng tn ti",
"message": "Bi vit khng tn ti"
},
"result": null
}

80

Params
Params

Values

nid
body

Request

usernamme
password

Description
M bi vit mun comment
Ni dung comment
Tn ti khon
Mt khu

Success
Failure

Notes
Create comment from other systems
Khi to comment vi uType != regular th ty vo mi uType li c kiu gn username, password khc nhau.

Facebook
Vi uType == facebook th username l email ng k facebook, mt khu l facebook ID.

Sample Request
../api?data=
[
{
"id": 1,
"method": "login",
"params": {
"username": "demo@test.com",
"password": "facebook_id_123",
"uType": "facebook",
"linkFacebook": "www.facebook.com/quananngon",
"displayName": "Po Panda",
"birthDay": "2013-10-10",
"gender": "male",
"city": "H Ni",
"phone": "0973"
}
}
]

81

API delete comment


Description
Api xa comment

Definition
Request
../api?data=
[
{
"id": 1,
"method": " deleteComment",
"params": {
"username": "yahoo",
"password": "hanoi",
"uType": "regular",
"cid": 1
}
}
]

Success Response
[
{
"id": 1,
"method": "deleteComment",
"version": null,
"error": null,
"result": {
"title": "Thao tc thnh cng",
"message": "Bnh lun ca bn c xa"
}
}
]

Failure Response
[
{
"id": 1,
"method": "deleteComment",
"version": null,
"error": {
"code": "001",
"title": "Bi vit khng tn ti",
"message": "Bi vit khng tn ti"
},
"result": null
}
]

82

Params
Params

Values

nid
body

Request

usernamme
password

Description
M bi vit mun comment
Ni dung comment
Tn ti khon
Mt khu

Success
Failure

Notes
Create comment from other systems
Khi to comment vi uType != regular th ty vo mi uType li c kiu gn username, password khc nhau.

Facebook
Vi uType == facebook th username l email ng k facebook, mt khu l facebook ID.

Sample Request
../api?data=
[
{
"id": 1,
"method": "login",
"params": {
"username": "demo@test.com",
"password": "facebook_id_123",
"uType": "facebook",
"linkFacebook": "www.facebook.com/quananngon",
"displayName": "Po Panda",
"birthDay": "2013-10-10",
"gender": "male",
"city": "H Ni",
"phone": "0973"
}
}
]

83

84

You might also like