All URIs are relative to https://localhost
| Method | HTTP request | Description |
|---|---|---|
| api_web_alert_controller_index | GET /alerts | |
| api_web_alert_controller_show | GET /alerts/{id} |
Alerts api_web_alert_controller_index(page_offset=page_offset, page_limit=page_limit, sort=sort, api_key=api_key, include=include, filter_activity=filter_activity, filter_route_type=filter_route_type, filter_direction_id=filter_direction_id, filter_route=filter_route, filter_stop=filter_stop, filter_trip=filter_trip, filter_facility=filter_facility)
List active and upcoming system alerts An effect (enumerated in /data/{index}/attributes/effect and human-readable in /data/{index}/attributes/service_effect) on a provided service (facility, route, route type, stop and/or trip in //data/{index}/attributes/informed_entity) described by a banner (/data/{index}/attributes/banner), short header (/data/{index}/attributes/short_header), header /data/{index}/attributes/header, and description (/data/{index}/attributes/description) that is active for one or more periods (/data/{index}/attributes/active_period) caused by a cause (/data/{index}/attribute/cause) that somewhere in its lifecycle (enumerated in /data/{index}/attributes/lifecycle and human-readable in /data/{index}/attributes/timeframe). See GTFS Realtime FeedMessage FeedEntity Alert ## Descriptions There are 5 descriptive attributes. | JSON pointer | Usage | |---------------------------------------------|---------------------------------------------------------------------------------| | /data/{index}/attributes/banner | Display as alert across application/website | | /data/{index}/attributes/short_header | When /data/{index}/attributes/header is too long to display | | /data/{index}/attributes/header | Used before showing and prepended to /data/{index}/attributes/description | | /data/{index}/attributes/description | Used when user asks to expand alert. | ## Effect | JSON pointer | | |-----------------------------------------------|----------------| | /data/{index}/attributes/effect | Enumerated | | /data/{index}/attributes/service_effect | Human-readable | ## Timeline There are 3 timeline related attributes | JSON pointer | Description | |----------------------------------------------|------------------------------------------------------------------------------------------| | /data/{index}/attributes/active_period | Exact Date/Time ranges alert is active | | /data/{index}/attributes/lifecycle | Enumerated, machine-readable description of /data/{index}/attributes/active_period | | /data/{index}/attributes/timeframe | Human-readable description of /data/{index}/attributes/active_period | ## Activities Alerts are by default filtered to those where /data/{index}/attributes/informed_entity/{informed_entity_index}/activities/{activity_index} in one of BOARDEXITRIDE, as these cover most riders. If you want all alerts without filtering by activity, you should use the special value \"ALL\": filter[activity]=ALL. ### Accessibility The default activities cover if boarding, exiting, or riding is generally affected for all riders by the alert. If ONLY wheelchair using riders are affected, such as if a ramp, lift, or safety system for wheelchairs is affected, only the \"USING_WHEELCHAIR\" activity will be set. To cover wheelchair using rider, filter on the defaults and \"USING_WHEELCHAIR\": filter[activity]=USING_WHEELCHAIR,BOARD,EXIT,RIDE. Similarly for riders with limited mobility that need escalators, \"USING_ESCALATOR\" should be added to the defaults: filter[activity]=USING_ESCALATOR,BOARD,EXIT,RIDE.
from __future__ import print_function
import time
import mbtaapi
from mbtaapi.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = mbtaapi.AlertApi()
page_offset = 56 # int | Offset (0-based) of first element in the page (optional)
page_limit = 56 # int | Max number of elements to return (optional)
sort = 'sort_example' # str | Results can be [sorted](http://jsonapi.org/format/#fetching-sorting) by the id or any `/data/{index}/attributes` key. Assumes ascending; may be prefixed with '-' for descending | JSON pointer | Direction | `sort` | |--------------|-----------|------------| | `/data/{index}/attributes/active_period` | ascending | `active_period` | | `/data/{index}/attributes/active_period` | descending | `-active_period` | | `/data/{index}/attributes/banner` | ascending | `banner` | | `/data/{index}/attributes/banner` | descending | `-banner` | | `/data/{index}/attributes/cause` | ascending | `cause` | | `/data/{index}/attributes/cause` | descending | `-cause` | | `/data/{index}/attributes/created_at` | ascending | `created_at` | | `/data/{index}/attributes/created_at` | descending | `-created_at` | | `/data/{index}/attributes/description` | ascending | `description` | | `/data/{index}/attributes/description` | descending | `-description` | | `/data/{index}/attributes/effect` | ascending | `effect` | | `/data/{index}/attributes/effect` | descending | `-effect` | | `/data/{index}/attributes/effect_name` | ascending | `effect_name` | | `/data/{index}/attributes/effect_name` | descending | `-effect_name` | | `/data/{index}/attributes/header` | ascending | `header` | | `/data/{index}/attributes/header` | descending | `-header` | | `/data/{index}/attributes/informed_entity` | ascending | `informed_entity` | | `/data/{index}/attributes/informed_entity` | descending | `-informed_entity` | | `/data/{index}/attributes/lifecycle` | ascending | `lifecycle` | | `/data/{index}/attributes/lifecycle` | descending | `-lifecycle` | | `/data/{index}/attributes/service_effect` | ascending | `service_effect` | | `/data/{index}/attributes/service_effect` | descending | `-service_effect` | | `/data/{index}/attributes/severity` | ascending | `severity` | | `/data/{index}/attributes/severity` | descending | `-severity` | | `/data/{index}/attributes/short_header` | ascending | `short_header` | | `/data/{index}/attributes/short_header` | descending | `-short_header` | | `/data/{index}/attributes/timeframe` | ascending | `timeframe` | | `/data/{index}/attributes/timeframe` | descending | `-timeframe` | | `/data/{index}/attributes/updated_at` | ascending | `updated_at` | | `/data/{index}/attributes/updated_at` | descending | `-updated_at` | | `/data/{index}/attributes/url` | ascending | `url` | | `/data/{index}/attributes/url` | descending | `-url` | (optional)
api_key = 'api_key_example' # str | Key for API access. Without api_key, requests will be tracked by IP address and have stricter rate limit. [Register for a key](/register) (optional)
include = 'include_example' # str | Relationships to include. * `stops` * `routes` * `trips` * `facilities` The value of the include parameter **MUST** be a comma-separated (U+002C COMMA, \",\") list of relationship paths. A relationship path is a dot-separated (U+002E FULL-STOP, \".\") list of relationship names. [JSONAPI \"include\" behavior](http://jsonapi.org/format/#fetching-includes) (optional)
filter_activity = 'BOARD,EXIT,RIDE' # str | Filter to alerts for only those activities (`/data/{index}/attributes/informed_entity/activities/{activity_index}`) matching. Multiple activities **MUST** be a comma-separated (U+002C COMMA, \",\") list. An activity affected by an alert. | Value | Description | |----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `\"BOARD\"` | Boarding a vehicle. Any passenger trip includes boarding a vehicle and exiting from a vehicle. | | `\"BRINGING_BIKE\"` | Bringing a bicycle while boarding or exiting. | | `\"EXIT\"` | Exiting from a vehicle (disembarking). Any passenger trip includes boarding a vehicle and exiting a vehicle. | | `\"PARK_CAR\"` | Parking a car at a garage or lot in a station. | | `\"RIDE\"` | Riding through a stop without boarding or exiting.. Not every passenger trip will include this -- a passenger may board at one stop and exit at the next stop. | | `\"STORE_BIKE\"` | Storing a bicycle at a station. | | `\"USING_ESCALATOR\"` | Using an escalator while boarding or exiting (should only be used for customers who specifically want to avoid stairs.) | | `\"USING_WHEELCHAIR\"` | Using a wheelchair while boarding or exiting. Note that this applies to something that specifically affects customers who use a wheelchair to board or exit; a delay should not include this as an affected activity unless it specifically affects customers using wheelchairs. | ## Special Values * If the filter is not given OR it is empty, then defaults to [\"BOARD\", \"EXIT\", \"RIDE\"]. * If the value `\"ALL\"` is used then all alerts will be returned, not just those with the default activities. ## Accessibility The default activities cover if boarding, exiting, or riding is generally affected for all riders by the alert. If ONLY wheelchair using riders are affected, such as if a ramp, lift, or safety system for wheelchairs is affected, only the `\"USING_WHEELCHAIR\"` activity will be set. To cover wheelchair using rider, filter on the defaults and `\"USING_WHEELCHAIR\"`: `filter[activity]=USING_WHEELCHAIR,BOARD,EXIT,RIDE`. Similarly for riders with limited mobility that need escalators, `\"USING_ESCALATOR\"` should be added to the defaults: `filter[activity]=USING_ESCALATOR,BOARD,EXIT,RIDE`. (optional) (default to BOARD,EXIT,RIDE)
filter_route_type = 'filter_route_type_example' # str | Filter by route type https://developers.google.com/transit/gtfs/reference/routes-file (optional)
filter_direction_id = 'filter_direction_id_example' # str | Filter by direction of travel along the route. The meaning of `direction_id` varies based on the route. You can programmatically get the direction names from `/routes` `/data/{index}/attributes/direction_names` or `/routes/{id}` `/data/attributes/direction_names`. (optional)
filter_route = 'filter_route_example' # str | Filter by `/data/{index}/relationships/route/data/id`. Multiple `/data/{index}/relationships/route/data/id` **MUST** be a comma-separated (U+002C COMMA, \",\") list. (optional)
filter_stop = 'filter_stop_example' # str | Filter by `/data/{index}/relationships/stop/data/id`. Multiple `/data/{index}/relationships/stop/data/id` **MUST** be a comma-separated (U+002C COMMA, \",\") list. (optional)
filter_trip = 'filter_trip_example' # str | Filter by `/data/{index}/relationships/trip/data/id`. Multiple `/data/{index}/relationships/trip/data/id` **MUST** be a comma-separated (U+002C COMMA, \",\") list. (optional)
filter_facility = 'filter_facility_example' # str | Filter by `/data/{index}/relationships/facility/data/id`. Multiple `/data/{index}/relationships/facility/data/id` **MUST** be a comma-separated (U+002C COMMA, \",\") list. (optional)
try:
#
api_response = api_instance.api_web_alert_controller_index(page_offset=page_offset, page_limit=page_limit, sort=sort, api_key=api_key, include=include, filter_activity=filter_activity, filter_route_type=filter_route_type, filter_direction_id=filter_direction_id, filter_route=filter_route, filter_stop=filter_stop, filter_trip=filter_trip, filter_facility=filter_facility)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->api_web_alert_controller_index: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| page_offset | int | Offset (0-based) of first element in the page | [optional] |
| page_limit | int | Max number of elements to return | [optional] |
| sort | str | Results can be sorted by the id or any `/data/{index}/attributes` key. Assumes ascending; may be prefixed with '-' for descending | JSON pointer |
| api_key | str | Key for API access. Without api_key, requests will be tracked by IP address and have stricter rate limit. Register for a key | [optional] |
| include | str | Relationships to include. * `stops` * `routes` * `trips` * `facilities` The value of the include parameter MUST be a comma-separated (U+002C COMMA, ",") list of relationship paths. A relationship path is a dot-separated (U+002E FULL-STOP, ".") list of relationship names. JSONAPI "include" behavior | [optional] |
| filter_activity | str | Filter to alerts for only those activities (`/data/{index}/attributes/informed_entity/activities/{activity_index}`) matching. Multiple activities MUST be a comma-separated (U+002C COMMA, ",") list. An activity affected by an alert. | Value |
| filter_route_type | str | Filter by route type https://developers.google.com/transit/gtfs/reference/routes-file | [optional] |
| filter_direction_id | str | Filter by direction of travel along the route. The meaning of `direction_id` varies based on the route. You can programmatically get the direction names from `/routes` `/data/{index}/attributes/direction_names` or `/routes/{id}` `/data/attributes/direction_names`. | [optional] |
| filter_route | str | Filter by `/data/{index}/relationships/route/data/id`. Multiple `/data/{index}/relationships/route/data/id` MUST be a comma-separated (U+002C COMMA, ",") list. | [optional] |
| filter_stop | str | Filter by `/data/{index}/relationships/stop/data/id`. Multiple `/data/{index}/relationships/stop/data/id` MUST be a comma-separated (U+002C COMMA, ",") list. | [optional] |
| filter_trip | str | Filter by `/data/{index}/relationships/trip/data/id`. Multiple `/data/{index}/relationships/trip/data/id` MUST be a comma-separated (U+002C COMMA, ",") list. | [optional] |
| filter_facility | str | Filter by `/data/{index}/relationships/facility/data/id`. Multiple `/data/{index}/relationships/facility/data/id` MUST be a comma-separated (U+002C COMMA, ",") list. | [optional] |
No authorization required
- Content-Type: application/vnd.api+json
- Accept: application/vnd.api+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Alert api_web_alert_controller_show(id, api_key=api_key, include=include)
Show a particular alert by the alert's id An effect (enumerated in /data/attributes/effect and human-readable in /data/attributes/service_effect) on a provided service (facility, route, route type, stop and/or trip in //data/attributes/informed_entity) described by a banner (/data/attributes/banner), short header (/data/attributes/short_header), header /data/attributes/header, and description (/data/attributes/description) that is active for one or more periods (/data/attributes/active_period) caused by a cause (/data/attribute/cause) that somewhere in its lifecycle (enumerated in /data/attributes/lifecycle and human-readable in /data/attributes/timeframe). See GTFS Realtime FeedMessage FeedEntity Alert ## Descriptions There are 5 descriptive attributes. | JSON pointer | Usage | |---------------------------------------------|---------------------------------------------------------------------------------| | /data/attributes/banner | Display as alert across application/website | | /data/attributes/short_header | When /data/attributes/header is too long to display | | /data/attributes/header | Used before showing and prepended to /data/attributes/description | | /data/attributes/description | Used when user asks to expand alert. | ## Effect | JSON pointer | | |-----------------------------------------------|----------------| | /data/attributes/effect | Enumerated | | /data/attributes/service_effect | Human-readable | ## Timeline There are 3 timeline related attributes | JSON pointer | Description | |----------------------------------------------|------------------------------------------------------------------------------------------| | /data/attributes/active_period | Exact Date/Time ranges alert is active | | /data/attributes/lifecycle | Enumerated, machine-readable description of /data/attributes/active_period | | /data/attributes/timeframe | Human-readable description of /data/attributes/active_period |
from __future__ import print_function
import time
import mbtaapi
from mbtaapi.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = mbtaapi.AlertApi()
id = 'id_example' # str | Unique identifier for alert
api_key = 'api_key_example' # str | Key for API access. Without api_key, requests will be tracked by IP address and have stricter rate limit. [Register for a key](/register) (optional)
include = 'include_example' # str | Relationships to include. * `stops` * `routes` * `trips` * `facilities` The value of the include parameter **MUST** be a comma-separated (U+002C COMMA, \",\") list of relationship paths. A relationship path is a dot-separated (U+002E FULL-STOP, \".\") list of relationship names. [JSONAPI \"include\" behavior](http://jsonapi.org/format/#fetching-includes) (optional)
try:
#
api_response = api_instance.api_web_alert_controller_show(id, api_key=api_key, include=include)
pprint(api_response)
except ApiException as e:
print("Exception when calling AlertApi->api_web_alert_controller_show: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Unique identifier for alert | |
| api_key | str | Key for API access. Without api_key, requests will be tracked by IP address and have stricter rate limit. Register for a key | [optional] |
| include | str | Relationships to include. * `stops` * `routes` * `trips` * `facilities` The value of the include parameter MUST be a comma-separated (U+002C COMMA, ",") list of relationship paths. A relationship path is a dot-separated (U+002E FULL-STOP, ".") list of relationship names. JSONAPI "include" behavior | [optional] |
No authorization required
- Content-Type: application/vnd.api+json
- Accept: application/vnd.api+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]