Kullanıcı Yönetimi Genel bakış
Geliştirici Anahtarını Güncelle
PUT
/v1/tokens/{USER_ID}/676728ed9ee96576437e8f97 Detaylı Açıklama
Section titled “Detaylı Açıklama” PUT
/v1/tokens/{USER_ID}/676728ed9ee96576437e8f97 Kullanıcıya özel oluşturulan API anahtarının geçerlilik durumunu veya IP kısıtlamalarını günceller.
Parametreler
Section titled “Parametreler”| Parametre | Konum | Tip | Açıklama | Varsayılan | Örnek |
|---|---|---|---|---|---|
| Authorization * | header | string | Bearer Yetkilendirme Tokeni (Örn: Bearer eyJhb...) | - | Bearer <TOKEN> |
| USER_ID * | path | string | İşlem yapan kullanıcının kimlik (ID) değeri. UUID formatındadır. | - | - |
İstek Gövdesi
Section titled “İstek Gövdesi”{ "types":[ "access_token" ], "title":"accessToken", //"expire":"10", // => not yet ready "active":true, "blocked":false // => for admin role //"others":{ // => get others //}}Örnek Kod
Section titled “Örnek Kod”fetch('https://api.kargomucuz.com/v1/tokens/{USER_ID}/676728ed9ee96576437e8f97', { method: 'PUT', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <YOUR_TOKEN>' }, body: JSON.stringify({ "types":[ "access_token" ], "title":"accessToken", //"expire":"10", // => not yet ready "active":true, "blocked":false // => for admin role //"others":{ // => get others //} })}).then(response => response.json()).then(data => console.log(data));$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.kargomucuz.com/v1/tokens/{USER_ID}/676728ed9ee96576437e8f97');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
$body = <<<'EOD'{ "types":[ "access_token" ], "title":"accessToken", //"expire":"10", // => not yet ready "active":true, "blocked":false // => for admin role //"others":{ // => get others //}}EOD;curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
$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”500: Sunucu Hatası
{ "error": "fetch failed"}