๋ฉ์์ฝ
์๋ํฌ์ธํธโ
https://api.verifik.co/v2/mx/vehiculo/placa
์ฐจ๋ ์ ๋ณด ์๋น์ค๋ ๋ฒํธํ์ ๊ธฐ๋ฐ์ผ๋ก ๋ฉ์์ฝ ๋ด ์ฐจ๋์ ์์ธ ์ ๋ณด๋ฅผ ์ ๊ณตํฉ๋๋ค. ๋ณธ ์๋น์ค๋ ์ฐจ๋์ ์ ์กฐ์ฌ, ๋ชจ๋ธ, ์ฐ์, VIN ๋ฐ ๊ธฐํ ๊ด๋ จ ์์ธ ์ ๋ณด๋ฅผ ๋ฐํํฉ๋๋ค. ๋ฒํธํ์ GET ์์ฒญ์ plate ์ฟผ๋ฆฌ ๋งค๊ฐ๋ณ์๋ก ์ ๋ฌํ๋ฉด, ์ผ์นํ๋ ํญ๋ชฉ์ด ์์ ๊ฒฝ์ฐ ๋ฑ๋ก ๊ด๋ จ ํ๋๊ฐ ์๋ต์ ํฌํจ๋ฉ๋๋ค.
ํค๋(Headers)โ
| ์ด๋ฆ | ๊ฐ |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
๋งค๊ฐ๋ณ์(Parameters)โ
| ์ด๋ฆ | ํ์ | ํ์ | ์ค๋ช | ์์ |
|---|---|---|---|---|
| plate | String | ์ | ์กฐํํ ์ฐจ๋ ๋ฒํธํ. | ABC1234 |
์์ฒญ(Request)โ
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://api.verifik.co/v2/mx/vehiculo/placa',
params: {plate: 'ABC1234'},
headers: {
Accept: 'application/json',
Authorization: 'Bearer <your_token>'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
์๋ต(Response)โ
{
"success": true,
"data": {
"plate": "ABC1234",
"make": "Nissan",
"model": "Sentra",
"year": "2021",
"engine": "2.0L",
"transmission": "CVT",
"fuelType": "Gasoline",
"vin": "1N4AL3AP8JC123456",
"registrationDate": "10/08/2021",
"status": "active",
"owner": "Carlos Rodrรญguez",
"state": "Jalisco",
"city": "Guadalajara"
}
}
์ค๋ฅ ์๋ตโ
{
"success": false,
"error": "Vehicle not found",
"code": "VEHICLE_NOT_FOUND"
}
ํ์ฉ ์ฌ๋กโ
- ๋ณดํ ๊ฒ์ฆ: ๋ณดํ ๋ชฉ์ ์ ์ฐจ๋ ์์ธ ์ ๋ณด๋ฅผ ๊ฒ์ฆํฉ๋๋ค.
- ์๋์ฐจ ๋๋ฌ: ๋งค๋งค ์ ์ฐจ๋ ์ ๋ณด๋ฅผ ๊ฒ์ฆํฉ๋๋ค.
- ์ฐจ๋ ์ด์ ๊ด๋ฆฌ: ์ฌ๋ด ์ฐจ๋ ์ ๋ณด๋ฅผ ์ถ์ ํฉ๋๋ค.
- ๋ฒ ์งํ: ์ฐจ๋ ๋ฑ๋ก ๋ฐ ์์ ๊ด๊ณ๋ฅผ ๊ฒ์ฆํฉ๋๋ค.
- ์ค์ฌ: ๊ฑฐ๋ ๋ชฉ์ ์ ์ฐจ๋ ์ ๋ณด๋ฅผ ๊ฒ์ฆํฉ๋๋ค.