Ülkeleri Listele
Açıklama
Section titled “Açıklama” GET
/others/countries Sistemin desteklediği uluslararası ülke kodlarını ve isimlerini listeler.
Parametreler
Section titled “Parametreler”| Parametre | Konum | Tip | Açıklama | Varsayılan | Örnek |
|---|---|---|---|---|---|
| Authorization * | header | string | Bearer Yetkilendirme Tokeni (Örn: Bearer eyJhb...) | - | Bearer <TOKEN> |
| geonameId | query | string | Uluslararası veritabanlarına kayıtlı coğrafi bölge (ülke/şehir) ID'si. | - | 298795 |
Örnek Kod
Section titled “Örnek Kod”fetch('https://api.kargomucuz.com/others/countries', { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <YOUR_TOKEN>' }}).then(response => response.json()).then(data => console.log(data));$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.kargomucuz.com/others/countries');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$headers = array();$headers[] = 'Content-Type: application/json';$headers[] = 'Authorization: Bearer <YOUR_TOKEN>';curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);if (curl_errno($ch)) { echo 'Error:' . curl_error($ch);}curl_close($ch);echo $result;Yanıtlar
Section titled “Yanıtlar”200: Başarılı kimlik doğrulaması sonrası dönen yanıt.
{ "status": true, "message": "Ülkeler getirildi.", "payload": { "data": [ { "continent": "AS", "capital": "Ankara", "languages": "tr-TR,ku,diq,az,av", "geonameId": 298795, "south": 35.8121761290001, "isoAlpha3": "TUR", "north": 42.104895001, "fipsCode": "TU", "population": "82319724", "east": 44.81812800000006, "isoNumeric": "792", "areaInSqKm": "780580.0", "countryCode": "TR", "west": 25.6665057269225, "countryName": "Türkiye", "postalCodeFormat": "#####", "continentName": "Asia", "currencyCode": "TRY" } ], "totalCount": 250 }, "code": 500}