# Getting started

To use the API, you must have a registered OAuth client. We provide client registration on a case-by-case basis for selected partners and integrations. See [Requesting access](./requesting-access) for how to apply.


## Authentication

First, follow the instructions in [Authentication](./authentication) to retrieve an access token. Once you have obtained an access token, you can use it to access the API by including the access token in the `Authorization` header on every request.

## Retrieving the administration ID

Most endpoints require the administration ID. The administration ID can be discovered by querying the `administrations` endpoint:

```
GET https://api.moneymonk.nl/v0/administrations
Authorization: Bearer <access_token>
```

This will return something like:
```
{
  "data": [
    {
      "id": 123,
      "companyName": "Mijn Bedrijf"
    }
  ]
}
```

Because an access token is scoped to a single administration, this list always contains exactly one entry.


## Accessing the API

Once you know the administration ID of your administration, you can query other endpoints. For example, to query the general ledger accounts for this administration, you'd make the following request:
```
GET https://api.moneymonk.nl/v0/administrations/123/general-ledger-accounts
Authorization: Bearer <access_token>
```

Typically, this will return a list of the following form:
```
{
  "data": [
    {
      "id": 568,
      "code": "0400",
      "name": "Eigen vermogen",
      "category": "LIABILITIES",
      "type": "EQUITY"
    },
    [...]
  ]
}
```
