URL:
http://phatam.org/api/chua-viet/index/area_id/province_id/pagoda_id/page
METHOD:
GET
PARAMETERS:
Giá trị mặc định

area_id: 0
province_id: 0
pagoda_id: 0
page: 1


RESPONSE JSON:
{
    status_code: 200,
    status_text: "Success"
    aPagodaDetail: 
    {
        id: 248,
        title: "Chùa Vạn Phúc",
        buddhistPagodaPhotoIds: ",4484,4485,4486,4487,4488,4489,4490,4491,4492",
        url: "chua-van-phuc",
        thumbnail: "http://phatam.org/images/webup/chua-viet/thumbnail/2015-02-07-11-07-30ToanCanhChua.jpg",
        view: "161",
        description: html,
        photo:
        [
            {
                id: 4492,
                title: "Tượng đức Phật ngồi thiền định trên toà sen",
                url: "tuong-duc-phat-ngoi-thien-dinh-tren-toa-sen",
                file: "http://phatam.org/images/webup/chua-viet/original/2015-02-16-11-12-51TuongDucPhatNgoiThienDinhTrenToaSen.jpg",
                thumbnail: "http://phatam.org/images/webup/chua-viet/thumbnail/2015-02-16-11-12-51TuongDucPhatNgoiThienDinhTrenToaSen.jpg",
                view: "0",
                pid: null
            },
            .......
        ]
    },
    aCategory: 
    [
        aArea:
        {
            {
                id: 1
                title: "Miền Bắc"
                url: "mien-bac"
            },
            .......
        },
        aProvinces:
        {
            {
                id: 1,
                regions_domain_id: "3",
                title: "Bình Dương",
                url: "MienNam-BinhDuong"
            },
            .......
        }
    ],
    aPagoda: 
    {
        totalItemsCount: 15,
        currentPageNumber: 1,
        numItemsPerPage: 51,
        items: 
        [
            {
                id: 248,
                regions_domain_provinces_id: "21",
                regions_domain_id: "1",
                title: "Chùa Vạn Phúc",
                photo_ids: ",4484,4485,4486,4487,4488,4489,4490,4491,4492",
                url: "chua-van-phuc",
                thumbnail: "http://phatam.org/images/webup/chua-viet/thumbnail/2015-02-07-11-07-30ToanCanhChua.jpg",
                view: "161"
            }
        ]
    }
    
}
PHP EXAMPLE:
// Lưu ý User-agent = "PHATAM.ORG/API ACCESS_FORM ".$_SERVER['SERVER_NAME']
// nếu User-agent không đúng định dạng này thì sẽ không truy xuất được API
$curl = curl_init("http://phatam.org/api/chua-viet/index/1/21/248/1");
curl_setopt($curl, CURLOPT_USERAGENT, "PHATAM.ORG/API ACCESS_FORM ".$_SERVER['SERVER_NAME']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$curl_response = curl_exec($curl);
if ($curl_response === false) {
    $info = curl_getinfo($curl);
    curl_close($curl);
    die('error occured during curl exec. Additioanl info: ' . var_export($info));
}
curl_close($curl);
$decoded = json_decode($curl_response);
if (isset($decoded->status_code) && $decoded->status_code != 200 ) {
    die('error occured: ' . $decoded->status_text);
}
//do whatever with $data now
 
© Copyright 2013 - 2018 PHATAM.ORG - Chịu trách nhiệm nội dung: Thị Đức bienman0811@yahoo.com - Hỗ trợ kỹ thuật votamthoai@gmail.com