---
title: Add an item.
slug: mihai-tests/add-an-item
createdAt: 2024-05-09T12:33:29.707Z
---

{
  "id": "OsOyphgpreSnUspSYK3Vj",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.example.com/v1/item",
    "servers": [
      {
        "url": "https://api.example.com/v1/item",
        "description": "Optional server description, e.g. Main (production) server"
      }
    ],
    "name": "Add an item.",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "undefined",
          "schema": [],
          "complexItems": [
            {
              "name": "object",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "integer",
                  "example": 123456789
                },
                {
                  "name": "title",
                  "kind": "optional",
                  "type": "string",
                  "example": "Item title"
                }
              ],
              "modelRef": "#/components/schemas/item1",
              "customType": "item1"
            },
            {
              "name": "object",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "integer",
                  "example": 123456789
                },
                {
                  "name": "title",
                  "kind": "optional",
                  "type": "string",
                  "example": "Item title"
                },
                {
                  "name": "description",
                  "kind": "optional",
                  "type": "string",
                  "example": "Item description"
                },
                {
                  "name": "type",
                  "kind": "optional",
                  "type": "string<primary | secondary>",
                  "example": ""
                }
              ],
              "modelRef": "#/components/schemas/item2",
              "customType": "item2"
            }
          ],
          "complexType": "oneOf",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "FcvrqYDdz4WftXE8spcfx",
          "language": "curl",
          "label": "cURL",
          "code": "curl --location 'https://api.example.com/v1/item' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '\"\"'"
        },
        {
          "id": "5AVnIXNW31M4JvcGm_sYD",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify(\"\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.example.com/v1/item\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "QLtr_sAxunRLeUNWwueOR",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.example.com/v1/item\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = JSON.dump(\"\")\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "xVT3RDHyzog_SdWdO7ZP8",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.example.com/v1/item\"\n\npayload = json.dumps(\"\")\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "FcvrqYDdz4WftXE8spcfx"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}