Skip to content

Users API

atsanan edited this page Dec 23, 2018 · 6 revisions

10 Users

Field Description Optional Auth
firstName First name of the player, that gets from register No
lastName Last name of the player, that gets from register No
email Email of the player, that gets from register No
tel Tel of the player, that gets from register No
name --- --- ---
password --- --- ---
gender --- --- ---
birthdate --- --- ---
authenTypeId --- --- ---
authenId --- --- ---
authenToken --- --- ---
verified --- --- ---
verifiedAt --- --- ---
roles Role string array No ---

[x] 10.1 Get User

GET /api/v1/user

Headers:

Field Description Optional
Authorization Access token No

Url query:

Field Description Optional
userId userId (optional when no accessToken) Yes

Return:

{
    "data": {
        "_id": "5b4329f0bdfdd84f1f01c209",
        "authenId": "",
        "authenToken": "",
        "authenTypeId": 0,
        "birthdate": "",
        "createAt": "2018-07-09T09:30:02.493Z",
        "email": "rattajak.n@gmail.com",
        "firstname": "mzget",
        "gender": "male",
        "lastModified": "2018-07-26T07:17:00.017Z",
        "lastname": "test",
        "name": "mzget",
        "roles": [],
        "tel": "",
        "verified": false
    },
    "isSuccess": true
}

[x] 10.2 Update User

Post /api/v1/user

Headers:

Field Description Optional
Authorization Access token No

Url query:

Field Description Optional
userId userId (optional when no accessToken) Yes

Json Form

Field Description Optional Auth
firstName - Yes
lastName - Yes
name - Yes
gender - Yes

Return:

{
    "data": {
        "_id": "5b4329f0bdfdd84f1f01c209",
        "authenId": "",
        "authenToken": "",
        "authenTypeId": 0,
        "birthdate": "",
        "createAt": "2018-07-09T09:30:02.493Z",
        "email": "rattajak.n@gmail.com",
        "firstname": "mzget",
        "gender": "male",
        "lastModified": "2018-07-26T07:17:00.017Z",
        "lastname": "test",
        "name": "mzget",
        "roles": [],
        "tel": "",
        "verified": false
    },
    "isSuccess": true
}

[x] 10.3 Update User Form data

 Post /api/v1/user/{userId:string}

Headers:

Field Description Optional
Authorization Access token No

Url query:

Field Description Optional
userId userId (optional when no accessToken) Yes

Form data

Field Description Optional Auth
bathday - Yes
gender - Yes
pushMessagesAccessToken - Yes

Return:

{
    "data": {
        "_id": "5b4329f0bdfdd84f1f01c209",
        "authenId": "",
        "authenToken": "",
        "authenTypeId": 0,
        "birthdate": "",
        "createAt": "2018-07-09T09:30:02.493Z",
        "email": "rattajak.n@gmail.com",
        "firstname": "mzget",
        "gender": "male",
        "lastModified": "2018-07-26T07:17:00.017Z",
        "lastname": "test",
        "name": "mzget",
        "roles": [],
        "tel": "",
        "verified": false
    },
    "isSuccess": true
}

Clone this wiki locally