AOPS API
Základní dotazování na content api servírované přes AOPS.
get
https://aops.cz/api/vase_project_id
Přístup k projektu
Příklady
HTML
PHP
JavaScript
GET /api/your_project_id HTTP/1.1a
Host: aops.cz
Accept: application/json
Authorization: Bearer your_access_token
<?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;
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));
get
https://aops.cz/api/vase_project_id/collection
Get Entries
Příklady
HTML
PHP
JavaScript
GET /api/your_project_id/your_collection HTTP/1.1
Host: aops.cz
Accept: application/json
Authorization: Bearer your_access_token
<?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;
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));
get
https://aops.cz/api/vase_project_id/collection/{content_id}
Get One Entry
Příklady
HTML
PHP
JavaScript
GET /api/your_project_id/your_collection/{content_id} HTTP/1.1
Host: aops.cz
Accept: application/json
Authorization: Bearer your_access_token
<?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;
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));
get
https://aops.cz/api/vase_project_id/project-media
Get One Entry
HTML
PHP
JavaScript
GET /api/your_project_id/project-media HTTP/1.1
Host: aops.cz
Accept: application/json
Authorization: Bearer your_access_token
<?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;
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));
K filtrování výsledků můžete použít klauzule where.
https://aops.cz/api/your_project_id/posts?where[id]=1
?where[created_at]=2021-11-25
?where[updated_at]=2021-11-25
?where[published_at]=2021-11-25
https://aops.cz/api/vase_project_id/posts?first
?where[title][like]=about
less than
less than or equal to
greater than
greater than or equal to
?where[price][between]=20,21
?where[price][not_between]=20,21
?where[][price]=200&where[][name]=Watch
?where[][price]=200&where[or][price]=300
Last modified 2mo ago