/countries
List Countries
LIVE
Mengambil daftar seluruh negara yang tersedia. Gunakan country_id sebagai referensi pada endpoint lain.
| Header | Value | Wajib |
|---|---|---|
Authorization | Bearer YOUR_API_KEY | Ya |
curl -X GET "https://zakzznokos.my.id/api/v1/countries" \ -H "Authorization: Bearer YOUR_API_KEY"
const res = await fetch("https://zakzznokos.my.id/api/v1/countries", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_KEY"
}
});
const data = await res.json();
console.log(data);
import axios from "axios";
const { data } = await axios({
method: "GET",
url: "https://zakzznokos.my.id/api/v1/countries",
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
});
console.log(data);
<?php
$ch = curl_init("https://zakzznokos.my.id/api/v1/countries");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY"
]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
{
"success": true,
"message": "Countries retrieved successfully",
"data": [
{
"country_id": 6,
"country_name": "Indonesia"
},
{
"country_id": 7,
"country_name": "Malaysia"
}
]
}
{
"success": false,
"message": "Error",
"error": {
"code": 401,
"details": "API Key tidak valid atau tidak disertakan"
}
}