GET zone/zones

Returns all zones including their codes and coordinates.

Resource URL

http://kayrules.com/zone/zones.json

Parameters

Parameter Remark Description
state Optional The state within Malaysia.
Input: Johor / Kedah / Kelantan / Melaka / Negeri Sembilan / Pahang / Perak / Perlis / Pulau Pinang / Sabah / Sarawak / Selangor / Terengganu / Putrajaya / Kuala Lumpur / Labuan.
zone Optional The location code based on prayer time zones provided by Jakim.
Input: Refer to zone codes here.
pre Optional Show result in preformatted text enclosed with <pre> tags.
Input: true / false
Default: false

Response Fields

Parameter Description
states List all states within Malaysia based on selected `state` filter.
results

Information based on the selected zone.

zone The location code based on prayer time zones provided by Jakim.
Input: Refer to zone codes here.
negeri List of states within Malaysia.
lokasi List of locations identified by Jakim for which having similar prayer timezone.
lat Latitude information in geographic coordinate system.
lng Longitude information in geographic coordinate system.

Exception Fields

Parameter Description
error_code Return error code `400` for any error occured.
error_type Error types either REQUIRED_FIELD, INVALID_ZONE, LIMIT_EXCEEDED or COMPLEX_ERROR
error_desc

Show error description based on table below

REQUIRED_FIELD Missing Required field.
INVALID_ZONE Invalid zone code given.
LIMIT_EXCEEDED Maximum limit of 365 queries exceeded.
COMPLEX_ERROR Complex error has occured.

Example Request

http://kayrules.com/zone/zones.json?state=selangor&zone=sgr01

Example Result

{
    "states": [
        "Selangor"
    ],
    "results": [
        {
            "zone": "SGR01",
            "negeri": "Selangor",
            "lokasi": "Gombak",
            "lat": "3.253502",
            "lng": "101.653326"
        },
        {
            "zone": "SGR01",
            "negeri": "Selangor",
            "lokasi": "Hulu Selangor",
            "lat": "3.560105",
            "lng": "101.658312"
        },
        {
            "zone": "SGR01",
            "negeri": "Selangor",
            "lokasi": "Rawang",
            "lat": "3.320482",
            "lng": "101.575924"
        },
        {
            "zone": "SGR01",
            "negeri": "Selangor",
            "lokasi": "Hulu Langat",
            "lat": "3.113117",
            "lng": "101.815673"
        },
        {
            "zone": "SGR01",
            "negeri": "Selangor",
            "lokasi": "Sepang",
            "lat": "2.691369",
            "lng": "101.750527"
        },
        {
            "zone": "SGR01",
            "negeri": "Selangor",
            "lokasi": "Petaling Jaya",
            "lat": "3.184624",
            "lng": "101.535967"
        },
        {
            "zone": "SGR01",
            "negeri": "Selangor",
            "lokasi": "Shah Alam",
            "lat": "3.073281",
            "lng": "101.518461"
        }
    ]
}