2. Edycja subskrybenta za pomocą API

Metoda przeznaczona jest do edycji istniejącego subskrybenta w projekcie. Dane przekazywane są w formacie application/json.

Żądanie HTTP
  • URL: https://sender-solutions.com/api/subscribers/edit-subscriber/
  • Metoda HTTP: POST
  • Content-Type: application/json
Treść żądania (JSON)
{
    "Subscriber": {
        "Id": 23,
        "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"
    }
}
Przykład żądania z użyciem cURL

curl --location 'https://sender-solutions.com/api/subscribers/edit-subscriber/' \
--header 'Content-Type: application/json' \
--header 'Authorization: {{api-token}}' \
--data-raw '{
    "Subscriber": {
        "Id": 23,
        "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"
    }
}'
Opis pól
Pole Typ Obowiązkowe Opis
Subscriber.Id number Identyfikator subskrybenta
Subscriber.Base.Id number Identyfikator bazy subskrybentów. Obowiązkowo musi być podane to pole albo Subscriber.Base.Name. Jeśli przekazać niepuste wartości w oba pola, priorytet ma Subscriber.Base.Id
Subscriber.Base.Name string Nazwa bazy subskrybentów. Obowiązkowo musi być podane to pole albo Subscriber.Base.Id. Jeśli przekazać niepuste wartości w oba pola, priorytet ma Subscriber.Base.Id
Subscriber.IsActive boolean Flaga aktywności subskrybenta. Domyślnie false
Subscriber.Email string Email subskrybenta
Subscriber.FirstName string Imię
Subscriber.LastName string Nazwisko
Subscriber.Gender string Płeć subskrybenta. Możliwe wartości: "male" — męska, "female" — żeńska, "" (pusty ciąg znaków) — «Nie podano». Domyślnie — «Nie podano»
Subscriber.Phone string Numer telefonu
Subscriber.Tags array[string] Tagi subskrybenta, tablica ciągów znaków
Subscriber.ClientUserId string ID subskrybenta w systemie klienta
Subscriber.CustomField1 string Pole dowolne 1. Wypełniaj dowolną informacją według własnego uznania.
Subscriber.CustomField2 string Pole dowolne 2. Wypełniaj dowolną informacją według własnego uznania.
Subscriber.CustomField3 string Pole dowolne 3. Wypełniaj dowolną informacją według własnego uznania.
Subscriber.Address.Country string Dwuznakowy kod kraju (ISO 3166-1 alpha-2)
Subscriber.Address.City string Miasto
Subscriber.Address.State string | null Region / stan / obwód
Subscriber.Address.Zip number Kod pocztowy
Subscriber.Address.Line1 string Główny wiersz adresu
Subscriber.Address.Line2 string Dodatkowy wiersz adresu
Subscriber.Address.Line3 string | null Dodatkowy wiersz adresu
Subscriber.Birthday string (YYYY-MM-DD) Data urodzenia w formacie YYYY-MM-DD
Przykład pomyślnej odpowiedzi. Zawiera aktualne dane subskrybenta (po aktualizacji) w tej samej strukturze co w żądaniu API.
{
    "success": true,
    "Subscriber": {
        "Id": 23,
        "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"
    }
}