For all resources in the Parking OS (garage.arivo.app (opens new window)) the parking areas are saved on our Server.
They can be retrieved programmatically using an [Arivo Service Account](https://youtrack.acc.si/articles/Service Accounts & OAuth).
# Prerequisites
- The Service Account has the required permissions
- Bearer token has the scope
iam.sa
- Bearer token has the audience
rpc.acc.si
# API
- Is a
POST
Request - https://garage.arivo.fun/rpc/user/server/rpc?resource={resource-id} (opens new window)
- In Production use the domain
.app
instead of.fun
- In Production use the domain
- The body includes the following data:
- rpc: setting_get
- request:
- resource: <resource_id>
- key: "/common/parking_areas2"
- scope: ""
- The response includes the following data:
- value:
- <id (one entry per parking area)>:
- id: <id>
- name: <human readable name>
- gates: <list of gate ids that are part of this parking area>
- shortterm_gates: <list of gate ids that are part of this parking area that allow shortterm parking>
- shortterm_limit: <Limit on shortterm parkers, detailed definition depends on shortterm_limit_type>
- default_cost_entries: <The cost entry that will be applied to parkers in this parking area. Not described here>
- shortterm_limit_type: <no_limit - shortterm_limit is ignored | shortterm_count - shortterm_limit is only counted against shortterm parkers | total_count - shortterm_limit is counted against all parkers>
- pay_per_use_cost_entries: <The cost entry that will be applied to pay-per-use parkers in this parking area. Not described here>
- <id (one entry per parking area)>:
- value:
- Example using the
curl
command line (The Bearer Token must first be generated accoring to [Service-Accounts-OAuth#generate-a-bearer-token](https://youtrack.acc.si/articles/Service Accounts & OAuth/Service-Accounts-OAuth#generate-a-bearer-token) with scope iam.sa und audience rpc.acc.si) A test environment can be provided on request. The Resource might not be available in the future. A new resource id can be provided on request:Request:
curl -X POST "https://garage.arivo.fun/rpc/user/server/rpc?resource=at-8-arivo-barrier" -H "Content-Type: application/json" -d '{"rpc": "setting_get", "request": {"resource": "at-8-arivo-barrier", "key": "common/parking_areas2", "scope": ""}}' -H "Authorization: Bearer ..."
Response:
{ "value": { "ea4eb280-53ce-433a-abd3-2de2015dcc8b": { "id": "ea4eb280-53ce-433a-abd3-2de2015dcc8b", "name": "Gesamter Parkplatz", "gates": [ "ausfahrt", "einfahrt", "dummy-exit", "dummy-entry", "einfahrt-von-hinten" ], "shortterm_gates": [ "ausfahrt", "einfahrt", "einfahrt-von-hinten", "dummy-exit", "dummy-entry" ], "shortterm_limit": 10, "default_cost_entries": [ { "group": "parking_default", "value": "fd67f80d-4842-4373-9bf8-794760da595b", "account_id": "0", "entry_type": "rate_change" } ], "shortterm_limit_type": "total_count", "pay_per_use_cost_entries": null } } }