{
  "info": {
    "name": "SampleAPI",
    "_postman_id": "sampleapi-public-collection",
    "description": "Public sample REST API and HTTP echo service. https://sampleapi.top",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "baseUrl",   "value": "https://sampleapi.top/api" },
    { "key": "demoToken", "value": "demo-token" }
  ],
  "item": [
    {
      "name": "Resources",
      "item": [
        { "name": "List posts",       "request": { "method": "GET",    "header": [], "url": "{{baseUrl}}/posts?_limit=5" } },
        { "name": "Get post #1",      "request": { "method": "GET",    "header": [], "url": "{{baseUrl}}/posts/1" } },
        { "name": "Create post",      "request": { "method": "POST",   "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{\"userId\":1,\"title\":\"Hello\",\"body\":\"World\"}" }, "url": "{{baseUrl}}/posts" } },
        { "name": "Patch post #1",    "request": { "method": "PATCH",  "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{\"title\":\"Updated\"}" }, "url": "{{baseUrl}}/posts/1" } },
        { "name": "Delete post #1",   "request": { "method": "DELETE", "header": [], "url": "{{baseUrl}}/posts/1" } },
        { "name": "Comments for #1",  "request": { "method": "GET",    "header": [], "url": "{{baseUrl}}/posts/1/comments" } },
        { "name": "List users",       "request": { "method": "GET",    "header": [], "url": "{{baseUrl}}/users" } },
        { "name": "User #2 todos",    "request": { "method": "GET",    "header": [], "url": "{{baseUrl}}/users/2/todos" } },
        { "name": "Todos incomplete", "request": { "method": "GET",    "header": [], "url": "{{baseUrl}}/todos?completed=false" } }
      ]
    },
    {
      "name": "Echo",
      "item": [
        { "name": "Echo GET",     "request": { "method": "GET",    "header": [], "url": "{{baseUrl}}/get" } },
        { "name": "Echo POST",    "request": { "method": "POST",   "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{\"hello\":\"world\"}" }, "url": "{{baseUrl}}/post" } },
        { "name": "Echo /anything", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"X-Request-Id","value":"pm-demo"}], "body": { "mode": "raw", "raw": "{\"name\":\"widget\",\"qty\":3}" }, "url": "{{baseUrl}}/anything/widgets" } },
        { "name": "Headers",      "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/headers" } },
        { "name": "IP",           "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/ip" } },
        { "name": "User-Agent",   "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/user-agent" } }
      ]
    },
    {
      "name": "Status & Delay",
      "item": [
        { "name": "Status 200", "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/status/200" } },
        { "name": "Status 404", "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/status/404" } },
        { "name": "Status 418", "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/status/418" } },
        { "name": "Status 503", "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/status/503" } },
        { "name": "Delay 2s",   "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/delay/2" } }
      ]
    },
    {
      "name": "Auth",
      "item": [
        { "name": "Bearer (200)", "request": { "method": "GET", "header": [{"key":"Authorization","value":"Bearer {{demoToken}}"}], "url": "{{baseUrl}}/auth/bearer" } },
        { "name": "Bearer (401)", "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/auth/bearer" } },
        { "name": "Bearer (403)", "request": { "method": "GET", "header": [{"key":"Authorization","value":"Bearer wrong"}], "url": "{{baseUrl}}/auth/bearer" } }
      ]
    },
    {
      "name": "Utilities",
      "item": [
        { "name": "UUID", "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/uuid" } },
        { "name": "Time", "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/time" } },
        { "name": "Root index", "request": { "method": "GET", "header": [], "url": "{{baseUrl}}/" } }
      ]
    },
    {
      "name": "Body-aware",
      "item": [
        { "name": "Hash body (text)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"text/plain"}], "body": { "mode": "raw", "raw": "Hash me, SampleAPI" }, "url": "{{baseUrl}}/hash" } },
        { "name": "Hash body (JSON)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{\"any\":\"bytes\"}" }, "url": "{{baseUrl}}/hash" } },
        { "name": "JSON shape stats", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{\"a\":1,\"b\":[1,2,{\"c\":true,\"d\":null}],\"e\":\"hi\"}" }, "url": "{{baseUrl}}/json-stats" } },
        { "name": "Validate post (valid)",   "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{\"userId\":1,\"title\":\"Hello\",\"body\":\"World\"}" }, "url": "{{baseUrl}}/validate/post" } },
        { "name": "Validate post (invalid)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{\"title\":\"\"}" }, "url": "{{baseUrl}}/validate/post" } }
      ]
    }
  ]
}
