Skip to content

Commit

Permalink
Merge pull request #103 from OneBusAway/more-apis
Browse files Browse the repository at this point in the history
More apis
  • Loading branch information
aaronbrethorst authored Mar 20, 2024
2 parents c8d2f5e + 1c5604b commit 4385e74
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 136 deletions.
1 change: 1 addition & 0 deletions src/api/example_responses/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710960036523,"data":{"entry":{"gitProperties":{"git.branch":"d600e47ead0928a9e1bd76af9f16c12294d3782c","git.build.host":"swdev31","git.build.time":"23.01.2024 @ 16:01:10 EST","git.build.user.email":"[email protected]","git.build.user.name":"sheldonabrown","git.build.version":"2.5.2-cs","git.closest.tag.commit.count":"0","git.closest.tag.name":"onebusaway-application-modules-2.5.2-cs","git.commit.id":"d600e47ead0928a9e1bd76af9f16c12294d3782c","git.commit.id.abbrev":"d600e47","git.commit.id.describe":"onebusaway-application-modules-2.5.2-cs","git.commit.id.describe-short":"onebusaway-application-modules-2.5.2-cs","git.commit.message.full":"[maven-release-plugin] prepare release onebusaway-application-modules-2.5.2-cs","git.commit.message.short":"[maven-release-plugin] prepare release onebusaway-application-modules-2.5.2-cs","git.commit.time":"23.01.2024 @ 15:48:19 EST","git.commit.user.email":"[email protected]","git.commit.user.name":"sheldonabrown","git.dirty":"false","git.remote.origin.url":"[email protected]:camsys/onebusaway-application-modules.git","git.tags":"onebusaway-application-modules-2.5.2-cs"},"id":"b6bff432-3b99-4f75-8834-4b0c6969fb3f","name":"FEB24_2_4","serviceDateFrom":"1709280000000","serviceDateTo":"1722409200000"},"references":{"agencies":[],"routes":[],"situations":[],"stopTimes":[],"stops":[],"trips":[]}},"text":"OK","version":2}
1 change: 1 addition & 0 deletions src/api/example_responses/current-time.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710960121182,"data":{"entry":{"readableTime":"2024-03-20T11:42:01-07:00","time":1710960121182},"references":{"agencies":[],"routes":[],"situations":[],"stopTimes":[],"stops":[],"trips":[]}},"text":"OK","version":2}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710960205535,"data":{},"text":"OK","version":2}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code":200,"currentTime":1710960426279,"data":{},"text":"OK","version":2}
64 changes: 5 additions & 59 deletions src/api/where/methods/config.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,11 @@
---
layout: page
title: config.json Method
layout: rest_api
title: config Method
description: Get access to configuration information about the OBA server.
sample_request_url: https://api.pugetsound.onebusaway.org/api/where/config.json?key=TEST
example_response_file: config.json
---

Access to configuration information.

## Sample Request

[https://api.pugetsound.onebusaway.org/api/where/config.json?key=TEST](https://api.pugetsound.onebusaway.org/api/where/config.json?key=TEST)


## Sample Response

```
{
"code": 200,
"currentTime": 1709665910298,
"data": {
"entry": {
"gitProperties": {
"git.branch": "d600e47ead0928a9e1bd76af9f16c12294d3782c",
"git.build.host": "swdev31",
"git.build.time": "23.01.2024 @ 16:01:10 EST",
"git.build.user.email": "[email protected]",
"git.build.user.name": "sheldonabrown",
"git.build.version": "2.5.2-cs",
"git.closest.tag.commit.count": "0",
"git.closest.tag.name": "onebusaway-application-modules-2.5.2-cs",
"git.commit.id": "d600e47ead0928a9e1bd76af9f16c12294d3782c",
"git.commit.id.abbrev": "d600e47",
"git.commit.id.describe": "onebusaway-application-modules-2.5.2-cs",
"git.commit.id.describe-short": "onebusaway-application-modules-2.5.2-cs",
"git.commit.message.full": "[maven-release-plugin] prepare release onebusaway-application-modules-2.5.2-cs",
"git.commit.message.short": "[maven-release-plugin] prepare release onebusaway-application-modules-2.5.2-cs",
"git.commit.time": "23.01.2024 @ 15:48:19 EST",
"git.commit.user.email": "[email protected]",
"git.commit.user.name": "sheldonabrown",
"git.dirty": "false",
"git.remote.origin.url": "[email protected]:camsys/onebusaway-application-modules.git",
"git.tags": "onebusaway-application-modules-2.5.2-cs"
},
"id": "b6bff432-3b99-4f75-8834-4b0c6969fb3f",
"name": "FEB24_2_4",
"serviceDateFrom": "1709280000000",
"serviceDateTo": "1722409200000"
},
"references": {
"agencies": [],
"routes": [],
"situations": [],
"stopTimes": [],
"stops": [],
"trips": []
}
},
"text": "OK",
"version": 2
}
```

## Request Parameters

* key - API key for authentication.
Expand Down
27 changes: 4 additions & 23 deletions src/api/where/methods/current-time.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
---
layout: page
layout: rest_api
title: current-time Method
description: Retrieve the current system time.
sample_request_url: https://api.pugetsound.onebusaway.org/api/where/current-time.json?key=TEST
example_response_file: current-time.json
---

Retrieve the current system time

## Sample Request

[http://api.pugetsound.onebusaway.org/api/where/current-time.json?key=TEST](http://api.pugetsound.onebusaway.org/api/where/current-time.json?key=TEST)

## Sample Response

<response>
<version>2</version>
<code>200</code>
<text>OK</text>
<currentTime>1270614730908</currentTime>
<data class="time">
<references/>
<time>
<time>1270614730908</time>
<readableTime>2010-04-06T21:32:10-07:00</readableTime>
</time>
</data>
</response>

## Response

* `time` - current system time as milliseconds since the Unix epoch
Expand Down
10 changes: 0 additions & 10 deletions src/api/where/methods/plan-trip.md

This file was deleted.

30 changes: 8 additions & 22 deletions src/api/where/methods/report-problem-with-stop.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
---
layout: page
layout: rest_api
title: report-problem-with-stop Method
description: |
Submit a user-generated problem report for a particular stop. The reporting mechanism provides lots of fields that can
be specified to give more context about the details of the problem (which trip, stop, vehicle, etc was involved),
making it easier for a developer or transit agency staff to diagnose the problem. These reports feed into the
problem reporting admin interface.
sample_request_url: https://api.pugetsound.onebusaway.org/api/where/report-problem-with-stop/1_75403.json?key=TEST&code=stop_name_wrong
example_response_file: report-problem-with-stop-1_75403.json
---

Submit a user-generated problem report for a particular stop. The reporting mechanism provides lots of fields that can
be specified to give more context about the details of the problem (which trip, stop, vehicle, etc was involved),
making it easier for a developer or transit agency staff to diagnose the problem. These reports feed into the
problem reporting admin interface.

## Sample Request

[http://api.pugetsound.onebusaway.org/api/where/report-problem-with-stop/1_75403.json?key=TEST&amp;code=stop_name_wrong](http://api.pugetsound.onebusaway.org/api/where/report-problem-with-stop/1_75403.json?key=TEST&amp;code=stop_name_wrong)

## Sample Response

~~~~
<response>
<version>2</version>
<code>200</code>
<currentTime>1318879898047</currentTime>
<text>OK</text>
<data/>
</response>
~~~~

## Request Parameters

* stopId - the trip id, encoded directly in the URL:
Expand Down
30 changes: 8 additions & 22 deletions src/api/where/methods/report-problem-with-trip.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
---
layout: page
layout: rest_api
title: report-problem-with-trip Method
description: |
Submit a user-generated problem report for a particular trip. The reporting mechanism provides lots of fields that can
be specified to give more context about the details of the problem (which trip, stop, vehicle, etc was involved),
making it easier for a developer or transit agency staff to diagnose the problem. These reports feed into the
problem reporting admin interface.
sample_request_url: https://api.pugetsound.onebusaway.org/api/where/report-problem-with-trip/1_79430293.json?key=TEST&serviceDate=1291536000000&vehicleId=1_3521&stopId=1_75403&code=vehicle_never_came
example_response_file: report-problem-with-trip-1_79430293.json
---

Submit a user-generated problem report for a particular trip. The reporting mechanism provides lots of fields that can
be specified to give more context about the details of the problem (which trip, stop, vehicle, etc was involved),
making it easier for a developer or transit agency staff to diagnose the problem. These reports feed into the
problem reporting admin interface.

## Sample Request

[http://api.pugetsound.onebusaway.org/api/where/report-problem-with-trip/1_79430293.json?key=TEST&amp;serviceDate=1291536000000&amp;vehicleId=1_3521&amp;stopId=1_75403&amp;code=vehicle_never_came](http://api.pugetsound.onebusaway.org/api/where/report-problem-with-trip/1_79430293.json?key=TEST&amp;serviceDate=1291536000000&amp;vehicleId=1_3521&amp;stopId=1_75403&amp;code=vehicle_never_came)

## Sample Response

~~~~
<response>
<version>2</version>
<code>200</code>
<currentTime>1318879898047</currentTime>
<text>OK</text>
<data/>
</response>
~~~~

## Request Parameters

* tripId - the trip id, encoded directly in the URL:
Expand Down

0 comments on commit 4385e74

Please sign in to comment.