URL:
http://phatam.org/api/dictionary/category_id/letter/dictionary_id/page
METHOD:
GET
PARAMETERS:
Giá trị mặc định

category_id: 0
letter: all
dictionary_id: 0
page: 1
RESPONSE JSON:
{
    status_code: 200,
    status_text: "Success"
    aLetter: 
    [
        0:  "A"
        1:  "B"
        2:  "C"
        3:  "D"
        4:  "E"
        5:  "F"
        6:  "G"
        7:  "H"
        8:  "I"
        9:  "J"
        10:  "K"
        11:  "L",
        .......
    ],
    aDetail: 
    {
        id: 13552,
        source: "http://rongmotamhon.net/mainpage/tracuu_7927_8.html#3",
        word: "dã bàn tăng",
        word_detail: "html",
        dictionary_id: "2"
    },
    aCategory: 
    [
        {
            id: 2,
            title: "Từ điển Phật Quang",
            url: "tu-dien-phat-quang",
            position: "10"
        },
        .......
    ],
    aBook: 
    {
        totalItemsCount: 15,
        currentPageNumber: 1,
        numItemsPerPage: 51,
        items: 
        [
            {
                id: 13544,
                dictionary_id: "2",
                url: "da-",
                view: "79",
                word: "dã"
            },
            .......
        ]
    }
}
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/dictionary/2/D/13552/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