-
Notifications
You must be signed in to change notification settings - Fork 10
RESTful API
The web client of the gtfs-realtime-validator uses a web service. A series of calls to an REST API made to start and monitor the feeds.
All calls are made to the endpoint at localhost:8080/api/
.
The request body should contain the parameters required in the JSON format.
The required parameters for each request is given in the Rest-API.
Responses will be in the JSON format. The response would differ from the resource that is being accessed. This can be viwed in detail in the Rest-API
The API uses standard HTTP error codes to present errors.
Response Code | Status |
---|---|
2xx | These codes indicate success. The body section if present is the object returned by the request. The body will contain the associated json data for the request |
4xx | Error caused by the client. (ex - Invalid parameters) |
5xx | Server side error. In which the server is aware of the error |
###/gtfs
####GET
Option | Description |
---|---|
Title | Get all GTFS feeds in the database. |
URL | http://localhost:8080/api/gtfs |
URL Params | *Required:*
`id=[integer]`
(example: id=12)
Optional: |
Data Params |
{ "u" :
{ 'email' : "string",
name : [string],
current_password : [alphanumeric]
password : [alphanumeric],
password_confirmation : [alphanumeric]
}
} |
Response |
**Code:** 200
**Content:** { "u" :
{ 'email' : "string",
name : [string],
current_password : [alphanumeric]
password : [alphanumeric],
password_confirmation : [alphanumeric]
}
} |
####POST
####PUT
####DELETE
###/gtfs-rt
###/gtfs
####GET
####POST
####PUT
####DELETE
In order to monitor a feed the following methods must be invocated in order
-
POST /gtfs This method will download the GTFS feed to the server and return an gtfs-feed object. This object will contain an ID for the given feed. This will be used later when starting to monitor the GTFS-Realtime Feed.
-
POST /gtfs-rt An URL of a real-time feed is sent to the server. This is added to the database and the corresponding ID is returned. You must associate an GTFS id with any real-time feed this can be gotten from the previous step.
-
GET /gtfs-rt/{id}/monitor Once the rt feed is added, we trigger the monitor action(a background task) for the given feed Id. This will monitor for any errors and logs them in the database.
-
GET /gtfs-rt/{id} If the monitoring has started, a call to this resource will return the errors and warnings of the feed.