ID でペットを検索する
一意の ID を使用してペットを検索します。
GET https://petstore3.swagger.io/api/v3/pet/{petId}
例
- 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>"
レスポンス
| コード | 説明 |
|---|---|
| 200 | 操作成功 |
| 400 | 指定された ID が無効です |
| 404 | ペットが見つかりません |
| default | 予期せぬエラー |
レスポンス例
200: 操作成功
Response
{
"id": 210,
"name": "Krypto",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"文字列"
],
"tags": [
{
"id": 0,
"name": "文字列"
}
],
"status": "available"
}
パラメータ
パスパラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
petId | 整数 | 取得するペットの ID |