Zum Inhalt springen
Auf dieser Seite

Add a new pet to the store.

Add a new pet to the store.

POST/petAdd a new pet to the store.
curl -X POST 'https://petstore3.swagger.io/api/v3/pet' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}'
Beispielantwort · 200
{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}

#Authentifizierung

petstore_authwrite:petsread:pets

#Anfrage-Body erforderlich

Create a new pet in the store

application/json application/xml application/x-www-form-urlencoded · Typ: Pet

idinteger (int64)
namestringerforderlich
categoryCategory
photoUrlsarray of stringerforderlich
tagsarray of Tag
statusstring

pet status in the store

Erlaubte Werte: "available", "pending", "sold"

{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}

#Antworten

Successful operation

application/json application/xml · Typ: Pet

idinteger (int64)
namestringerforderlich
categoryCategory
photoUrlsarray of stringerforderlich
tagsarray of Tag
statusstring

pet status in the store

Erlaubte Werte: "available", "pending", "sold"

{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}