Skip to content
v1.0.0

Playground Examples API

API to demonstrate the use of x-playground-example extension

Servers

https://api.example.com/v1Production server

Default


List items with playground-specific examples

GET
/items

Demonstrates the use of x-playground-example extension.

Parameters

Header Parameters

X-Custom

Optionally provide parameters as a JSON object in this header.

Typestring
Example{"id":"header-id-789"}
X-Api-Key*

API key for authentication

Typestring
Required
Exampleapi-key-123

Query Parameters

id

Filter by ID (with playground-specific example)

Typestring
Examplegeneral-id-456
name

Filter by name (with schema-level playground example)

Typestring
ExampleGeneral Item Name
category

Filter by category (with standard example)

Typestring
Exampleelectronics

Responses

Successful response
application/json
JSON
{
"items": [
{
"id": "item-123",
"name": "Sample Item",
"description": "This is a sample item description",
"price": 19.99,
"category": "electronics"
}
],
"total": 1
}

Playground

Headers
Variables
Key
Value

Samples

cURL
JavaScript
PHP
Python

Create a new item

POST
/items

Creates a new item with the provided details

Parameters

Header Parameters

X-Api-Key*

API key for authentication

Typestring
Required
Exampleapi-key-123

Request Body

application/json
JSON
{
"name": "New Item",
"description": "Description of the new item",
"price": 29.99,
"category": "furniture"
}

Responses

Item created successfully
application/json
JSON
{
"id": "item-456",
"name": "New Item",
"description": "Description of the new item",
"price": 29.99,
"category": "furniture",
"createdAt": "2023-06-15T14:30:00Z"
}

Playground

Headers
Body

Samples

cURL
JavaScript
PHP
Python

Get item by ID

GET
/items/{id}

Retrieves a specific item by its ID

Parameters

Header Parameters

X-Api-Key*

API key for authentication

Typestring
Required
Exampleapi-key-123

Path Parameters

id*

Item ID

Typestring
Required
Exampleitem-123

Responses

Successful response
application/json
JSON
{
"id": "item-123",
"name": "Sample Item",
"description": "This is a sample item description",
"price": 19.99,
"category": "electronics"
}

Playground

Headers
Variables
Key
Value

Samples

cURL
JavaScript
PHP
Python

Powered by VitePress OpenAPI