Müşteri Notları
Müşteri kaydına iliştirilen dahili notları okuyan, ekleyen, güncelleyen ve silen dört uç.
Genel Bakış
Notlar müşteri kaydına iliştirilen dahili yazılardır. Müşteri onları hiçbir ekranda görmez; yalnız panelde çalışan yöneticiler okur.
Bir not sabitlenebilir. Sabitlenmiş notlar listenin başında durur, gerisi yeniden eskiye sıralanır.
Referans
Notları Listeleme
Müşterinin notlarını döndürür. Sıra sabittir: önce sabitlenmiş notlar, sonra en yeniden eskiye.
null.curl 'https://panel.ornek.com/api/v1/admin/clients/42/notes' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/42/notes', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/42/notes');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->GetClientNotes(['id' => 42]);
foreach ($response['data'] as $note) {
if ($note['pinned']) {
$highlight[] = $note['content'];
}
}Not Ekleme
Müşteriye not ekler. Notu ekleyen olarak isteği yapan anahtarın sahibi kaydedilir.
false.201 ile döner. Liste şemasıyla aynıdır.curl -X POST 'https://panel.ornek.com/api/v1/admin/clients/42/notes' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"content":"Odeme gecmisi temiz, oncelikli musteri","pinned":true}'const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/42/notes', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({"content":"Odeme gecmisi temiz, oncelikli musteri","pinned":true}),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/42/notes');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'content' => 'Odeme gecmisi temiz, oncelikli musteri',
'pinned' => true,
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->CreateClientNote([
'id' => 42,
'content' => 'Odeme gecmisi temiz, oncelikli musteri',
'pinned' => true,
]);Not Güncelleme
Notun metnini ya da sabitleme durumunu değiştirir. En az bir alan göndermeniz gerekir.
curl -X PATCH 'https://panel.ornek.com/api/v1/admin/clients/42/notes/a1b2c3' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"pinned":false}'const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/42/notes/a1b2c3', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ pinned: false }),
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/42/notes/a1b2c3');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['pinned' => false]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// Sabitlemeyi kaldırmak da bu uçtandır; ayrı bir aksiyon yok.
$response = Api::Clients()->UpdateClientNote([
'id' => 42,
'note_id' => 'a1b2c3',
'pinned' => false,
]);Not Silme
Notu siler.
curl -X DELETE 'https://panel.ornek.com/api/v1/admin/clients/42/notes/a1b2c3' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.ornek.com/api/v1/admin/clients/42/notes/a1b2c3', {
method: 'DELETE',
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.ornek.com/api/v1/admin/clients/42/notes/a1b2c3');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->DeleteClientNote([
'id' => 42,
'note_id' => 'a1b2c3',
]);Tuzaklar
Diğer kaynakların aksine id burada karakter dizisi (a1b2c3). Sayıya çevirmeye çalışan kod kaydı bulamaz.
Panelde sabitleme ayrı bir işlem gibi görünür, API'de ise pinned yalnızca bir alan; güncelleme ucundan geçer.
İlgili Makaleler
Geri bildiriminiz için teşekkürler!
Yukarıda bulamadığınız her şey için destek ekibimiz her zaman yanınızda.