# AOPS API

## Endpoints <a href="#b612275554_644" id="b612275554_644"></a>

## Přístup k projektu

<mark style="color:blue;">`GET`</mark> `https://aops.cz/api/vase_project_id`

Přístup ke všem kolekcím.

#### Headers

| Name                                            | Type                      | Description |
| ----------------------------------------------- | ------------------------- | ----------- |
| Accept<mark style="color:red;">\*</mark>        | application/json          |             |
| Authorization<mark style="color:red;">\*</mark> | Bearer vas\_access\_token |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

**Příklady**

{% tabs %}
{% tab title="HTML" %}

```html
GET /api/your_project_id HTTP/1.1a
    Host: aops.cz
    Accept: application/json
    Authorization: Bearer your_access_token
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://aops.cz/api/your_project_id',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'Authorization: Bearer your_access_token'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "Bearer your_access_token");

var requestOptions = {
    method: 'GET',
    headers: myHeaders,
    redirect: 'follow'
};

fetch("https://aops.cz/api/your_project_id", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));
```

{% endtab %}
{% endtabs %}

## Get Entries

<mark style="color:blue;">`GET`</mark> `https://aops.cz/api/vase_project_id/collection`

Získá všechny záznamy přidané ke kolekci.

#### Headers

| Name                                            | Type                      | Description |
| ----------------------------------------------- | ------------------------- | ----------- |
| Accept<mark style="color:red;">\*</mark>        | application/json          |             |
| Authorization<mark style="color:red;">\*</mark> | Bearer vas\_access\_token |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

**Příklady**

{% tabs %}
{% tab title="HTML" %}

```html
GET /api/your_project_id/your_collection HTTP/1.1
    Host: aops.cz
    Accept: application/json
    Authorization: Bearer your_access_token
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://aops.cz/api/your_project_id/your_collection',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'Authorization: Bearer your_access_token'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "Bearer your_access_token");

var requestOptions = {
    method: 'GET',
    headers: myHeaders,
    redirect: 'follow'
};

fetch("https://aops.cz/api/your_project_id/your_collection", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));
```

{% endtab %}
{% endtabs %}

## Get One Entry

<mark style="color:blue;">`GET`</mark> `https://aops.cz/api/vase_project_id/collection/{content_id}`

Získá konkrétní záznam podle zadaného ID.

#### Headers

| Name                                            | Type                      | Description |
| ----------------------------------------------- | ------------------------- | ----------- |
| Accept<mark style="color:red;">\*</mark>        | application/json          |             |
| Authorization<mark style="color:red;">\*</mark> | Bearer vas\_access\_token |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

**Příklady**

{% tabs %}
{% tab title="HTML" %}

```html
GET /api/your_project_id/your_collection/{content_id} HTTP/1.1
    Host: aops.cz
    Accept: application/json
    Authorization: Bearer your_access_token
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://aops.cz/api/your_project_id/your_collection/{content_id}',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'Authorization: Bearer your_access_token'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "Bearer your_access_token");

var requestOptions = {
    method: 'GET',
    headers: myHeaders,
    redirect: 'follow'
};

fetch("https://aops.cz/api/your_project_id/your_collection/{content_id}", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));
```

{% endtab %}
{% endtabs %}

## Get Project Media

<mark style="color:blue;">`GET`</mark> `https://aops.cz/api/vase_project_id/project-media`

Získá všechna multimédia přiřazená k projektu.

#### Headers

| Name                                     | Type                      | Description |
| ---------------------------------------- | ------------------------- | ----------- |
| Accept<mark style="color:red;">\*</mark> | application/json          |             |
| <mark style="color:red;">\*</mark>       | Bearer vas\_access\_token |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### **Příklady** <a href="#b612275554_5442" id="b612275554_5442"></a>

{% tabs %}
{% tab title="HTML" %}

```html
GET /api/your_project_id/project-media HTTP/1.1
    Host: aops.cz
    Accept: application/json
    Authorization: Bearer your_access_token
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://aops.cz/api/your_project_id/project-media',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'Authorization: Bearer your_access_token'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "Bearer your_access_token");

var requestOptions = {
    method: 'GET',
    headers: myHeaders,
    redirect: 'follow'
};

fetch("https://aops.cz/api/your_project_id/project-media", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));
```

{% endtab %}
{% endtabs %}

## **Parameters** <a href="#b612275554_8587" id="b612275554_8587"></a>

#### **Where Clauses** <a href="#b612275554_6933" id="b612275554_6933"></a>

K filtrování výsledků můžete použít klauzule where.

#### **Příklad** <a href="#b612275554_7014" id="b612275554_7014"></a>

```
https://aops.cz/api/your_project_id/posts?where[id]=1
```

#### **Single Where Clause** <a href="#b612275554_7122" id="b612275554_7122"></a>

```
?where[created_at]=2021-11-25
```

```
?where[updated_at]=2021-11-25
```

```
?where[published_at]=2021-11-25
```

#### **Get the first result** <a href="#b612275554_7415" id="b612275554_7415"></a>

```
https://aops.cz/api/vase_project_id/posts?first
```

#### ***like*****&#x20;operator** <a href="#b612275554_7522" id="b612275554_7522"></a>

```
?where[title][like]=about
```

#### ***not*****&#x20;operator** <a href="#b612275554_7596" id="b612275554_7596"></a>

#### ***in*****&#x20;and&#x20;*****not\_in*****&#x20;operators** <a href="#b612275554_7668" id="b612275554_7668"></a>

#### ***lt*****&#x20;and&#x20;*****lte*****&#x20;operators** <a href="#b612275554_7792" id="b612275554_7792"></a>

less than

less than or equal to

#### ***gt*****&#x20;and&#x20;*****gte*****&#x20;operators** <a href="#b612275554_7960" id="b612275554_7960"></a>

greater than

greater than or equal to

#### ***null*****&#x20;and&#x20;*****not\_null*****&#x20;operators** <a href="#b612275554_8134" id="b612275554_8134"></a>

#### ***between*****&#x20;and&#x20;*****not\_between*****&#x20;operators** <a href="#b612275554_8258" id="b612275554_8258"></a>

```
?where[price][between]=20,21
```

```
?where[price][not_between]=20,21
```

#### **Combining where clauses** <a href="#b612275554_8408" id="b612275554_8408"></a>

```
?where[][price]=200&where[][name]=Watch
```

#### ***OR*** <a href="#b612275554_8502" id="b612275554_8502"></a>

```
?where[][price]=200&where[or][price]=300
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidoc.histogram.cz/aops-dokumentace/aops-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
