URL:
http://phatam.org/api/music/mp3/category_id/music_ids/page
METHOD:
GET
PARAMETERS:
Giá trị mặc định

category_id: 0
music_ids: 0
page: 1


RESPONSE JSON:
{
    status_code: 200,
    status_text: "Success"
    aMusicDetail: 
    {
        title: "Green Tara Mantra",
        file: "http://phatam.org/media/music/20141024/Green_Tara_Mantra.mp3",
        xml: "",
        json: null,
        url: "Green-Tara-Mantra",
        musicid: 694
    },
    aCategory: 
    [
        {
            id: 2,
            title: "Root Mantra",
            pid: "1",
            url: "root-mantra-phatam"
        },
        .......
    ],
    aMusic: 
    {
        totalItemsCount: 15,
        currentPageNumber: 1,
        numItemsPerPage: 51,
        items: 
        [
            {
                id: 709,
                pid: "3",
                musicid: "698",
                url: "nhac-lien-hoa",
                view: "1532",
                title: "Nhạc Liên Hoa",
                thumbnail: null,
                artistid: "1",
                artistname: null
            },
            .......
        ]
    }
    
}
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/music/mp3/0/694/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