Metot, projede yeni bir abone oluşturmak için tasarlanmıştır. Veriler application/json formatında iletilir.
HTTP isteği
- URL:
https://sender-solutions.com/api/subscribers/create-subscriber/ - HTTP metodu: POST
- Content-Type:
application/json
İsteğin gövdesi (JSON)
{
"Subscriber": {
"Base": {
"Id": 0,
"Name": "Test Users"
},
"IsActive": true,
"Email": "username@example.com",
"FirstName": "Cat",
"LastName": "Catstone",
"Gender": "male",
"Phone": "+380111222333",
"Tags": ["api", "test-user"],
"ClientUserId": "ClientUserId3",
"CustomField1": "CustomValue1",
"CustomField2": "CustomValue2",
"CustomField3": "CustomValue3",
"Address": {
"Country": "UA",
"City": "Odesa",
"State": null,
"Zip": 65000,
"Line1": "Very Long street",
"Line2": "building 42",
"Line3": null
},
"Birthday": "2002-04-15"
}
} cURL kullanılarak istek örneği
curl --location 'https://sender-solutions.com/api/subscribers/create-subscriber/' \
--header 'Content-Type: application/json' \
--header 'Authorization: {{api-token}}' \
--data-raw '{
"Subscriber": {
"Base": {
"Id": 0,
"Name": "Test Users"
},
"IsActive": true,
"Email": "username@example.com",
"FirstName": "Cat",
"LastName": "Catstone",
"Gender": "male",
"Phone": "+380111222333",
"Tags": ["api", "test-user"],
"ClientUserId": "ClientUserId12345",
"CustomField1": "CustomValue1",
"CustomField2": "CustomValue2",
"CustomField3": "CustomValue3",
"Address": {
"Country": "UA",
"City": "Odesa",
"State": null,
"Zip": 65000,
"Line1": "Very Long street",
"Line2": "building 42",
"Line3": null
},
"Birthday": "2002-04-15"
}
}'
Alanların açıklaması
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
Subscriber.Base.Id | number | Abone tabanının tanımlayıcısı. Bu alan veya Subscriber.Base.Name zorunlu olarak belirtilmelidir. Her iki alana da boş olmayan değerler iletilirse, öncelik Subscriber.Base.Id'ye verilir. | |
Subscriber.Base.Name | string | Abone tabanının adı. Bu alan veya Subscriber.Base.Id zorunlu olarak belirtilmelidir. Her iki alana da boş olmayan değerler iletilirse, öncelik Subscriber.Base.Id'ye verilir. | |
Subscriber.IsActive | boolean | Abonenin etkinlik bayrağı. Varsayılan olarak false. | |
Subscriber.Email | string | Abonenin Email'i | |
Subscriber.FirstName | string | Ad | |
Subscriber.LastName | string | Soyad | |
Subscriber.Gender | string | Abonenin cinsiyeti. Olası değerler: "male" — erkek, "female" — kadın, "" (boş dize) — «Belirtilmemiş». Varsayılan olarak — «Belirtilmemiş». | |
Subscriber.Phone | string | Telefon numarası | |
Subscriber.Tags | array[string] | Abonenin etiketleri, dize dizisi | |
Subscriber.ClientUserId | string | Müşterinin sistemindeki abone ID'si | |
Subscriber.CustomField1 | string | Özel alan 1. Kendi takdirinize göre herhangi bir bilgiyle doldurun. | |
Subscriber.CustomField2 | string | Özel alan 2. Kendi takdirinize göre herhangi bir bilgiyle doldurun. | |
Subscriber.CustomField3 | string | Özel alan 3. Kendi takdirinize göre herhangi bir bilgiyle doldurun. | |
Subscriber.Address.Country | string | İki karakterli ülke kodu (ISO 3166-1 alpha-2) | |
Subscriber.Address.City | string | Şehir | |
Subscriber.Address.State | string | null | Bölge / eyalet / il | |
Subscriber.Address.Zip | number | Posta kodu | |
Subscriber.Address.Line1 | string | Adresin ana satırı | |
Subscriber.Address.Line2 | string | Adresin ek satırı | |
Subscriber.Address.Line3 | string | null | Adresin ek satırı | |
Subscriber.Birthday | string (YYYY-MM-DD) | YYYY-MM-DD formatında doğum tarihi |
Başarılı yanıt örneği. Oluşturulan abonenin verilerini API isteğiyle aynı yapıda içerir. Ayrıca ek bir alan içerir Subscriber.Id — oluşturulan abonenin tanımlayıcısı.
{
"success": true,
"Subscriber": {
"Id": 24,
"Base": {
"Id": 13,
"Name": "Test Users"
},
"IsActive": true,
"Email": "username@example.com",
"FirstName": "Cat",
"LastName": "Catstone",
"Gender": "male",
"Phone": "+380111222333",
"Tags": [
"api",
"test-user"
],
"ClientUserId": "ClientUserId12345",
"CustomField1": "CustomValue1",
"CustomField2": "CustomValue2",
"CustomField3": "CustomValue3",
"Address": {
"Country": "UA",
"City": "Odesa",
"State": "",
"Zip": "65000",
"Line1": "Very Long street",
"Line2": "building 42",
"Line3": ""
},
"Birthday": "2002-04-15"
}
}