A place to catalogue the German words I have learnt
You can run the project locally with
yarn dev
An OpenAPI document for the API can be found at http://localhost:3000/api/openapi.json.
You can see these as a Swagger UI page at http://localhost:3000/api-doc.
Many of the API endpoints require authentication. This can be achieved either by logging into the app, and then calling the APIs, or by using the client credentials flow.
In order to call the APIs when not logged in, you need an access token. The flow to get this is as follows:
-
Log into the app as normal (E.g. login with Google)
-
Visit http://localhost:3000/api-doc and call the
/client-credentials
endpoint- This will return a payload like:
{ "clientId": "myUserId", "clientSecret": "some secret value" }
- This will return a payload like:
-
These credentials can now be used to retreive an access token with the API http://localhost:3000/api/token (or via the same Swagger UI page)
-
You can now make a request to an endpoint that required authentication, setting the
Authorization
header to be"Bearer: <access_token>"
, and the request will be performed on behalf of the user that the access token was granted for.