Skip to content

Mall API

atsanan edited this page Oct 18, 2018 · 19 revisions

8. Mall

[x] 8.1 Get malls list

GET /api/v1/mall/list?page=0&limit=10

Query parameters:

Field Description Optional Default Auth
page Current page of Malls list Yes 0 Yes
limit Maximum page of Malls list Yes 10 Yes

Returns:

{
    "data": {
        "malls": [
            {
                "_id": "5bb772fc68efd87103266963",
                "created_at": "2018-08-29T11:22:16.859Z",
                "filenameLogo1": "filenameLogo1.png",
                "filenameLogo2": "filenameLogo2.png",
                "isActive": true,
                "isSponser": true,
                "location": {
                    "coordinates": [
                        100.531631,
                        13.745122
                    ],
                    "type": "Point"
                },
                "mallAddress": {
                    "chi1": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
                    "chi2": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
                    "eng": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
                    "thai": "999 ถนน เพลินจิต แขวง ลุมพินี เขต ปทุมวัน กรุงเทพมหานคร 10330"
                },
                "mallDetail": {
                    "chi1": "Gaysorn village",
                    "chi2": "Gaysorn village",
                    "eng": "Gaysorn village",
                    "thai": "เกษร วิลเลจ"
                },
                "mallName": {
                    "chi1": "Gaysorn village",
                    "chi2": "Gaysorn village",
                    "eng": "Gaysorn village",
                    "thai": "เกษร วิลเลจ"
                },
                "mapIndoorId": "EIM-0a656478-3d18-40a3-bfda-8eaacc0d9e55",
                "mapOutdoorId": "GaysornVillage",
                "order": 1,
                "updated_at": "2018-10-07T22:35:30Z"
            },
            {
                "_id": "5bc6a5a5fe13590ad0002bc6",
                "created_at": "2018-10-17T02:59:49Z",
                "filenameLogo1": "MAAVMlvDvt.png",
                "filenameLogo2": "PrU6dCr7RD.png",
                "isActive": true,
                "isSponser": true,
                "location": {
                    "coordinates": [
                        13.5,
                        12.3685
                    ],
                    "type": "Point"
                },
                "mallAddress": {
                    "chi1": "test",
                    "chi2": "test",
                    "eng": "test",
                    "thai": "test"
                },
                "mallDetail": {
                    "chi1": "test",
                    "chi2": "test",
                    "eng": "test",
                    "thai": "test"
                },
                "mallName": {
                    "chi1": "test",
                    "chi2": "test",
                    "eng": "test",
                    "thai": "test"
                },
                "mapIndoorID": "tt",
                "mapOutdoorID": "tt",
                "order": 9,
                "updated_at": "2018-10-17T18:11:59Z"
            }
        ],
        "pageIndex": -1,
        "pageLimit": -1,
        "pages": 1,
        "paging": {
            "next": "",
            "previous": ""
        }
    },
    "isSuccess": true
}

[x] 8.2 Get mall info

GET /api/v1/mall/info/{mallId : string}

Url parameters:

Field Description Optional Default Auth
mallId ID of this mall No 0 Yes

Returns:

{
    "data": {
        "_id": "5bb772fc68efd87103266963",
        "created_at": "2018-08-29T11:22:16.859Z",
        "filenameLogo1": "filenameLogo1.png",
        "filenameLogo2": "filenameLogo2.png",
        "isActive": true,
        "isSponser": true,
        "location": {
            "coordinates": [
                100.531631,
                13.745122
            ],
            "type": "Point"
        },
        "mallAddress": {
            "chi1": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
            "chi2": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
            "eng": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
            "thai": "999 ถนน เพลินจิต แขวง ลุมพินี เขต ปทุมวัน กรุงเทพมหานคร 10330"
        },
        "mallDetail": {
            "chi1": "Gaysorn village",
            "chi2": "Gaysorn village",
            "eng": "Gaysorn village",
            "thai": "เกษร วิลเลจ"
        },
        "mallName": {
            "chi1": "Gaysorn village",
            "chi2": "Gaysorn village",
            "eng": "Gaysorn village",
            "thai": "เกษร วิลเลจ"
        },
        "mapIndoorId": "EIM-0a656478-3d18-40a3-bfda-8eaacc0d9e55",
        "mapOutdoorId": "GaysornVillage",
        "order": 1,
        "updated_at": "2018-10-07T22:35:30Z"
    },
    "isSuccess": true
}

[x] 8.3 Get mall floor info

POST /api/v1/mall/floor/info

Form data:

Field Description Optional Auth
mallFloorId ID of floor in mall Yes Yes
mapIndoorFloorKey Key of the indoor map on floor in mall Yes Yes

Returns:

{
    "data": [
        {
            "_id": "5bb7784568efd87103266969",
            "created_at": "2018-10-08T11:01:46Z",
            "mall": {
                "_id": "5bb772fc68efd87103266963",
                "created_at": "2018-08-29T11:22:16.859Z",
                "filenameLogo1": "filenameLogo1.png",
                "filenameLogo2": "filenameLogo2.png",
                "isActive": true,
                "isSponser": true,
                "location": {
                    "coordinates": [
                        100.531631,
                        13.745122
                    ],
                    "type": "Point"
                },
                "mallAddress": {
                    "chi1": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
                    "chi2": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
                    "eng": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
                    "thai": "999 ถนน เพลินจิต แขวง ลุมพินี เขต ปทุมวัน กรุงเทพมหานคร 10330"
                },
                "mallDetail": {
                    "chi1": "Gaysorn village",
                    "chi2": "Gaysorn village",
                    "eng": "Gaysorn village",
                    "thai": "เกษร วิลเลจ"
                },
                "mallName": {
                    "chi1": "Gaysorn village",
                    "chi2": "Gaysorn village",
                    "eng": "Gaysorn village",
                    "thai": "เกษร วิลเลจ"
                },
                "mapIndoorId": "EIM-0a656478-3d18-40a3-bfda-8eaacc0d9e55",
                "mapOutdoorId": "GaysornVillage",
                "order": 1,
                "updated_at": "2018-10-07T22:35:30Z"
            },
            "mallFloorDetail": {
                "chi1": "Gaysorn Village, Floor L",
                "chi2": "Gaysorn Village, Floor L",
                "eng": "Gaysorn Village, Floor L",
                "thai": "ศูนย์การค้าเกษร ชั้น L"
            },
            "mallFloorName": {
                "chi1": "Gaysorn Village, Floor L",
                "chi2": "Gaysorn Village, Floor L",
                "eng": "Gaysorn Village, Floor L",
                "thai": "ศูนย์การค้าเกษร ชั้น L"
            },
            "mallId": "5bb772fc68efd87103266963",
            "mapIndoorFloorData": "1",
            "mapIndoorFloorKey": "Gaysorn Village, Floor L",
            "updated_at": "2018-10-08T11:03:12Z"
        }
    ],
    "isSuccess": true
}

8.5 Add mall (backend)

POST /api/v1/mall/add

JSON body:

Field Description Optional Auth
mallName Name of mall No No
mallDetail Detail of mall yes No
mallAddress Address of mall yes No
mapOutdoorId mapOutdoorId of mall No No
mapIndoorId mapIndoorId of mall No No
isActive isActive of mall No No
location location of mall No No

Returns:

{
    "data": {
        "id": "5b46c4fcaaea3c0eac69374d",
        "mallNameEng": "mallNameEng",
        "mallDetailEng": "mallDetailEng",
        "mallAddressEng": "mallAddressEng",
        "mallNameThai": "mallNameThai",
        "mallDetailThai": "mallDetailThai",
        "mallAddressThai": "mallAddressThai",
        "mallNameChi1": "mallNameChi1",
        "mallDetailChi1": "mallDetailChi1",
        "mallAddressChi1": "mallAddressChi1",
        "mallNameChi2": "mallNameChi2",
        "mallDetailChi2": "mallDetailChi2",
        "mallAddressChi2": "mallAddressChi2",
        "mapOutdoorId": "",
        "mapIndoorId": "EIM-1dcaab70-7cc6-4673-8f9a-4f78dc9409cb",
        "isActive": true,
        "location": {
            "type": "point",
            "coordinates": [
                13.7646,
                100.531586
            ]
        },
        "createAt": "2018-07-12T03:03:24.596Z",
        "lastModified": "2018-07-12T03:03:24.596Z"
    },
    "isSuccess": true
}

8.6 Update mall (backend)

POST /api/v1/mall/{mallId : string}

JSON body:

Field Description Optional Auth
mallName Name of mall No No
mallDetail Detail of mall yes No
mallAddress Address of mall yes No
mapOutdoorId mapOutdoorId of mall No No
mapIndoorId mapIndoorId of mall No No
isActive isActive of mall No No
location location of mall No No

Returns:

{
    "data": {
        "id": "5b46c4fcaaea3c0eac69374d",
        "mallNameEng": "mallNameEng",
        "mallDetailEng": "mallDetailEng",
        "mallAddressEng": "mallAddressEng",
        "mallNameThai": "mallNameThai",
        "mallDetailThai": "mallDetailThai",
        "mallAddressThai": "mallAddressThai",
        "mallNameChi1": "mallNameChi1",
        "mallDetailChi1": "mallDetailChi1",
        "mallAddressChi1": "mallAddressChi1",
        "mallNameChi2": "mallNameChi2",
        "mallDetailChi2": "mallDetailChi2",
        "mallAddressChi2": "mallAddressChi2",
        "mapOutdoorId": "",
        "mapIndoorId": "EIM-1dcaab70-7cc6-4673-8f9a-4f78dc9409cb",
        "isActive": true,
        "location": {
            "type": "point",
            "coordinates": [
                13.7646,
                100.531586
            ]
        },
        "createAt": "2018-07-12T03:03:24.596Z",
        "lastModified": "2018-07-12T03:03:24.596Z"
    },
    "isSuccess": true
}

8.7 Add floor (backend)

POST /api/v1/mall/floor/add

JSON body:

Field Description Optional Auth
mallFloorName mallFloorName of floor in mallFloor No No
mallFloorDetail mallFloorDetail in mallFloor Yes No
mallId mallId in mall No No
mapIndoorFloorData mapIndoorFloorData in mallFloor Yes No
mapIndoorFloorKey mapIndoorFloorKey in mallFloor Yes No

Returns:

{
    "data": {
        "id": "5b47268aaaea3c3044450099",
        "mallFloorName": "Siam_discovery-100",
        "mallFloorDetail": "Siam_discovery-100",
        "mapIndoorFloorKey": "100",
        "mapIndoorFloorData": "Siam_discovery-100",
        "mallId": "5b45dc38aaea3c08e0580ee0",
        "createAt": "2018-07-12T09:59:38.882Z",
        "lastModified": "2018-07-12T09:55:07.36Z",
        "mall": {
            "id": "5b45dc38aaea3c08e0580ee0",
            "mallName": "new mall",
            "mallDetail": "new Detail",
            "mallAddress": "news Address",
            "mapOutdoorId": "",
            "mapIndoorId": "EIM-1dcaab70-7cc6-4673-8f9a-4f78dc9409cb",
            "isActive": true,
            "location": {
                "type": "point",
                "coordinates": [
                    13.7646,
                    100.531586
                ]
            },
            "createAt": "2018-07-11T10:30:16.163Z",
            "lastModified": "2018-07-11T10:30:16.163Z"
        }
    },
    "isSuccess": true
}

8.8 Update floor (backend)

POST /api/v1/mall/floor/{mallId : string}

JSON body:

Field Description Optional Auth
mallFloorName mallFloorName of floor in mallFloor No No
mallFloorDetail mallFloorDetail in mallFloor Yes No
mallId mallId in mall No No
mapIndoorFloorData mapIndoorFloorData in mallFloor Yes No
mapIndoorFloorKey mapIndoorFloorKey in mallFloor Yes No

Returns:

{
    "data": {
        "id": "5b47268aaaea3c3044450099",
        "mallFloorName": "Siam_discovery-100",
        "mallFloorDetail": "Siam_discovery-100",
        "mapIndoorFloorKey": "100",
        "mapIndoorFloorData": "Siam_discovery-100",
        "mallId": "5b45dc38aaea3c08e0580ee0",
        "createAt": "2018-07-12T09:59:38.882Z",
        "lastModified": "2018-07-12T09:55:07.36Z",
        "mall": {
            "id": "5b45dc38aaea3c08e0580ee0",
            "mallName": "new mall",
            "mallDetail": "new Detail",
            "mallAddress": "news Address",
            "mapOutdoorId": "",
            "mapIndoorId": "EIM-1dcaab70-7cc6-4673-8f9a-4f78dc9409cb",
            "isActive": true,
            "location": {
                "type": "point",
                "coordinates": [
                    13.7646,
                    100.531586
                ]
            },
            "createAt": "2018-07-11T10:30:16.163Z",
            "lastModified": "2018-07-11T10:30:16.163Z"
        }
    },
    "isSuccess": true
}

8.9 Mall nearBy

GET /api/v1/mall/nearBy

Url parameters:

Field Description Optional Default Auth
page Current page of Malls list Yes 0 Yes
limit Maximum page of Malls list Yes 10 Yes
lat lattiude No No
long longitude No No
min minDistance yes No
max maxDistance yes No

Returns:

{
    "data": {
        "malls": [
            {
                "_id": "5bb772fc68efd87103266963",
                "created_at": "2018-08-29T11:22:16.859Z",
                "filenameLogo1": "filenameLogo1.png",
                "filenameLogo2": "filenameLogo2.png",
                "isActive": true,
                "isSponser": true,
                "location": {
                    "coordinates": [
                        100.531631,
                        13.745122
                    ],
                    "type": "Point"
                },
                "mallAddress": {
                    "chi1": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
                    "chi2": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
                    "eng": "999 Ploenchit Road, Lumpini, Pathumwan, Bangkok 10330",
                    "thai": "999 ถนน เพลินจิต แขวง ลุมพินี เขต ปทุมวัน กรุงเทพมหานคร 10330"
                },
                "mallDetail": {
                    "chi1": "Gaysorn village",
                    "chi2": "Gaysorn village",
                    "eng": "Gaysorn village",
                    "thai": "เกษร วิลเลจ"
                },
                "mallName": {
                    "chi1": "Gaysorn village",
                    "chi2": "Gaysorn village",
                    "eng": "Gaysorn village",
                    "thai": "เกษร วิลเลจ"
                },
                "mapIndoorId": "EIM-0a656478-3d18-40a3-bfda-8eaacc0d9e55",
                "mapOutdoorId": "GaysornVillage",
                "order": 1,
                "updated_at": "2018-10-07T22:35:30Z"
            }
        ],
        "pageIndex": -1,
        "pageLimit": -1,
        "pages": 1,
        "paging": {
            "next": "",
            "previous": ""
        }
    },
    "isSuccess": true
}

Clone this wiki locally