Skip to content

Commit

Permalink
Docs: Fix Election Day API docs.
Browse files Browse the repository at this point in the history
TYPE: Bugfix
  • Loading branch information
Marc Sommerhalder committed Jul 16, 2024
1 parent c9ba7fa commit b4dda4d
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 66 deletions.
33 changes: 12 additions & 21 deletions docs/api/api.md → docs/api/agency/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# OneGov Cloud API

## Agency API
# OneGov Agency API

The headless Agency API offers the following views:

Expand All @@ -11,7 +9,7 @@ The headless Agency API offers the following views:
We implement the called Collection+JSON standard established by Mike
Amundsen. For details please refer to [media types - collection & json](http://amundsen.com/media-types/collection/format/)

### Agencies View
## Agencies View

The agencies view provides information about all the existing agencies
within the organisation. Each agency offers several data fields like title,
Expand All @@ -21,7 +19,7 @@ memberships if given.

`curl https://[base_url]/agencies`

#### Agency Query Fields
### Agency Query Fields

The agencies api support the following query fields:

Expand All @@ -36,7 +34,7 @@ The agencies api support the following query fields:
| updated_gt | queries agencies updated after date specified (greater than) |


#### cURL Example
### cURL Example

`curl https://[base_url]/agencies?title=datenschutzbeauftragter`

Expand Down Expand Up @@ -156,7 +154,7 @@ A collection+JSON of items if found including paging
}
```

### People View
## People View

The people view provides information about all people in relation with agencies
within the organisation. Each person offers several data fields like
Expand All @@ -166,7 +164,7 @@ a picture, website and memberships to agencies memberships if given.

`curl https://[base_url]/people`

#### People Query Fields
### People Query Fields

The people api supports the following query fields that can be combined:

Expand All @@ -180,7 +178,7 @@ The people api supports the following query fields that can be combined:
| updated_ge | queries people updated after or date specified (greater equal) |
| updated_gt | queries people updated after date specified (greater than) |

#### cURL Example
### cURL Example

`curl https://[base_url]/people?first_name=moritz`

Expand Down Expand Up @@ -320,15 +318,15 @@ A collection+JSON of items if found including paging
}
```

### Membership View
## Membership View

The membership view provides information about all the existing memberships
between people and agencies within the organisation. Each membership has
data points and links to its person and agency.

`curl https://[base_url]/memberships`

#### Membership Query Fields
### Membership Query Fields

The agencies api support the following query fields:

Expand All @@ -343,7 +341,7 @@ The agencies api support the following query fields:
| updated_gt | queries memberships updated after date specified (greater than) |


#### cURL Example
### cURL Example

`curl https://staka.zug.ch/api/memberships?agency=1`

Expand Down Expand Up @@ -451,7 +449,7 @@ A collection+JSON of items if found
}
```

### Authorization
## Authorization

The API employs token-based authentication, which allows for unrestricted usage of the API without encountering rate-limiting restrictions.
A token will be valid for one hour, afterward you have to request a new one.
Expand All @@ -475,7 +473,7 @@ Once you have a key, you can request a token. The token is used for all other re
2. To request a token, make a GET to `/api/authenticate` and provide the API access key via HTTP basic authentication in the username part (the password part is not used):
3. The token must be provided with all requests using the the username part of the HTTP basic authentication (the password part is not used).

#### curl example:
### curl example:

```bash
#/bin/bash
Expand All @@ -491,10 +489,3 @@ curl -X GET \
-u $(echo -n "$TOKEN:") \
<your api url>/api/agencies
```



## Election Day API

Please refer to
[Election Day API](src/onegov/election_day/static/docs/api/README.md)
1 change: 1 addition & 0 deletions docs/api/election_day
1 change: 0 additions & 1 deletion docs/api/election_day/README.md

This file was deleted.

27 changes: 17 additions & 10 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,23 @@ Describes our very own Formcode™ Syntax, a DSL to write forms with.

formcode


Public API
++++++++++

Find out how to use the public API.

.. toctree::
:maxdepth: 1

api/agency/README.md

.. toctree::
:maxdepth: 1

api/election_day/README.md


Source
^^^^^^

Expand All @@ -118,13 +135,3 @@ the OneGov Cloud modules documentation.
:maxdepth: 2

modules

API
^^^

API documentation

.. toctree::
:maxdepth: 2

api/api.md
32 changes: 0 additions & 32 deletions docs/onegov_town6.rst

This file was deleted.

4 changes: 2 additions & 2 deletions src/onegov/election_day/static/docs/api/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Onegov Election Day
===================
OneGov Election Day API
=======================

Upload Formats
--------------
Expand Down

0 comments on commit b4dda4d

Please sign in to comment.