v1.0.0
OpenAPI Plant Store
A sample API that uses a plant store as an example to demonstrate features in the OpenAPI specification
Servers
http://sandbox.mintlify.com
Default
ID: get-plants
GET /plants
GET
/plantsReturns all plants from the system that the user has access to
Authorizations
bearerAuth
TypeHTTP (bearer)
Parameters
Query Parameters
limit
The maximum number of results to return
Typeinteger
format
int32
Responses
Plant responseSchema JSON JSON
application/json
[
{
"name": "string",
"tag": "string"
}
]
GET
/plantsSamples
get {
url: http://sandbox.mintlify.com/plants
}
headers {
Content-Type: application/json
}
get {
url: http://sandbox.mintlify.com/plants
}
headers {
Content-Type: application/json
}
curl -X GET \
'http://sandbox.mintlify.com/plants' \
-H "Content-Type: application/json"
fetch('http://sandbox.mintlify.com/plants', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'http://sandbox.mintlify.com/plants';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'http://sandbox.mintlify.com/plants'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
ID: post-plants
POST /plants
POST
/plantsCreates a new plant in the store
Authorizations
bearerAuth
TypeHTTP (bearer)
Request Body
{
"name": "string",
"tag": "string",
"id": 0
}
Responses
plant responseSchema JSON JSON
application/json
{
"name": "string",
"tag": "string"
}
POST
/plantsSamples
post {
url: http://sandbox.mintlify.com/plants
}
headers {
Content-Type: application/json
}
post {
url: http://sandbox.mintlify.com/plants
}
headers {
Content-Type: application/json
}
curl -X POST \
'http://sandbox.mintlify.com/plants' \
-H "Content-Type: application/json"
fetch('http://sandbox.mintlify.com/plants', {method:'POST',headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'http://sandbox.mintlify.com/plants';
$method = 'POST';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'http://sandbox.mintlify.com/plants'
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers)
print(response.json())
ID: delete-plants-{id}
DELETE /plants/{id}
DELETE
/plants/{id}Deletes a single plant based on the ID supplied
Authorizations
bearerAuth
TypeHTTP (bearer)
Parameters
Path Parameters
id*
ID of plant to delete
Typeinteger
Requiredformat
int64
Responses
Plant deleted
DELETE
/plants/{id}Samples
delete {
url: http://sandbox.mintlify.com/plants/{id}
}
headers {
Content-Type: application/json
}
delete {
url: http://sandbox.mintlify.com/plants/{id}
}
headers {
Content-Type: application/json
}
curl -X DELETE \
'http://sandbox.mintlify.com/plants/{id}' \
-H "Content-Type: application/json"
fetch('http://sandbox.mintlify.com/plants/{id}', {method:'DELETE',headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'http://sandbox.mintlify.com/plants/{id}';
$method = 'DELETE';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'http://sandbox.mintlify.com/plants/{id}'
headers = {
'Content-Type': 'application/json'
}
response = requests.delete(url, headers=headers)
print(response.json())