Kişi ekleyin
Bir kişiyi elle kişi defterine kaydedin ve zaten defterde olması durumunu ele alın.
create_contact, kişi defterine elle girilen yoldur ve panonun kendi "kişi ekle" formunun arkasındaki
aynı yoldur: bir ad ve bir e-posta, yanında telefon ve şirket. Defter e-postaya göre anahtarlanır.
Bu yüzden zaten var olan birini göndermek hata değildir: elinizdeki kişiyi belirten normal bir başarı
olarak döner.
Yöntem
Create Contact
Adds a person to the contact book by hand, from typed details rather than from a received message. Takes only the fields a contact has, name, email, phone, company, job title and its kind (personal or business, which then needs no model to classify it), and ignores anything else the caller happens to hold, such as a shipping address. The email is the book's key, so it is required and a repeat of one already filed returns the existing contact instead of a second copy.
Anlatım
Bir kişinin sahip olduğu dört alanı gönderin
create_contact yalnızca name ve email alanlarını zorunlu tutar. Atlarsanız source varsayılan
olarak manual, context ise Added by hand olur. İkisi de kişinin kendi etkinlik geçmişinde gösterilir.
Yanıt
existed: true yinelenen yoldur: e-posta zaten defterdeydi ve contact_id, yeni bir kişiyi değil o
e-postaya zaten sahip olan kişiyi belirtir. İki durumu ayırmak için code değerine değil existed
değerine göre dallanın, ikisi de code: 1 olarak döner.
phone ve company kişide saklanır ama bu yanıtta yansıtılmaz. Neyin kaydedildiğini doğrulamanız
gerekirse get_contacts veya get_contact_members ile geri okuyun.