Skip to content
v1.0.0

OpenAPI Plant Store

A sample API that uses a plant store as an example to demonstrate features in the OpenAPI specification

License

MIT

Servers

http://sandbox.mintlify.com

Default


ID: get-plants

GET /plants

GET
/plants

Returns 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
formatint32

Responses

Plant response
application/json
JSON
[
{
"name": "string",
"tag": "string"
}
]

Samples

Bruno
get {
  url: http://sandbox.mintlify.com/plants
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: http://sandbox.mintlify.com/plants
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'http://sandbox.mintlify.com/plants' \
 -H "Content-Type: application/json"
JavaScript
fetch('http://sandbox.mintlify.com/plants', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?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;
?>
Python
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
/plants

Creates a new plant in the store

Authorizations

bearerAuth
TypeHTTP (bearer)

Request Body

JSON
{
"name": "string",
"tag": "string",
"id": 0
}

Responses

plant response
application/json
JSON
{
"name": "string",
"tag": "string"
}

Samples

Bruno
post {
  url: http://sandbox.mintlify.com/plants
}

headers {
  Content-Type: application/json
}
Bruno
post {
  url: http://sandbox.mintlify.com/plants
}

headers {
  Content-Type: application/json
}
cURL
curl -X POST \
'http://sandbox.mintlify.com/plants' \
 -H "Content-Type: application/json"
JavaScript
fetch('http://sandbox.mintlify.com/plants', {method:'POST',headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?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;
?>
Python
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
Required
formatint64

Responses

Plant deleted

Samples

Bruno
delete {
  url: http://sandbox.mintlify.com/plants/{id}
}

headers {
  Content-Type: application/json
}
Bruno
delete {
  url: http://sandbox.mintlify.com/plants/{id}
}

headers {
  Content-Type: application/json
}
cURL
curl -X DELETE \
'http://sandbox.mintlify.com/plants/{id}' \
 -H "Content-Type: application/json"
JavaScript
fetch('http://sandbox.mintlify.com/plants/{id}', {method:'DELETE',headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?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;
?>
Python
import requests

url = 'http://sandbox.mintlify.com/plants/{id}'

headers = {
    'Content-Type': 'application/json'
}

response = requests.delete(url, headers=headers)
print(response.json())

Powered by VitePress OpenAPI