İçeriğe geç

Geliştirici Anahtarını Güncelle

PUT /v1/tokens/0/0

Kullanıcıya özel oluşturulan API anahtarının geçerlilik durumunu veya IP kısıtlamalarını günceller.

ParametreKonumTipAçıklamaVarsayılanÖrnek
Authorization * headerstringBearer Yetkilendirme Tokeni (Örn: Bearer eyJhb...)-Bearer <TOKEN>
USER_ID * pathstringİşlem yapan kullanıcının kimlik (ID) değeri. UUID formatındadır.--
Alan Tip Açıklama
types array
title string Kullanıcının anlayacağı adres başlığı (Örn: 'Evim', 'Merkez Depo')
active boolean
blocked boolean
{
"types":[
"access_token"
],
"title":"accessToken",
//"expire":"10", // => not yet ready
"active":true,
"blocked":false // => for admin role
//"others":{
// => get others
//}
}
fetch('https://api.kargomucuz.com/v1/tokens/0/0', {
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));
500: Sunucu Hatası
{
"error": "fetch failed"
}
504: Gateway Timeout