Skip to content

API collection

Tetiva Playground

20 requests · 7 folders

One host, four protocols, 20 requests. Tetiva Playground at playground.tetiva.app answers with what you sent, any status you ask for, as slowly as you like. No key, nothing stored, not a proxy. The two streaming gRPC calls are in the gRPC folder as grpcurl commands.

Folder

REST · Echo#

Every echo answers with the method, URL, query (as args), headers and body it received, plus a request_id. A JSON body comes back raw in data and parsed in json; forms and multipart uploads come back in form and files.

REST · Echo

Echo a GET#

GEThttps://playground.tetiva.app/get?source=docs&page=2

Returns your request as JSON: query parameters in args, headers in headers, your IP in origin.

Query parameters · 2

sourcedocs
page2
curl 'https://playground.tetiva.app/get?source=docs&page=2'

Response examples

REST · Echo

Echo my POST body#

POSThttps://playground.tetiva.app/post

Send a JSON body and get it back: raw in data, parsed in json. Bodies go up to 1 MB; forms and multipart files come back in form and files.

Headers · 1

Content-Typeapplication/json

Body · JSON

{"hello":"world"}
curl -X POST 'https://playground.tetiva.app/post' \
  -H 'Content-Type: application/json' \
  --data-raw '{"hello":"world"}'

Response examples

REST · Echo

Echo a PUT#

PUThttps://playground.tetiva.app/put

The same echo for PUT: the body comes back in data and json.

Headers · 1

Content-Typeapplication/json

Body · JSON

{
  "id": 42,
  "name": "Ada Lovelace",
  "role": "admin"
}
curl -X PUT 'https://playground.tetiva.app/put' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "id": 42,
  "name": "Ada Lovelace",
  "role": "admin"
}'

Response examples

REST · Echo

Echo a PATCH#

PATCHhttps://playground.tetiva.app/patch

The same echo for PATCH, handy for partial updates.

Headers · 1

Content-Typeapplication/json

Body · JSON

{
  "role": "viewer"
}
curl -X PATCH 'https://playground.tetiva.app/patch' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "role": "viewer"
}'

Response examples

REST · Echo

Echo a DELETE#

DELETEhttps://playground.tetiva.app/delete?id=42

The same echo for DELETE. A body is allowed and comes back too.

Query parameters · 1

id42
curl -X DELETE 'https://playground.tetiva.app/delete?id=42'

Response examples

REST · Echo

Any method, any path#

POSThttps://playground.tetiva.app/anything/orders/42?dry_run=true

/anything and every path under it echo any method, custom ones included, so you can stand in for a route that doesn't exist yet.

Query parameters · 1

dry_runtrue

Headers · 1

Content-Typeapplication/json

Body · JSON

{
  "status": "shipped"
}
curl -X POST 'https://playground.tetiva.app/anything/orders/42?dry_run=true' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "status": "shipped"
}'

Response examples

REST · Echo

See my headers#

GEThttps://playground.tetiva.app/headers

Returns only the headers the server received. Useful to check what your client, proxy or SDK adds.

Headers · 1

X-Debug1
curl 'https://playground.tetiva.app/headers' \
  -H 'X-Debug: 1'

Response examples

Folder

REST · Status codes and delays#

Make the server fail or stall on purpose: any status from 200 to 599, or a wait of up to 10 seconds.

REST · Status codes and delays

Any status code#

GEThttps://playground.tetiva.app/status/418

Answers with the status in the path, from 200 to 599. Redirects point to /get, 401 adds WWW-Authenticate, 429 and 503 add Retry-After.

curl 'https://playground.tetiva.app/status/418'

Response examples

REST · Status codes and delays

Slow response#

GEThttps://playground.tetiva.app/delay/2

Waits the number of seconds in the path, up to 10, then answers; fractions work too, as in /delay/0.5. Good for testing timeouts and loading states.

curl 'https://playground.tetiva.app/delay/2'

Response examples

Folder

REST · Auth#

Check that your client sends credentials, and that it copes with the 401 when it doesn't.

REST · Auth

Bearer auth#

GEThttps://playground.tetiva.app/bearer

Any non-empty token passes and comes back in token. Without Authorization: Bearer … you get 401 with WWW-Authenticate: Bearer.

Authorization

Bearer

prefixBearer
tokentest-token
curl 'https://playground.tetiva.app/bearer' \
  -H 'Authorization: Bearer test-token'

Response examples

REST · Auth

Basic auth#

GEThttps://playground.tetiva.app/basic-auth/tetiva/playground

Passes when the Basic credentials match the user and password in the path, here tetiva / playground. Anything else gets 401.

Authorization

Basic

passwordplayground
usernametetiva
curl 'https://playground.tetiva.app/basic-auth/tetiva/playground' \
  -H 'Authorization: Basic dGV0aXZhOnBsYXlncm91bmQ='

Response examples

Folder

REST · Fake data#

Five fake users for lists, tables and pagination. The data is the same every time, and POST /users answers as if it worked but stores nothing.

REST · Fake data

Fake users#

GEThttps://playground.tetiva.app/users?limit=3

A page of fake users. limit takes 1 to 5, and next links to the following page until it is null.

Query parameters · 1

limit3
curl 'https://playground.tetiva.app/users?limit=3'

Response examples

REST · Fake data

One fake user#

GEThttps://playground.tetiva.app/users/2

One user by id, from 1 to 5. Any other id gets 404 with a hint.

curl 'https://playground.tetiva.app/users/2'

Response examples

REST · Fake data

Create a user#

POSThttps://playground.tetiva.app/users

Checks name and email and answers 201 with the new user and a Location header. Nothing is stored: stored is false.

Headers · 1

Content-Typeapplication/json

Body · JSON

{
  "name": "Grace Hopper",
  "email": "grace@example.com",
  "role": "editor"
}
curl -X POST 'https://playground.tetiva.app/users' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "Grace Hopper",
  "email": "grace@example.com",
  "role": "editor"
}'

Response examples

Folder

GraphQL#

A small library at https://playground.tetiva.app/graphql: books, authors and one mutation. Introspection is on, so any GraphQL client can load the schema.

GraphQL

Run a GraphQL query#

GraphQLhttps://playground.tetiva.app/graphql

Operation: Books

Lists books with their authors. first takes 1 to 50; a field that doesn't exist gets an error that lists the real ones.

Query

query Books($first: Int) {
  books(first: $first) {
    id
    title
    author {
      name
    }
  }
}

Variables

{
  "first": 2
}
curl -X POST 'https://playground.tetiva.app/graphql' \
  -H 'Content-Type: application/json' \
  --data-raw '{"query":"query Books($first: Int) {\n  books(first: $first) {\n    id\n    title\n    author {\n      name\n    }\n  }\n}","variables":{"first":2},"operationName":"Books"}'

Response examples

GraphQL

One book by id#

GraphQLhttps://playground.tetiva.app/graphql

Operation: Book

Fetches one book. An unknown id returns "book": null, not an error.

Query

query Book($id: ID!) {
  book(id: $id) {
    title
    year
    author {
      name
    }
  }
}

Variables

{
  "id": "3"
}
curl -X POST 'https://playground.tetiva.app/graphql' \
  -H 'Content-Type: application/json' \
  --data-raw '{"query":"query Book($id: ID!) {\n  book(id: $id) {\n    title\n    year\n    author {\n      name\n    }\n  }\n}","variables":{"id":"3"},"operationName":"Book"}'

Response examples

GraphQL

Add a book#

GraphQLhttps://playground.tetiva.app/graphql

Operation: AddBook

A mutation that returns the new book with id 6. Nothing is stored: extensions.stored is false.

Query

mutation AddBook($title: String!, $authorId: ID!) {
  addBook(title: $title, authorId: $authorId) {
    id
    title
    author {
      name
    }
  }
}

Variables

{
  "title": "Carmilla",
  "authorId": "a5"
}
curl -X POST 'https://playground.tetiva.app/graphql' \
  -H 'Content-Type: application/json' \
  --data-raw '{"query":"mutation AddBook($title: String!, $authorId: ID!) {\n  addBook(title: $title, authorId: $authorId) {\n    id\n    title\n    author {\n      name\n    }\n  }\n}","variables":{"title":"Carmilla","authorId":"a5"},"operationName":"AddBook"}'

Response examples

Folder

gRPC#

echo.v1.EchoService on playground.tetiva.app:443 with TLS and server reflection, so clients find the methods without a .proto file.

Reflection

grpcurl playground.tetiva.app:443 list
grpcurl playground.tetiva.app:443 describe echo.v1.EchoService

Streams. ServerStream and Chat stream, so they are not in this collection. Run them with grpcurl:

grpcurl -d '{"text":"ping","count":3,"interval_ms":500}' playground.tetiva.app:443 echo.v1.EchoService/ServerStream
grpcurl -d @ playground.tetiva.app:443 echo.v1.EchoService/Chat <<'EOF'
{"text":"hello"}
{"text":"still there?"}
EOF

gRPC

Echo (unary)#

gRPCgrpcs://playground.tetiva.app

echo.v1.EchoService / Echo

Returns your text with seq, server_time and the request metadata as the server saw it.

Message

{
  "text": "ping"
}
grpcurl -d '{
  "text": "ping"
}' \
  'playground.tetiva.app:443' \
  'echo.v1.EchoService/Echo'

Response examples

Folder

WebSocket#

Text and binary frames up to 64 KB. /ws closes after 60 seconds without a message, with 1000 Normal Closure; every session ends after 10 minutes.

WebSocket

Echo over WebSocket#

WebSocketwss://playground.tetiva.app/ws

Every frame you send comes straight back, text or binary, up to 64 KB a frame.

Messages · 1

helloText

hello
printf '%s' 'hello' | websocat 'wss://playground.tetiva.app/ws'

WebSocket

Ticker#

WebSocketwss://playground.tetiva.app/ws/ticker

Pushes {"tick": n, "at": …} every second until you disconnect. Nothing to send.

websocat 'wss://playground.tetiva.app/ws/ticker'