Skip to content

Commit

Permalink
feat(docs): improve introduction with ChatGPT #561
Browse files Browse the repository at this point in the history
  • Loading branch information
fengelniederhammer committed Jan 15, 2024
1 parent db4932d commit e026ccd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lapis2-docs/src/content/docs/concepts/request-methods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Tab from '../../../components/TabsBox/astro/Tab.astro';

LAPIS supports queries via GET and POST requests. GET requests encode the query in the URL, offering a simple, shareable
format ideal for direct browser access. Most features are supported with GET requests. POST requests requires formatting
the query as a JSON and send it in the reuqest body. They support a few advanced queries that are not possible with GET
the query as a JSON and send it in the request body. They support a few advanced queries that are not possible with GET
requests. They are ideal if you want to make requests programmatically.

## Example
Expand Down
29 changes: 18 additions & 11 deletions lapis2-docs/src/content/docs/references/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,31 @@ title: Introduction
description: Introduction to References
---

This section will cover the basics of how to use LAPIS.
This section covers the basics of using LAPIS.

## Endpoints

LAPIS can be accessed by calling different endpoints. Each endpoint has a different purpose and will return different data.
For example the `GET /sample/aggregated` endpoint will return how many sequences fulfill the provided filter criteria. Each endpoint
can be called using different HTTP methods, namely `GET` and `POST`. Both methods will return the same data, only the way the filter criteria is
provided is different.
LAPIS is accessible through various endpoints, each serving a distinct purpose and returning different data.
For instance, the `GET /sample/aggregated` endpoint returns the count of sequences that meet specified filter criteria.
These endpoints accept [`GET` and `POST`](/concepts/request-methods) requests.
Both methods yield identical data; however, the manner of providing the filter criteria differs.

You can find the different endpoints in the [Open API / Swagger](/references/open-api-definition/), alongside a convenient way to test them out using Swagger-UI.
The various endpoints are listed in the [Open API / Swagger](/references/open-api-definition/) documentation,
which also offers a convenient testing interface via Swagger-UI.

## Filters

The results of each endpoint can be filtered by different parameters. These parameters are passed as query parameters in the URL for `GET` requests or in the body for `POST` requests.
For example, if you want to know how many sequences are from Germany, you can call
`GET /sample/aggregated?country=Germany`. You can find the different possible filters in [Filters](/references/filters/) and try them out at [Open API / Swagger](/references/open-api-definition/).
The output from each endpoint can be refined using various parameters.
For `GET` requests, these parameters are included as query strings in the URL,
whereas for `POST` requests, they are placed in the request body.
For instance, to determine the number of sequences originating from Germany,
you would use `GET /sample/aggregated?country=Germany`.
The available filters are detailed in [Filters](/references/filters/),
and you can experiment with them at [Open API / Swagger](/references/open-api-definition/).

## Fields

Using fields you can specify how the returned data is grouped. For example, if you want to know how many sequences are from each country,
you can call `GET /sample/aggregated?fields=country`. You can find the different possible fields in [Fields](/references/fields/) and try them out at [Open API / Swagger](/references/open-api-definition/).
Fields allow you to dictate the grouping of the returned data.
For example, to find out the number of sequences from each country,you would use `GET /sample/aggregated?fields=country`.
The available fields are documented in [Fields](/references/fields/),
and you can test them at [Open API / Swagger](/references/open-api-definition/).

0 comments on commit e026ccd

Please sign in to comment.