Rechercher un animal par identifiant
Rechercher un animal de compagnie à l'aide de son identifiant unique.
GET https://petstore3.swagger.io/api/v3/pet/{petId}
Exemples
- API Key
- OAuth 2.0
cURL
GET "https://petstore3.swagger.io/api/v3/pet/210" \
-H "accept: application/json" \
-H "api_key: <YOUR_API_KEY>"
cURL
GET "https://petstore3.swagger.io/api/v3/pet/210" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>"
Réponses
| Code | Description |
|---|---|
| 200 | Opération réussie |
| 400 | Identifiant invalide fourni |
| 404 | Animal introuvable |
| default | Erreur inattendue |
Exemple de réponse
200: Opération réussie
Response
{
"id": 210,
"name": "Krypto",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"chaîne de caractères"
],
"tags": [
{
"id": 0,
"name": "chaîne de caractères"
}
],
"status": "available"
}
Paramètres
Paramètres de chemin
| Nom | Type | Description |
|---|---|---|
petId | entier | Identifiant de l'animal à récupérer |