API documentation

Get information about a zone

GET /api/zones/:id

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

This web service returns information about a particular zone. The information include the weekly schedule.

Parameters

Parameter name Parameter type Description
id int the id of the zone for which the user needs information

Response

Status Code: 200 if OK

{
    "name": "Zone 9",
    "price": "4.0",
    "price_unit": "hour",
    "project_id": 1,
    "is_active": false,
    "current_time": "2015-04-14 14:12:42",
    "scheduler_hours": [
                    {
                        "scheduler_hour": {
                            "price": "4.0",
                            "hour_of_the_week": 0
                        }
                    },
                    {
                        "scheduler_hour": {
                            "price": "4.0",
                            "hour_of_the_week": 1
                        }
                    },
                      ...
                    {
                        "scheduler_hour": {
                            "price": "4.0",
                            "hour_of_the_week": 167
                        }
                    }
                ]
}
Parameter name Parameter type Description
name string name of the zone
price string default price for the zone
price_unit string time unit for zone/price (hour/minute)
project_id int id of the project from which this zone belongs
is_active bool true if the zone is active
current_time string current time on the zone used by the application to calculate the price
scheduler_hours List list of scheduler_hour objects
scheduler_hour object object containing information about hour prices(hour_of_the_week, price)

Note: "scheduler_hours" is the new mode used for calculating the price. It is divided in 168(number of hours in a week) "scheduler_hour" and each "scheduler_hour" has "hour_of_the_week" (the number of the hour in the week) and the "price" for that hour. You can use this for calculating the price.

Note: The ws returns only the hours that have a different price than the default price.

Note: "scheduler_hours" can be null, and if so you should use the default "price" from the "zone" object.

Status Code: 401 if request not ok