๐จ๐ฑ ์น ๋ โ ์ฐจ๋ ์ ๋ณด
์น ๋ ์ฐจ๋ ๊ฒ์ฆ ์๋น์ค๋ ์ฐจ๋ ์ ๋ณด์ ๋ํ ์ข ํฉ์ ์ธ ๊ฒ์ฆ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค. ๋ณธ ์๋น์ค๋ฅผ ํตํด ์น ๋ ์ ๋ฑ๋ก๋ ์ฐจ๋์ ์์ธ ์ ๋ณด๋ฅผ ์กฐํํ ์ ์์ต๋๋ค.
์ฐจ๋ ์ ๋ณด ์กฐํโ
์๋ํฌ์ธํธโ
https://api.verifik.co/v2/cl/vehicle
๋ฒํธํ(plate, ๊ณต๋ฐฑ์ด๋ ์ ์์)์ผ๋ก ์กฐํํฉ๋๋ค. ์ผ๋ฐ์ ์ผ๋ก ๋ฐํ๋๋ ํ๋์๋ ์ ์กฐ์ฌ, ๋ชจ๋ธ, ์ฐ์, VIN/์ฐจ๋ ๋ฒํธ, ์์ง, ์์, ์ฐจ๋ ์ข
๋ฅ, ๊ณผํ๋ฃ ์์ฝ, ๊ทธ๋ฆฌ๊ณ ๋ฑ๊ธฐ์๊ฐ ๋
ธ์ถํ๋ ๊ฒฝ์ฐ ์์ ์ RUT ๊ฐ ํฌํจ๋ฉ๋๋ค. ์ฐจ๋ ์ด์ ์จ๋ณด๋ฉ, ๋ด๋ณด ์ ๊ฒ, ๋ณดํ๊ธ ์ฒญ๊ตฌ ์ํฌํ๋ก์ฐ์ ํ์ฉํ ์ ์์ต๋๋ค.
ํค๋(Headers)โ
| ์ด๋ฆ | ๊ฐ |
|---|---|
| Accept | application/json |
| Authorization | Bearer <token> |
๋งค๊ฐ๋ณ์(Parameters)โ
| ์ด๋ฆ | ํ์ | ํ์ | ์ค๋ช | ์์ |
|---|---|---|---|---|
plate | string | ์ | ์กฐํํ ๋ฒํธํ. ๊ณต๋ฐฑ์ด๋ ์ ์์ด ์ ๋ ฅํฉ๋๋ค. | ABC123 |
์์ฒญ(Request)โ
- Node.js
- JavaScript
- Python
- PHP
- Swift
import axios from "axios";
const { data } = await axios.get("https://api.verifik.co/v2/cl/vehicle", {
params: { plate: "BB985" },
headers: { Accept: "application/json", Authorization: `Bearer ${process.env.VERIFIK_TOKEN}` },
});
console.log(data);
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://api.verifik.co/v2/cl/vehicle',
params: {
plate: 'BB985'
},
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <tu_token>'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
import http.client
conn = http.client.HTTPSConnection("api.verifik.co")
payload = ''
headers = {
"Accept": "application/json",
"Authorization": "Bearer <tu_token>",
}
conn.request("GET", "/v2/cl/vehicle?plate=BB985", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.verifik.co/v2/cl/vehicle?plate=BB985');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setHeader('Accept', 'application/json');
$request->setHeader('Authorization', 'Bearer <tu_token>');
$request->setConfig(array(
'follow_redirects' => TRUE
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
?>
var request = URLRequest(url: URL(string: "https://api.verifik.co/v2/cl/vehicle?plate=BB985")!,timeoutInterval: Double.infinity)
request.httpMethod = "GET"
request.setValue("application/json", forHTTPHeaderField: "Accept")
request.setValue("Bearer <tu_token>", forHTTPHeaderField: "Authorization")
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
์๋ต(Response)โ
- 200
- 404
- 409
- 500
{
"data": {
"chasisNumber": "ME1KG0447E2066723",
"color": "NEGRO",
"engineNumber": "1ES3032465",
"fines": "NO POSEE MULTAS",
"manufacturer": "NO DISPONIBLE",
"mark": "YAMAHA",
"model": "FZ 16",
"orderTheft": "NO DISPONIBLE",
"origin": "NO DISPONIBLE",
"owner": "",
"plate": "BB985",
"publicTrans": "NO DISPONIBLE",
"revision": "NO DISPONIBLE",
"rut": "26043542-6",
"type": "MOTO",
"typeTransPub": "NO DISPONIBLE",
"year": "2014"
},
"signature": {
"dateTime": "April 21, 2023 8:32 PM",
"message": "Certified by Verifik.co"
}
}
{
"code": "NotFound",
"message": "Record not found."
}
{
"code": "MissingParameter",
"message": "missing plate\n"
}
{
"code": "InternalServerError",
"message": "Server error."
}
์ฃผ์ ๊ธฐ๋ฅโ
์ฐจ๋ ์ ๋ณด ์กฐํโ
- ์ฐจ๋ ๋ฑ๋ก: ์น ๋ ๋ด ์ฐจ๋ ๋ฑ๋ก์ ๊ฒ์ฆํฉ๋๋ค.
- ๊ธฐ์ ์ฌ์: ์ฐจ๋ ๋ฒํธ, ์์ง ๋ฒํธ, ์ ์กฐ์ฌ, ๋ชจ๋ธ ์ ๋ณด๋ฅผ ์ ๊ณตํฉ๋๋ค.
- ์ฐจ๋ ์์ธ ์ ๋ณด: ์ฐ์, ์์, ์ข ๋ฅ ์ ๋ณด๋ฅผ ์กฐํํ ์ ์์ต๋๋ค.
- ์์ ์ ์ ๋ณด: ์ฐจ๋ ์์ ์์ RUT ๋ฐ ์์ธ ์ ๋ณด๋ฅผ ์กฐํํฉ๋๋ค.
- ๊ณผํ๋ฃ ์ํ: ์ฐจ๋๊ณผ ์ฐ๊ด๋ ๋ฏธ๋ฉ ๊ณผํ๋ฃ ์ฌ๋ถ๋ฅผ ํ์ธํฉ๋๋ค.
- ๋๋ ์ํ: ์ฐจ๋์ ๋๋ ์ ๊ณ ๊ฐ ์๋์ง ํ์ธํฉ๋๋ค.
- ๋์ค๊ตํต ๋ถ๋ฅ: ๋์ค๊ตํต ๋ถ๋ฅ๋ฅผ ์ ๊ฒํฉ๋๋ค.
์ผ๋ฐ ๊ธฐ๋ฅโ
- ๋ค์ํ ํ๋ก๊ทธ๋๋ฐ ์ธ์ด ์ง์: JavaScript, Python, PHP, Swift ์์ ๋ฅผ ์ ๊ณตํฉ๋๋ค.
- ์ค์๊ฐ ๋ฐ์ดํฐ: ์ต์ ์ ๋ณด๋ฅผ ์กฐํํ ์ ์์ต๋๋ค.
- ์ข ํฉ ์ค๋ฅ ์ฒ๋ฆฌ: ๋ค์ํ ์๋๋ฆฌ์ค์ ๋ํ ์์ธํ ์ค๋ฅ ์๋ต์ ์ ๊ณตํฉ๋๋ค.
- ๊ตฌ์กฐํ๋ ์๋ต: ์๋ช ๊ฒ์ฆ์ ํฌํจํ ์ ์ ๋ฆฌ๋ JSON ์๋ต์ ์ ๊ณตํฉ๋๋ค.
- ์น ๋ ๋ฑ๊ธฐ์ ์ฐ๋: ๊ณต์ ์น ๋ ์ฐจ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ง์ ์ ๊ทผํฉ๋๋ค.