POST /rest/req_vehicle_inspection
curl --request POST 'https://apick.app/rest/req_vehicle_inspection' \
--header "Authorization: Bearer $APICK_API_KEY" \
--form-string 'name=홍길동' \
--form-string 'birthDate=19900101' \
--form-string 'phone=01011112222' \
--form-string 'authProvider=kakao' \
--form-string 'carNumber=HRD-0000-0000' \
--form-string 'rrn=1234567890'const form = new FormData();
form.append("name", "홍길동");
form.append("birthDate", "19900101");
form.append("phone", "01011112222");
form.append("authProvider", "kakao");
form.append("carNumber", "HRD-0000-0000");
form.append("rrn", "1234567890");
const response = await fetch("https://apick.app/rest/req_vehicle_inspection", {
method: "POST",
headers: { Authorization: "Bearer " + process.env.APICK_API_KEY },
body: form,
});
const type = response.headers.get("content-type") || "";
if (!response.ok) throw new Error(await response.text());
if (type.includes("json")) {
const result = await response.json();
if (result.error || result.data?.error || result.api?.success === false) throw new Error(JSON.stringify(result));
console.log(result);
} else if (type.includes("event-stream")) {
const decoder = new TextDecoder();
for await (const chunk of response.body) process.stdout.write(decoder.decode(chunk, { stream: true }));
} else {
const { writeFile } = await import("node:fs/promises");
await writeFile("result.bin", new Uint8Array(await response.arrayBuffer()));
}import os
import requests
parts = [
("name", (None, "홍길동")),
("birthDate", (None, "19900101")),
("phone", (None, "01011112222")),
("authProvider", (None, "kakao")),
("carNumber", (None, "HRD-0000-0000")),
("rrn", (None, "1234567890")),
]
response = requests.request("POST", "https://apick.app/rest/req_vehicle_inspection",
headers={"Authorization": "Bearer " + os.environ["APICK_API_KEY"]}, files=parts, timeout=120, stream=True)
response.raise_for_status()
content_type = response.headers.get("Content-Type", "")
if "json" in content_type:
result = response.json()
if result.get("error") or result.get("data", {}).get("error"):
raise RuntimeError(result)
print(result)
elif "event-stream" in content_type:
for line in response.iter_lines(decode_unicode=True):
print(line)
else:
with open("result.bin", "wb") as output:
for chunk in response.iter_content(65536):
output.write(chunk)<?php
$headers = ["Authorization: Bearer " . getenv("APICK_API_KEY")];
$boundary = "apick-" . bin2hex(random_bytes(12));
$headers[] = "Content-Type: multipart/form-data; boundary=" . $boundary;
$body = "";
$body .= "--" . $boundary . "\r\n" . 'Content-Disposition: form-data; name="name"' . "\r\n" . "\r\n";
$body .= '홍길동' . "\r\n";
$body .= "--" . $boundary . "\r\n" . 'Content-Disposition: form-data; name="birthDate"' . "\r\n" . "\r\n";
$body .= '19900101' . "\r\n";
$body .= "--" . $boundary . "\r\n" . 'Content-Disposition: form-data; name="phone"' . "\r\n" . "\r\n";
$body .= '01011112222' . "\r\n";
$body .= "--" . $boundary . "\r\n" . 'Content-Disposition: form-data; name="authProvider"' . "\r\n" . "\r\n";
$body .= 'kakao' . "\r\n";
$body .= "--" . $boundary . "\r\n" . 'Content-Disposition: form-data; name="carNumber"' . "\r\n" . "\r\n";
$body .= 'HRD-0000-0000' . "\r\n";
$body .= "--" . $boundary . "\r\n" . 'Content-Disposition: form-data; name="rrn"' . "\r\n" . "\r\n";
$body .= '1234567890' . "\r\n";
$body .= "--" . $boundary . "--\r\n";
$curl = curl_init('https://apick.app/rest/req_vehicle_inspection');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $body,
]);
$result = curl_exec($curl);
if ($result === false) { throw new RuntimeException(curl_error($curl)); }
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$contentType = curl_getinfo($curl, CURLINFO_CONTENT_TYPE) ?: "";
curl_close($curl);
if ($status >= 400) { throw new RuntimeException($result); }
$data = strpos($contentType, "json") !== false ? json_decode($result, true) : $result;