์ฝ๋กฌ๋น์ ๊ฒฝ์ฐฐ ๋ฒ์ฃ ๊ฒฝ๋ ฅ ์กฐํ
API ๋ ํผ๋ฐ์คโ
Endpointโ
https://api.verifik.co/v2/co/policia/consultar
์ฝ๋กฌ๋น์ ๊ฒฝ์ฐฐ ๋ฒ์ฃ ๊ฒฝ๋ ฅ ์กฐํ๋ ํ๋ฒ ์ 248์กฐ์ ๋ฐ๋ผ ์ฌ๋ฒ ๋น๊ตญ๊ณผ ๋ฏธ๊ฒฐ ์ฌํญ์ด ์๋์ง๋ฅผ ํ์ธํฉ๋๋ค. documentType ๊ณผ documentNumber ๋ฅผ GET(์ฟผ๋ฆฌ) ๋๋ POST(JSON ๋ณธ๋ฌธ)์ผ๋ก ๋ณด๋
๋๋ค. ์ฑ๊ณต ์ data์๋ documentType, documentNumber, firstName, lastName, fullName, arrayName, details๊ฐ ํฌํจ๋ฉ๋๋ค. ์ฑ์ฉ, ์จ๋ณด๋ฉ, ์ค์ฌ ๋ฐฐ๊ฒฝ ์กฐํ์ ์ฌ์ฉํฉ๋๋ค.
ํค๋(Headers)โ
| ์ด๋ฆ | ๊ฐ |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
๋งค๊ฐ๋ณ์(Parameters)โ
info
์ง์๋๋ ๋ฌธ์ ์ข ๋ฅ์ ์ ์ฒด ๋ชฉ๋ก๊ณผ ๊ฐ ์ข ๋ฅ๋ณ ํ์ ๋งค๊ฐ๋ณ์๋ Document Types ๊ฐ์ด๋๋ฅผ ์ฐธ๊ณ ํด ์ฃผ์ธ์.
| ์ด๋ฆ | ํ์ | ํ์ | ์ค๋ช |
|---|---|---|---|
documentType | string | ์ | ๋ฌธ์ ์ข ๋ฅ. ํ์ฉ ๊ฐ: CC, CE, PPT, PA, DP. DP๋ Documento Diplomรกtico(์ธ๊ต ๋ฌธ์)์ ๋๋ค. PPT๋ ํ์ฉ๋๋ฉฐ, ๊ฒฝ์ฐฐ ํฌํธ์์ ์ฌ๊ถ์ฒ๋ผ ๋งคํ๋ฉ๋๋ค. |
documentNumber | string | ์ | ์กฐํ ๋์์์ ๋ฌธ์ ๋ฒํธ. ๊ณต๋ฐฑ์ด๋ ์ ์์ด ์ ๋ ฅํฉ๋๋ค. |
์ด ์๋ํฌ์ธํธ๋ date ๋งค๊ฐ๋ณ์๋ฅผ ๋ฐ์ง ์์ต๋๋ค(RNMC์ ๋ค๋ฆ).
์์ฒญ(Request)โ
- JavaScript
- Python
- Swift
- PHP
import axios from "axios";
const options = {
method: "GET",
url: "https://api.verifik.co/v2/co/policia/consultar",
params: { documentType: "CC", documentNumber: "1032386359" },
headers: {
Accept: "application/json",
Authorization: "Bearer <your_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 = {}
conn.request("GET", "/v2/co/policia/consultar?documentType=CC&documentNumber=1032386359", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var request = URLRequest(url: URL(string: "https://api.verifik.co/v2/co/policia/consultar?documentType=CC&documentNumber=1032386359")!,timeoutInterval: Double.infinity)
request.httpMethod = "GET"
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()
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.verifik.co/v2/co/policia/consultar?documentType=CC&documentNumber=1032386359');
$request->setMethod(HTTP_Request2::METHOD_GET);
$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();
}
์๋ต(Response)โ
- 200
- 404
- 409 (๋๋ฝ๋ ๋งค๊ฐ๋ณ์)
- 409 (์๋ชป๋ ๋ฌธ์ ์ข ๋ฅ)
- 409 (์ ์คํธ๋ฆผ ๋ถ๊ฐ)
{
"data": {
"documentType": "CC",
"documentNumber": "1032386359",
"firstName": "LILIA MANUELA",
"lastName": "LESPORT FERNANDEZ",
"fullName": "LILIA MANUELA LESPORT FERNANDEZ",
"arrayName": ["LILIA", "MANUELA", "LESPORT", "FERNANDEZ"],
"details": "NO TIENE ASUNTOS PENDIENTES CON LAS AUTORIDADES JUDICIALES de conformidad con lo establecido en el artรญculo 248 de la Constituciรณn Polรญtica de Colombia."
},
"signature": {
"dateTime": "March 13, 2024 10:48 PM",
"message": "Certified by Verifik.co"
},
"id": "7QS69"
}
{
"code": "NotFound",
"message": "Record not found."
}
{
"code": "MissingParameter",
"message": "missing documentType\n. missing documentNumber\n"
}
{
"code": "MissingParameter",
"message": "documentType must be one of: [CC,CE,PPT,PA,DP]"
}
{
"code": "Endpoint_out_of_service",
"message": "Endpoint_out_of_service"
}
์ฐธ๊ณ (Notes)โ
- GET๊ณผ POST๋ฅผ ๋ชจ๋ ์ง์ํฉ๋๋ค. POST๋ ๋์ผํ ํ๋๋ฅผ JSON ๋ณธ๋ฌธ์ผ๋ก ๋ณด๋ ๋๋ค.
- ๊ฒฝ์ฐฐ ํฌํธ์ ์ฑ(apellidos) ๋ค์ ์ด๋ฆ(nombres) ์์ผ๋ก ํ์ํฉ๋๋ค. Verifik๋ ์ด๋ฆ์ ๋จผ์ ๋ฐํํฉ๋๋ค:
firstNameLILIA MANUELA,lastNameLESPORT FERNANDEZ,fullNameLILIA MANUELA LESPORT FERNANDEZ,arrayName์ ์ด๋ฆ ๋ค์ ์ฑ์ ๋๋ค. - ํ๋ก๋์
data.details๋ NO TIENE / REGISTRA ASUNTOS ๋ฌธ์ฅ๋ง ํฌํจํฉ๋๋ค. ํ๋ฒ ์ค๋ช ๋ฌธ๊ตฌ๋ ์ ๊ฑฐ๋ฉ๋๋ค. - ์๋๋ฐ์ค๋
legend๋ฅผ ํฌํจํ ์ ์์ต๋๋ค.legend๋ฅผ ํ๋ก๋์ ๋ณด์ฅ ํ๋๋ก ์ทจ๊ธํ์ง ๋ง์ธ์. - ํ์ฉ
documentType์ CC, CE, PPT, PA, DP(Documento Diplomรกtico)์ ๋๋ค. PPT๋ ํ์ฉ๋๋ฉฐ ํฌํธ์์ ์ฌ๊ถ์ฒ๋ผ ๋งคํ๋ฉ๋๋ค. - ์ด ๊ฒฝ๋ก๋ ๋ฐ๊ธ
date๊ฐ ํ์ ์์ต๋๋ค(RNMC๋ ํ์). - ์ผ์์ ์ธ ์
์คํธ๋ฆผ ๋๋ captcha ์คํจ๋ 409์
Endpoint_out_of_service๋๋captcha_failed๋ฅผ ๋ฐํํฉ๋๋ค. - ๋ฏธ์ดํ ์์ ์กฐ์น๋ ์ฝ๋กฌ๋น์ โ RNMC ์์ ์กฐ์น (
GET /v2/co/policia/rnmc)๋ฅผ ์ฌ์ฉํ์ธ์.