Thulium REST API

Agenci

HTTP Zasób Opis
GET agents Zwraca listę agentów.
GET agents/:login Zwraca informacje o agencie.
GET agents/:login/last_queue_call Zwraca ostatnią rozmowę z kolejki.
GET agents/:login/status Zwraca status agenta.
GET agents_groups Zwraca grupy agentów.
GET agents_statuses Zwraca statusy agentów.
GET agents_work_report Zwraca raport pracy agentów.
POST agents Dodanie agenta.
POST agents/:login/answer Odbiera telefon agenta jeśli korzysta on z Thulium Softphone.
POST agents/:login/call Zestawia połączenie dla agenta na podany numer.
POST agents/:login/call_preview Dzwoni w kampanii preview.
POST agents/:login/free Odpauzowuje agenta.
POST agents/:login/hangup Rozłącza połączenia agenta.
POST agents/:login/hold Pauzuje telefon agenta jeśli korzysta on z Thulium Softphone.
POST agents/:login/login Loguje agenta.
POST agents/:login/logout Wylogowuje agenta.
POST agents/:login/mute Wycisza telefon agenta jeśli korzysta on z Thulium Softphone.
POST agents/:login/pause Pauzuje agenta.
POST agents/:login/stop_recording Zatrzymuje nagrywanie bieżącej rozmowy agenta.
POST agents/:login/transfer Transferuje połaczenie agenta jeśli korzysta on z Thulium Softphone.
POST agents/:login/unhold Wyłacza pauze telefonu agenta jeśli korzysta on z Thulium Softphone.
POST agents/:login/unmute Wyłącza wyciszenie telefonu agenta jeśli korzysta on z Thulium Softphone.

Czaty

HTTP Zasób Opis
DELETE chat_conversations/:id Usuwanie konwersacji czatu.
DELETE chat_conversations/content/:id/:participant Usuwanie treści wiadomości danej konwersacji.
GET chats Zwraca listę czatów.
GET chats/queues Zwraca listę kolejek czatów.
GET chats/reports/summary Zwraca raport czatów.
POST chat_conversations/:id/message Wysyła wiadomość na czacie.
POST chat_conversations/:id/stop Zakańcza konwersację na czacie.
POST chat_conversations/start Rozpoczyna konwersację na czacie.

CRM

HTTP Zasób Opis
DELETE companies/:id Usuwanie firmy.
DELETE customers/:id Usuwanie klienta.
GET companies Zwraca listę firm zawężoną o podane kryteria wyszukiwania.
GET companies/:id Zwraca firmę o podanym identyfikatorze firmy.
GET customer_id_by_outbound_status Zwraca listę identyfikatorów klientów zawężoną o aktualny status rekordu w kampanii.
GET customers Zwraca listę klientów zawężonych o podane kryteria wyszukiwania.
GET customers/:id Zwraca klienta o podanym identyfikatorze klienta.
POST companies Dodanie firmy do CRM.
POST customers Dodanie klienta do CRM.
POST customers/:id/feed_records Dodanie wpisu do historii kontaktu.
PUT companies/:id Edycja firmy.
PUT customers/:id Edycja klienta.

Kampanie

HTTP Zasób Opis
DELETE outbounds/:id Usuwa kampanię wraz ze wszystkimi rekordami.
GET outbounds Zwraca listę wszystkich kampanii.
GET outbounds/:id/agents Zwraca listę wszystkich agentów w danej kampanii.
GET outbounds/:id/stats Zwraca statystykę rekordów dla kampanii.
GET outbounds/:id/statuses Zwraca listę wszystkich statusów w danej kampanii.
GET outbounds/stats Zwraca statystykę rekordów dla wszystkich aktywnych kampanii.
POST outbounds Dodaje kampanie.
POST outbounds/:id/add_agents Dodaje listę agentów do kampanii.
POST outbounds/:id/clone Klonuje kampanię.
POST outbounds/:id/remove_agents Usuwa agentów z kampanii.
POST outbounds/:id/set_agents Dodaje i usuwa agentów z kampanii.
PUT outbounds/:id Aktualizuje kampanie.

Kampanie (seria)

HTTP Zasób Opis
DELETE batch/outbounds Usuwanie wielu kampanii wraz ze wszystkimi rekordami.

Kampanie CRM

HTTP Zasób Opis
DELETE crm_outbounds/:id/records/:customer_id Usuwanie rekordu z kampanii CRM.
GET crm_outbounds/:id/records Zwraca listę rekordów w kampanii wraz z podstawowymi parametrami.
GET crm_outbounds/:id/records/:customer_id Zwraca informacje o rekordzie w kampanii zasilanej z CRM.
POST crm_outbounds/:id/records Dodanie rekordu do kampanii CRM.
POST crm_outbounds/:id/records/:customer_id/copy_notes Kopiuje notatki z kampanii do CRM.
PUT crm_outbounds/:id/records/:customer_id Edycja rekordu z kampanii zasilanej z CRM.

Kampanie zwykłe

HTTP Zasób Opis
DELETE outbounds/:id/records/:phone_number Usuwanie rekordu z kampanii.
DELETE outbounds/:id/records_by_identifier/:identifier Usuwanie rekordu z kampanii.
GET outbounds/:id/records Zwraca listę rekordów w kampanii wraz z podstawowymi parametrami.
GET outbounds/:id/records/:phone_number Zwraca informacje o rekordzie w kampanii.
GET outbounds/:id/records_by_identifier/:identifier Zwraca informacje o rekordzie w kampanii.
GET outbounds_by_phone_number/:phone_number Zwraca listę kampanii, w których jest podany numer telefonu.
POST outbound_status_by_phone_number Zmiana statusu rekordów na podstawie numeru telefonu.
POST outbounds/:id/records Dodanie rekordu do kampanii.
PUT outbounds/:id/records/:phone_number Edytowanie rekordu w kampanii.
PUT outbounds/:id/records_by_identifier/:identifier Edytowanie rekordu w kampanii.

Pliki tymczasowe

HTTP Zasób Opis
POST temporary_files Tworzy na serwerze tymczasowy plik.

Użytkownicy

HTTP Zasób Opis
GET users/:login Zwraca informacje o użytkowniku (przypisane konta SIP).

Zadania

HTTP Zasób Opis
GET todos/:id Zwraca informacje o zadaniu.
POST todos Dodaje zadanie użytkownikowi.

Zgłoszenia

HTTP Zasób Opis
DELETE tickets/:id Usuwanie zgłoszenia.
GET ticket_categories Zwraca listę kategorii zgłoszeń.
GET ticket_queues Zwraca listę kolejek zgłoszeń.
GET ticket_statuses Zwraca listę statusów zgłoszeń.
GET tickets Zwraca listę zgłoszeń.
GET tickets/:id Zwraca informacje o zgłoszeniu.
GET tickets/today_stats Zwraca statystyki zgłoszeń dla obecnego dnia.
POST tickets Dodanie zgłoszenia.
POST tickets/:id/agent_response Wysłanie wiadomości do zgłoszenia klienta.
POST tickets/:id/comment Dodanie komentarza do zgłoszenia.
POST tickets/:id/customer_response Dodanie odpowiedzi od klienta do zgłoszenia.
PUT tickets/:id Edycja zgłoszenia.

Grupy pól specjalnych klienta

HTTP Zasób Opis
GET customer_field_groups Zwraca listę grup pól specjalnych klienta

Elementy webhook

HTTP Zasób Opis
DELETE webhooks/:id Usuwa element webhook.
GET webhooks Zwraca wszystkie elementy webhook.
POST webhooks Dodaje element webhook.

Tematy rozmów

HTTP Zasób Opis
GET topics Zwraca aktywne tematy rozmów.

Wiadomości SMS

HTTP Zasób Opis
POST sms_messages Wysłanie SMS-a.

Uwierzytelnianie

Dla metod, które wymagają uwierzytelnienia należy dodać odpowiednie nagłówki do requestu HTTP.

Uwierzytelnianie odbywa się przez nagłówek Authorize (więcej informacji).

Przykład

Dla użytkownika user i hasła password należy wysłać w nagłówku typ autoryzacji - Basic oraz wartość zakodowaną kodowaniem Base64 w formacie user:password.

Authorization: Basic dXNlcjpwYXNzd29yZAo=

Dane do autoryzacji

Żeby stworzyć nowego użytkownika dla API zaloguj się do Panelu i wejdź do zakładki Administracja -> Użytkownicy -> Użytkownicy API.

Kody odpowiedzi

W ramach wysyłanych requestów zwracane są odpowiednie kody HTTP, które określają status wykonanej operacji.

Metoda Kod HTTP Opis
GET 200 Request poprawny, zwrócono dane.
POST 201 Utworzono obiekt.
PUT 204 Zaktualizowano obiekt.
DELETE 204 Request poprawny, brak danych do zwrócenia.
POST/PUT/DELETE 207 Odpowiedź zawiera wiele statusów dla poszczególnych obiektów.
GET/POST/PUT/DELETE 400 Błędny request: wystąpił błąd podczas walidacji danych.
GET/POST/PUT/DELETE 401 Błędny request: autoryzacja nie powiodła się, podano błędnego użytkownika lub hasło.
GET/POST/PUT/DELETE 403 Błędny request: użytkownik nie posiada uprawnień do wywołania metody.
GET/POST/PUT/DELETE 404 Błędny request: nie znaleziono szukanego zasobu (URI lub obiektu o podanym identyfikatorze).
GET 410 Błędny request: szukany zasób został permanętnie usunięty.
GET/POST/PUT/DELETE 500 Wewnętrzny błąd serwera podczas przetwarzania requestu.

Obsługa błędów

Dla requestów, które kończą się błędami zwracana jest dokładna informacja o błędzie. Informacja ta zawiera opis i kod błędu oraz identyfikator requestu. Może zostać zwrócony więcej niż jeden błąd.

Identyfikator requestu potrzebny jest przy zgłaszaniu błędów do serwisu Thulium.

Przykład

{
   "request_id": "53678450401cf",
   "errors":
    [
        {
            "message": "Wrong format of phone number.",
            "code": 111111
        },
        {
            "message": "Duplicated customer name.",
            "code": 222222
        }
   ]
}

Język

Język odpowiedzi jest domyślnie ustawiony na angielski. Oznacza to, że wszelkie komunikaty o błędach będą zwrócone po angielsku.

Żeby wymusić inny język należy w ramach requestu wysłać nagłówek Accept-Language.

Przykład

Dla języka polskiego należy wysłać nagłówek:

Accept-Language: pl

Wprowadzenie

System Thulium posiada możliwość wysyłania informacji o połączeniach telefonicznych i czatach na podany adres zwrotny (tzw. callback lub webhook).

Aby skonfigurować taki adres należy w Panelu Thulium w zakładce Administracja -> Webhooki, ustawić adres skryptu, który będzie odpowiedzialny za odbieranie danych. Dane przesyłane są do skryptu metodą POST (przez HTTP lub HTTPS). Dodatkowo w zakładce tej można ustawić czy podczas wywołania skryptu mają się wysyłać dane autoryzacyjne (Auth Basic).

Przypisanie agenta do rozmowy

action Akcja rozróżniająca typ żądania Przykładowa wartość: CHAT_AGENT_ASSIGNED
conversation_id Unikalny identyfikator rozmowy Przykładowa wartość: 83a3f676-e831-47d0-bba7-beda6c0bde88
agent_login Login agenta Przykładowa wartość: jkowalski
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24
chat_queue_id Identyfikator kolejki Przykładowa wartość: 1

Zakończenie rozmowy

action Akcja rozróżniająca typ żądania Przykładowa wartość: CHAT_CONVERSATION_CLOSED
conversation_id Unikalny identyfikator rozmowy Przykładowa wartość: 83a3f676-e831-47d0-bba7-beda6c0bde88
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24
chat_queue_id Identyfikator kolejki Przykładowa wartość: 1

Stworzenie nowej rozmowy

action Akcja rozróżniająca typ żądania Przykładowa wartość: CHAT_CONVERSATION_CREATED
conversation_id Unikalny identyfikator rozmowy Przykładowa wartość: 83a3f676-e831-47d0-bba7-beda6c0bde88
client_name Nazwa klienta Przykładowa wartość: John Smith
client_email E-mail klienta Przykładowa wartość: john.smith@foo.bar
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24
chat_queue_id Identyfikator kolejki Przykładowa wartość: 1

Stworzenie klienta

action Akcja rozróżniająca typ żądania Przykładowa wartość: CUSTOMER_CREATED
customer_id Identyfikator klienta Przykładowa wartość: 154
company_id Identyfikator firmy Przykładowa wartość: 5
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Stworzenie pliku klienta

action Akcja rozróżniająca typ żądania Przykładowa wartość: CUSTOMER_FILE_ATTACHED
agent_login Login agenta Przykładowa wartość: jkowalski
file_id Identyfikator pliku klienta Przykładowa wartość: 9
customer_id Identyfikator klienta Przykładowa wartość: 154
company_id Identyfikator firmy Przykładowa wartość: 5
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Porzucenie połaczenia

action Akcja rozróżniająca typ żądania Przykładowa wartość: ABANDONED
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
queue_id Identyfikator kolejki Przykładowa wartość: 155
source_number Numer dzwoniącego Przykładowa wartość: 523993855
hold_time Czas oczekiwania przed porzuceniem (w sekundach) Przykładowa wartość: 7
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Zakończenie połączenia

action Akcja rozróżniająca typ żądania Przykładowa wartość: AGENT_COMPLETED
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
queue_id Identyfikator kolejki Przykładowa wartość: 155
customer_id Identyfikator klienta Przykładowa wartość: 154
agent_login Login agenta Przykładowa wartość: jkowalski
source_number Numer dzwoniącego Przykładowa wartość: 523993855
destination_number Numer agenta Przykładowa wartość: 162
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24
duration Pełny czas połączenia (w sekundach) Przykładowa wartość: 69
billsec Czas połączenia, za który operator powinien naliczyć opłatę (w sekundach) Przykładowa wartość: 67
filename Plik z nagraniem rozmowy Przykładowa wartość: SOME-QUEUE/2014-11-17/2014-11-17_125932_1416225570.341.wav
reason Strona która zakończyła połączenie (agent - użytkownik, caller - klient) Przykładowa wartość: caller

Odebranie połączenia

action Akcja rozróżniająca typ żądania Przykładowa wartość: AGENT_CONNECTED
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
queue_id Identyfikator kolejki Przykładowa wartość: 155
agent_login Login agenta Przykładowa wartość: jkowalski
source_number Numer dzwoniącego Przykładowa wartość: 523993855
destination_number Numer agenta Przykładowa wartość: 162
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Agent nie odebrał połączenia

action Akcja rozróżniająca typ żądania Przykładowa wartość: AGENT_NOT_ANSWERED
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
queue_id Identyfikator kolejki Przykładowa wartość: 155
agent_login Login agenta Przykładowa wartość: jkowalski
source_number Numer dzwoniącego Przykładowa wartość: 523993855
destination_number Numer agenta Przykładowa wartość: 162
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Telefon dzwoni u agenta

action Akcja rozróżniająca typ żądania Przykładowa wartość: AGENT_RINGING
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
queue_id Identyfikator kolejki Przykładowa wartość: 155
agent_login Login agenta Przykładowa wartość: jkowalski
source_number Numer dzwoniącego Przykładowa wartość: 523993855
destination_number Numer agenta Przykładowa wartość: 162
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Wejście do kolejki

action Akcja rozróżniająca typ żądania Przykładowa wartość: ENTER_QUEUE
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
queue_id Identyfikator kolejki Przykładowa wartość: 155
source_number Numer dzwoniącego Przykładowa wartość: 523993855
source_name Nazwa dzwoniącego Przykładowa wartość: BOK: Kowalski
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Wyjście z kolejki

action Akcja rozróżniająca typ żądania Przykładowa wartość: EXIT_QUEUE
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
queue_id Identyfikator kolejki Przykładowa wartość: 155
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Rozpoczęcie połączenia z IVR

action Akcja rozróżniająca typ żądania Przykładowa wartość: ENTER_IVR
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
source_number Numer dzwoniącego Przykładowa wartość: 523993855
destination_number Numer docelowy Przykładowa wartość: 111222333
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Transfer z kolejki do agenta

action Akcja rozróżniająca typ żądania Przykładowa wartość: QUEUE_TRANSFERRED_TO_AGENT
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
type Typ wykonanego transfery (attended, blind) Przykładowa wartość: attended
queue_id Identyfikator kolejki Przykładowa wartość: 155
agent_login Login agenta Przykładowa wartość: jkowalski
destination_number Numer agenta Przykładowa wartość: 162
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Połączenie z klientem i zakończenie połączenia

action Akcja rozróżniająca typ żądania Przykładowa wartość: OUTBOUND_COMPLETED
id Pięcioznakowy identyfikator kampanii Przykładowa wartość: 00001
name Nazwa kampanii Przykładowa wartość: Outbound
record_id Identyfikator rekordu Przykładowa wartość: 162
phone_number Numer, na który dzwonimy Przykładowa wartość: 523993855
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
customer_id Identyfikator klienta Przykładowa wartość: 154
agent_login Login agenta Przykładowa wartość: jkowalski
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24
duration Pełny czas połączenia (w sekundach) Przykładowa wartość: 69
billsec Czas połączenia, za który operator powinien naliczyć opłatę (w sekundach) Przykładowa wartość: 67
filename Plik z nagraniem rozmowy Przykładowa wartość: 00001/2017-07-26/2017-07-26_15.32.19-975789022-1501075938.16.wav
caller_id Prezentacja numeru Przykładowa wartość: 123975300
attempt Próba połączenia (tylko dla OUTBOUND_CONNECTING) Przykładowa wartość: 1
Uwagi:
Parametr action może przyjmować wartości:
  • OUTBOUND_CONNECTING - akcja wywołana w momencie rozpoczęcia zestawiania połączenia
  • OUTBOUND_CUSTOMER_CONNECTED - akcja wywołana w momencie odebrania telefonu przez klienta
  • OUTBOUND_COMPLETED - akcja wywołana w momencie zakończenia odebranego połączenia
  • OUTBOUND_DROP - akcja wywołana w momencie spadu rekordu
  • OUTBOUND_BUSY - akcja wywołana w momencie gdy telefon klienta jest zajęty
  • OUTBOUND_FAX - akcja wywołana w momencie gdy telefon odebrał fax
  • OUTBOUND_NO_ANSWER - akcja wywołana w momencie gdy abonent nie odbiera
  • OUTBOUND_WRONG_NUMBER - akcja wywołana w momencie gdy numer jest niepoprawny
  • OUTBOUND_VOICE_MAIL - akcja wywołana w momencie gdy odebrała automatyczna sekretarka
  • OUTBOUND_FAILURE - akcja wywołana w momencie gdy jest niezidentyfikowany problem z połączeniem
  • OUTBOUND_CONNECTION_PROBLEM - akcja wywołana w momencie gdy wystąpił problem z połączeniem po stronie operatora
  • OUTBOUND_BLACKLIST - akcja wywołana w momencie gdy numer znajduje się na czarnej liście
  • OUTBOUND_AGENT_FAILED - akcja wywołana w momencie gdy nie udało się wykonać połączenia dla agenta (np. tuż przed rozpoczęciem dzwonienia przestał działać telefon - może nie wywołać się wtedy OUTBOUND_CONNECTING)
  • PREDICTIVE_AGENT_ANSWER - akcja wywołana w momencie gdy agent odbiera połączenie predictive

Agent zapisał rekord z kampanii

action Akcja rozróżniająca typ żądania Przykładowa wartość: OUTBOUND_RECORD_SAVED
id Pięcioznakowy identyfikator kampanii Przykładowa wartość: 00001
name Nazwa kampanii Przykładowa wartość: Outbound
record_id Identyfikator rekordu Przykładowa wartość: 162
phone_number Numer, na który dzwonimy Przykładowa wartość: 523993855
agent_login Login agenta Przykładowa wartość: jkowalski
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24
system_status Status systemowy Przykładowa wartość: MY_RECORD
status_id Identyfikator statusu rekordu w kampanii Przykładowa wartość: 8
record_id Identyfikator rekordu Przykładowa wartość: 162
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
next_call_date Data następnego połączenia Przykładowa wartość: 2017-04-20 09:46:00
assigned_agent_login Login przypisanego agenta Przykładowa wartość: jkowalski
previous_status_id Identyfikator poprzednio ustawionego statusu Przykładowa wartość: NULL
Uwagi:
Pole system_status:
  • TO_CALL Do dzwonienia (świeżo dodane rekordy)
  • IN_PROGRESS Obrabiane
  • CALL Dzwonić
  • MY_RECORD Mój rekord
  • NO_CALL Nie dzwonić
  • ABANDONED_AFTER_N_TRIES Odrzucony po n próbach
  • CALL_NO_SOONER_THAN Kontakt nie wcześniej niż
  • CALL_PROGRESSIVE Dzwonić w trybie progressive (np. dla spadów w trybie predictive)

Pokazana została karta kampanii preview

action Akcja rozróżniająca typ żądania Przykładowa wartość: PREVIEW_RECORD
id Pięcioznakowy identyfikator kampanii Przykładowa wartość: 00001
name Nazwa kampanii Przykładowa wartość: Outbound
record_id Identyfikator rekordu Przykładowa wartość: 162
customer_id Identyfikator klienta Przykładowa wartość: 154
phone_number Numer, na który dzwonimy Przykładowa wartość: 523993855
agent_login Login agenta Przykładowa wartość: jkowalski
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Agent zalogował się do systemu

action Akcja rozróżniająca typ żądania Przykładowa wartość: AGENT_LOGGED_IN
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24
agent_login Login agenta Przykładowa wartość: jkowalski

Agent wylogował się z systemu

action Akcja rozróżniająca typ żądania Przykładowa wartość: AGENT_LOGGED_OUT
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24
agent_login Login agenta Przykładowa wartość: jkowalski

Telefon agenta został podłączony do systemu

action Akcja rozróżniająca typ żądania Przykładowa wartość: AGENT_PHONE_CONNECTED
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24
agent_login Login agenta Przykładowa wartość: jkowalski
phone_number Numer pod którym agent jest dostępny Przykładowa wartość: 800

Agent zmienił status (pauza/wolny)

action Akcja rozróżniająca typ żądania Przykładowa wartość: AGENT_STATUS_CHANGED
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24
agent_login Login agenta Przykładowa wartość: jkowalski
pause_id Identyfikator pauzy Przykładowa wartość: 1
previous_pause_id Identyfikator poprzednio ustawionej pauzy Przykładowa wartość: NULL
Uwagi:
pause_id i previous_pause_id przyjmuje wartość NULL kiedy agent jest wolny

Plik nagrania rozmowy jest gotowy

action Akcja rozróżniająca typ żądania Przykładowa wartość: RECORDING_READY
connection_id Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
filename Plik z nagraniem rozmowy Przykładowa wartość: SOME-QUEUE/2014-11-17/2014-11-17_125932_1416225570.341.wav
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Odpowiedź na zgłoszenie

action Akcja rozróżniająca typ żądania Przykładowa wartość: TICKET_AGENT_REPLIED
ticket_id Identyfikator zgłoszenia Przykładowa wartość: 12
message_id Identyfikator wiadomości w zgłoszeniu Przykładowa wartość: 122
agent_login Login agenta Przykładowa wartość: jkowalski
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Pierwsze zamknięcie zgłoszenia

action Akcja rozróżniająca typ żądania Przykładowa wartość: TICKET_CLOSED
ticket_id Identyfikator zgłoszenia Przykładowa wartość: 12
agent_login Login agenta Przykładowa wartość: jkowalski
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Utworzenie zgłoszenia

action Akcja rozróżniająca typ żądania Przykładowa wartość: TICKET_CREATED
ticket_id Identyfikator zgłoszenia Przykładowa wartość: 12
agent_login Login agenta Przykładowa wartość: jkowalski
direction Dodane jako (in, out, in_behalf_of) Przykładowa wartość: in_behalf_of
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Odebranie zgłoszenia

action Akcja rozróżniająca typ żądania Przykładowa wartość: TICKET_MESSAGE_RECEIVED
ticket_id Identyfikator zgłoszenia Przykładowa wartość: 12
message_id Identyfikator wiadomości w zgłoszeniu Przykładowa wartość: 122
ticket_queue_id Identyfikator kolejki zgłoszeń Przykładowa wartość: 4
date Data wykonania akcji Przykładowa wartość: 2016-04-20 09:46:24

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET agents

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę agentów.

URL

https://your-system-name.thulium.com/api/agents

Przykładowy request

GET https://your-system-name.thulium.com/api/agents

Przykładowy response

[
    {
        "agent_id": 1,
        "login": "",
        "name": "Automat",
        "surname": "Automat",
        "email": "",
        "active": "",
        "number": "",
        "outbound_mode": "manual",
        "group_id": ""
    },
    {
        "agent_id": 2,
        "login": "janko",
        "name": "Jan",
        "surname": "Kowalski",
        "email": "jan.kowalski@example.org",
        "active": true,
        "number": 559933,
        "outbound_mode": "automatic",
        "group_id": 3
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/agents');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/agents");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/agents"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/agents Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET agents/:login

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca informacje o agencie.

URL

https://your-system-name.thulium.com/api/agents/:login

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Przykładowy request

GET https://your-system-name.thulium.com/api/agents/jkowalski

Przykładowy response

{
    "agent_id": 1,
    "login": "jkowalski",
    "name": "Jan",
    "surname": "Kowalski",
    "email": "jan.kowalski@example.org",
    "active": true,
    "number": 559933,
    "outbound_mode": "manual",
    "group_id": 3
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/agents/jkowalski');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/agents/jkowalski");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/agents/jkowalski"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/agents/jkowalski Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET agents/:login/last_queue_call

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca ostatnią rozmowę z kolejki (z ostatnich 24 godzin).

URL

https://your-system-name.thulium.com/api/agents/:login/last_queue_call

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Przykładowy request

GET https://your-system-name.thulium.com/api/agents/jkowalski/last_queue_call

Przykładowy response

{
    "connection_id":"1563281993.1",
    "phone_number":"666555444",
    "start_date":"2019-07-16 14:59:54",
    "answered_date":"2019-07-16 14:59:59",
    "end_date":"2019-07-16 15:00:20",
    "customer_id":123,
    "customer_identifier":"some_company"
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/last_queue_call');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/agents/jkowalski/last_queue_call");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/agents/jkowalski/last_queue_call"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/agents/jkowalski/last_queue_call Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET agents/:login/status

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca status agenta.

Możliwe statusy:
  • OFF
  • FREE
  • PAUSED
  • INBOUND_CALL
  • OUTBOUND_CALL
  • OUTBOUND_PREVIEW
  • CALL
  • RINGING

URL

https://your-system-name.thulium.com/api/agents/:login/status

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Przykładowy request

GET https://your-system-name.thulium.com/api/agents/jkowalski/status

Przykładowy response

{
    "login":"jkowalski",
    "status":"PAUSED",
    "pause_id":1,
    "last_change": "2014-10-24 10:30:44"
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/status');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/agents/jkowalski/status");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/agents/jkowalski/status"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/agents/jkowalski/status Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET agents_groups

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca grupy agentów.

URL

https://your-system-name.thulium.com/api/agents_groups

Przykładowy request

GET https://your-system-name.thulium.com/api/agents_groups

Przykładowy response

[
    {
        "group_id":1,
        "name": "First group"
    },
    {
        "group_id":2,
        "name": "Second group"
    },
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/agents_groups');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/agents_groups");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/agents_groups"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/agents_groups Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET agents_statuses

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca statusy agentów.

Opis statusów znajduje się w agents/:login/status.

URL

https://your-system-name.thulium.com/api/agents_statuses

Parametry

include_logged_off

opcjonalny

Czy zwracać informacje o niezalogowanych agentach. Przykładowa wartość: true

Przykładowy request

GET https://your-system-name.thulium.com/api/agents_statuses

Przykładowy response

[
    {
        "login":"jkowalski",
        "status":"PAUSED",
        "pause_id":1,
        "last_change": "2014-10-24 10:30:44"
    },
    {
        "login":"jjanowski",
        "status":"PAUSED",
        "pause_id":2,
        "last_change": "2014-10-24 10:30:44"
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/agents_statuses');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/agents_statuses");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/agents_statuses"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/agents_statuses Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET agents_work_report

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca raport pracy agentów.

URL

https://your-system-name.thulium.com/api/agents_work_report

Parametry

limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 100. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10
agent_logins

opcjonalny

Lista loginów agentów dla której ma być wygenerowany raport. UWAGA: Jeśli parametr nie zostanie przekazany wymagane jest podanie parametru agent_group_ids.
Identyfikatory agentów możemy pobrać z /agents Przykładowa wartość: agent_logins[]=jankowalski&agent_logins[]=anowak
agent_group_ids

opcjonalny

Lista identyfikatorów grup agentów dla której ma być wygenerowany raport. UWAGA: Jeśli parametr nie zostanie przekazany wymagane jest podanie parametru agent_logins.
Lista identyfikatorów grup agentów może zostać pobrana z /agents_groups Przykładowa wartość: agent_group_ids[]=2&agent_group_ids[]=3&agent_group_ids[]=9
date_from

wymagany

Data rozpoczęcia. Przykładowa wartość: 2019-11-01 11:12:00
date_to

wymagany

Data zakończenia. Przykładowa wartość: 2019-11-02 11:12:00
aggregate_by

opcjonalny

Grupowanie, domyślenie miesiąc (month). Jedna z wartości: hour_of_day, minute, hour, day, week, month, year Przykładowa wartość: month
queues_ids

opcjonalny

Lista identyfikatorów kolejek. Przykładowa wartość: queues_ids[]=1&queues_ids[]=3
outbound_threshold

opcjonalny

Próg dla wychodzących (s), domyślnie 0 Przykładowa wartość: 10

Przykładowy request

GET https://your-system-name.thulium.com/api/agents_work_report?agent_logins[]=jkowalski&date_from=2024-02-27&date_to=2024-03-28&aggregate_by=day

Przykładowy response

[
    {
        "agent": {
            "login": jkowalski,
            "name": "Janko",
            "surname": "Walski"
        },
        "period": "2019-12",
        "inbound": {
            "count": 0,
            "answered_count": 0,
            "not_answered_count": 0,
            "transferred_count": 0,
            "sum": "00:00:00",
            "average": "00:00:00",
            "wait_sum": 0,
            "wait_average": "00:00:00",
            "calls_per_hour": 0
        },
        "chat": {
            "closed": 0,
            "responded": 0
        },
        "ticket": {
            "closed": 0,
            "responded": 0,
            "total_responded": 0
        },
        "outbound_above_threshold": {
            "count": 0,
            "sum": "00:00:00",
            "average": "00:00:00"
        },
        "outbound_below_threshold": {
            "count": 0,
            "sum": "00:00:00",
            "average": "00:00:00"
        },
        "login_date": "2019-12-01 09:00:18",
        "logout_date": "2019-12-25 10:45:02",
        "pauses": [
            {
                "id": "all",
                "count": 0,
                "sum": "00:00:00",
                "average": "00:00:00"
            },
            {
                "id": "free",
                "count": 0,
                "sum": "00:00:00",
                "average": "00:00:00"
            },
            {
                "id": 0,
                "count": 0,
                "sum": "00:00:00"
            },
            {
                "id": 1,
                "count": 0,
                "sum": "00:00:00",
                "average": "00:00:00"
            },
            {
                "id": 2,
                "count": 0,
                "sum": "00:00:00",
                "average": "00:00:00"
            },
            {
                "id": 3,
                "count": 0,
                "sum": "00:00:00"
            },
            {
                "id": 4,
                "count": 0,
                "sum": "00:00:00"
            }
        ]
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/agents_work_report?agent_logins[]=jkowalski&date_from=2024-02-27&date_to=2024-03-28&aggregate_by=day');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/agents_work_report?agent_logins[]=jkowalski&date_from=2024-02-27&date_to=2024-03-28&aggregate_by=day");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/agents_work_report?agent_logins[]=jkowalski&date_from=2024-02-27&date_to=2024-03-28&aggregate_by=day"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/agents_work_report agent_logins[]==jkowalski date_from==2024-02-27 date_to==2024-03-28 aggregate_by==day Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodanie agenta.

URL

https://your-system-name.thulium.com/api/agents

Parametry

name

wymagany

Imię agenta. Przykładowa wartość: Jan
surname

wymagany

Nazwisko agenta. Przykładowa wartość: Kowalski
login

wymagany

Login agenta. Przykładowa wartość: jkowalski
password

wymagany

Hasło do autoryzacji podczas logowania. Przykładowa wartość: somepass123!QAZ
number

wymagany

Numer agenta. Przykładowa wartość: 5634
email

opcjonalny

Adres e-mail agenta. Przykładowa wartość: jkowalski@example.com
change_password

opcjonalny

Wymuszenie zmiany hasła podczas pierwszego logowania.
Domyślna wartość: false Przykładowa wartość: true|false
callerid

opcjonalny

Identyfikator dzwoniącego.
Domyślna wartość: pierwsza litera imienia i nazwisko (J.Kowalski). Przykładowa wartość: J.Kowalski
language

opcjonalny

Język panelu.
Domyślna wartość: pl Przykładowa wartość: pl|en
active

opcjonalny

Ustawienie czy konto jest aktywne.
Domyślna wartość: true Przykładowa wartość: true|false
outbound_mode

opcjonalny

Tryb rozmów wychodzących.
Domyślna wartość: manual Przykładowa wartość: manual|auto
roles

opcjonalny

Identyfikatory ról. Przykładowa wartość: [1, 2]

Przykładowy request

POST https://your-system-name.thulium.com/api/agents
Dane {"name":"Jan","surname":"Kowalski","login":"jkowalski","email":"jk@foo.bar","password":"pass","number":"345","roles":[1,2]}

Przykładowy response

{
    "agent_id": "11",
    "agent_login": "jkowalski"
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"name":"Jan","surname":"Kowalski","login":"jkowalski","email":"jk@foo.bar","password":"pass","number":"345","roles":[1,2]}';

$request curl_init('https://your-system-name.thulium.com/api/agents');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents", "{\"name\":\"Jan\",\"surname\":\"Kowalski\",\"login\":\"jkowalski\",\"email\":\"jk@foo.bar\",\"password\":\"pass\",\"number\":\"345\",\"roles\":[1,2]}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"name":"Jan","surname":"Kowalski","login":"jkowalski","email":"jk@foo.bar","password":"pass","number":"345","roles":[1,2]}' "https://your-system-name.thulium.com/api/agents"

HTTPie

echo '{"name":"Jan","surname":"Kowalski","login":"jkowalski","email":"jk@foo.bar","password":"pass","number":"345","roles":[1,2]}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/answer

Ostatnia modyfikacja 2024-03-20 13:15:19
Odbiera telefon agenta jeśli korzysta on z Thulium Softphone.

URL

https://your-system-name.thulium.com/api/agents/:login/answer

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Uwagi

Funkcja działa tylko gdy agent korzysta z Thulium Softphone.

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/answer

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/answer');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/answer", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/answer"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/answer

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/call

Ostatnia modyfikacja 2024-03-20 13:15:19

Zestawia połączenie dla agenta na podany numer. Połączenie będzie raportowane w ramach wskazanej kampanii (aby raportowanie było poprawne kampania musi być kampanią uproszczoną).

Aby wykonywać połączenia należy stworzyć kampanię i przypisać do niej agenta.

Domyślnie kampania jest wybierana automatycznie na podstawie przypisania agenta do kampanii.

URL

https://your-system-name.thulium.com/api/agents/:login/call

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski
phone_number

wymagany

Numer telefonu, na który zostanie zestawione połączenie. Opcjonalny jeśli podano customer_id. Przykładowa wartość: 111222333
outbound_id

opcjonalny

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
customer_id

opcjonalny

Identyfikator klienta zapisanego w CRM. Przykładowa wartość: 321
caller_id

opcjonalny

Numer prezentacji (domyślnie brany jest z routingu połączeń lub parametrów kampanii). Przykładowa wartość: 321
custom_data

opcjonalny

Dodatkowe dane które zostaną przesyłane w webhookach. Przykładowa wartość: {"example":"json"} / some-id-123

Uwagi

Jeśli podany zostanie identyfikator klienta customer_id, pole numeru telefonu phone_number nie jest wymagane. W przypadku podania tylko identyfikatora klienta system zestawi połączenie na główny numer telefonu klienta.
Jeśli zostanie podany identyfikator klienta customer_id i numer telefonu phone_number system sprawdzi czy podany numer telefonu jest przypisany do klienta, jeśli zostanie odnaleziony zestawi połączenie dla podanego klienta na żądany numer.

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/call
Dane {"phone_number":"111222333"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"phone_number":"111222333"}';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/call');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/call", "{\"phone_number\":\"111222333\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"phone_number":"111222333"}' "https://your-system-name.thulium.com/api/agents/jkowalski/call"

HTTPie

echo '{"phone_number":"111222333"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/call

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/call_preview

Ostatnia modyfikacja 2024-03-20 13:15:19
Dzwoni w kampanii preview.

URL

https://your-system-name.thulium.com/api/agents/:login/call_preview

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/call_preview

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/call_preview');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/call_preview", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/call_preview"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/call_preview

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/free

Ostatnia modyfikacja 2024-03-20 13:15:19
Odpauzowuje agenta.

URL

https://your-system-name.thulium.com/api/agents/:login/free

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/free

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/free');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/free", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/free"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/free

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/hangup

Ostatnia modyfikacja 2024-03-20 13:15:19
Rozłącza połączenia agenta.

URL

https://your-system-name.thulium.com/api/agents/:login/hangup

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/hangup

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/hangup');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/hangup", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/hangup"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/hangup

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/hold

Ostatnia modyfikacja 2024-03-20 13:15:19
Pauzuje telefon agenta jeśli korzysta on z Thulium Softphone.

URL

https://your-system-name.thulium.com/api/agents/:login/hold

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Uwagi

Funkcja działa tylko gdy agent korzysta z Thulium Softphone.

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/hold

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/hold');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/hold", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/hold"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/hold

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/login

Ostatnia modyfikacja 2024-03-20 13:15:19
Loguje agenta.

URL

https://your-system-name.thulium.com/api/agents/:login/login

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/login

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/login');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/login", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/login"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/login

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/logout

Ostatnia modyfikacja 2024-03-20 13:15:19
Wylogowuje agenta.

URL

https://your-system-name.thulium.com/api/agents/:login/logout

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/logout

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/logout');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/logout", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/logout"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/logout

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/mute

Ostatnia modyfikacja 2024-03-20 13:15:19
Wycisza telefon agenta jeśli korzysta on z Thulium Softphone.

URL

https://your-system-name.thulium.com/api/agents/:login/mute

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Uwagi

Funkcja działa tylko gdy agent korzysta z Thulium Softphone.

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/mute

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/mute');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/mute", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/mute"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/mute

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/pause

Ostatnia modyfikacja 2024-03-20 13:15:19
Pauzuje agenta.

URL

https://your-system-name.thulium.com/api/agents/:login/pause

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski
pause_id

wymagany

Pause identifier. Przykładowa wartość: 1

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/pause
Dane {"pause_id":"1"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"pause_id":"1"}';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/pause');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/pause", "{\"pause_id\":\"1\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"pause_id":"1"}' "https://your-system-name.thulium.com/api/agents/jkowalski/pause"

HTTPie

echo '{"pause_id":"1"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/pause

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/stop_recording

Ostatnia modyfikacja 2024-03-20 13:15:19
Zatrzymuje nagrywanie bieżącej rozmowy agenta.

URL

https://your-system-name.thulium.com/api/agents/:login/stop_recording

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/stop_recording

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/stop_recording');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/stop_recording", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/stop_recording"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/stop_recording

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/transfer

Ostatnia modyfikacja 2024-03-20 13:15:19
Transferuje połaczenie agenta jeśli korzysta on z Thulium Softphone.

URL

https://your-system-name.thulium.com/api/agents/:login/transfer

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski
destination

wymagany

Docelowy numer telefonu. Przykładowa wartość: 999888777

Uwagi

Funkcja działa tylko gdy agent korzysta z Thulium Softphone.

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/transfer

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/transfer');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/transfer", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/transfer"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/transfer

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/unhold

Ostatnia modyfikacja 2024-03-20 13:15:19
Wyłacza pauze telefonu agenta jeśli korzysta on z Thulium Softphone.

URL

https://your-system-name.thulium.com/api/agents/:login/unhold

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Uwagi

Funkcja działa tylko gdy agent korzysta z Thulium Softphone.

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/unhold

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/unhold');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/unhold", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/unhold"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/unhold

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST agents/:login/unmute

Ostatnia modyfikacja 2024-03-20 13:15:19
Wyłącza wyciszenie telefonu agenta jeśli korzysta on z Thulium Softphone.

URL

https://your-system-name.thulium.com/api/agents/:login/unmute

Parametry

login

wymagany

Login agenta. Przykładowa wartość: jkowalski

Uwagi

Funkcja działa tylko gdy agent korzysta z Thulium Softphone.

Przykładowy request

POST https://your-system-name.thulium.com/api/agents/jkowalski/unmute

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/agents/jkowalski/unmute');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/agents/jkowalski/unmute", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/agents/jkowalski/unmute"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/agents/jkowalski/unmute

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE chat_conversations/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie konwersacji czatu. Usuwa konwersację i wszystkie jej zależności.

URL

https://your-system-name.thulium.com/api/chat_conversations/:id

Parametry

id

wymagany

Identyfikator konwersacji czatu, który ma być usunięty. Przykładowa wartość: a779146f-4df3-49c1-826a-7caa6a5e653a

Przykładowy request

DELETE https://your-system-name.thulium.com/api/chat_conversations/a779146f-4df3-49c1-826a-7caa6a5e653a

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/chat_conversations/a779146f-4df3-49c1-826a-7caa6a5e653a');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/chat_conversations/a779146f-4df3-49c1-826a-7caa6a5e653a");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/chat_conversations/a779146f-4df3-49c1-826a-7caa6a5e653a"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/chat_conversations/a779146f-4df3-49c1-826a-7caa6a5e653a Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE chat_conversations/content/:id/:participant

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie treści wiadomości danej konwersacji. Pozwala wybrać uczestnika konwersacji lub usunąć dla obu.

URL

https://your-system-name.thulium.com/api/chat_conversations/content/:id/:participant

Parametry

id

wymagany

Identyfikator konwersacji czatu, którego treść ma być usunięta. Przykładowa wartość: a779146f-4df3-49c1-826a-7caa6a5e653a
participant

wymagany

Uczestnik konwersacji czatu, którego treść wiadomości ma być usunięta. Przykładowa wartość: user|customer|both

Przykładowy request

DELETE https://your-system-name.thulium.com/api/chat_conversations/content/2/user

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/chat_conversations/content/2/user');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/chat_conversations/content/2/user");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/chat_conversations/content/2/user"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/chat_conversations/content/2/user Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET chats

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę czatów.

Parametr count zwraca całkowitą liczbę znalezionych czatów (bez uwzględnienia limitu).

URL

https://your-system-name.thulium.com/api/chats

Parametry

limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 100. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10
date_from

opcjonalny

Minimalna data rozpoczęcia czata. Przykładowa wartość: 2014-07-04
date_to

opcjonalny

Maksymalna data rozpoczęcia czata. Przykładowa wartość: 2014-07-14 12:34
status

opcjonalny

Status czata. Przykładowa wartość: CLOSED
chat_queue_id

opcjonalny

Identyfikator kolejki czata. Przykładowa wartość: 3
include_messages

opcjonalny

Dołącz listę wiadomości. Może przyjąć wartość true/false, domyślnie false. Przykładowa wartość: false
include_files

opcjonalny

Dołącz listę plików. Może przyjąć wartość true/false, domyślnie false. Przykładowa wartość: false
include_client_data

opcjonalny

Dołącz dane klienta (np. przeglądarka, adres IP). Może przyjąć wartość true/false, domyślnie false. Przykładowa wartość: false

Uwagi

Pole status może przyjmować następujące wartości:
  • CREATED - czat został rozpoczęty przez klienta
  • IN_PROGRESS - czat jest w trakcie (co oznacza, że agent odpisał na czat)
  • CLOSED - czat został zakończony
W polu sent_by zwracany jest autor wiadomości. Przyjmuje jedną z wartości:
  • USER - wiadomość napisana przez agenta
  • CLIENT - wiadomość napisana przez klienta
  • AUTO - wiadomość systemowa

Przykładowy request

GET https://your-system-name.thulium.com/api/chats?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05&status=CLOSED&include_messages=true&include_files=true&include_client_data=true

Przykładowy response

{
   "count": 3,
   "result": [
       {
            "chat_queue_id": 3,
            "client_email": "andrzej.nowak@company.bar",
            "client_name": "Andrzej Nowak",
            "customer_id": 2,
            "conversation_id": "6ed7c941-2c8a-411e-95d2-338a9f64800a",
            "created_at": "2017-12-11 10:23:04.318",
            "closed_at": "2017-12-11 11:21:05.221",
            "status": "CLOSED",
            "user_login": "jkowalski",
            "rating": 1,
            "messages": [
                {
                    "date": "2020-01-01 11:02:03",
                    "message": "Dzień dobry!",
                    "sent_by": "USER",
                    "user_name": "Jan Kowalski",
                    "user_login": "jkowalski"
                },
                {
                    "date": "2020-01-01 11:02:46",
                    "message": "Dzień dobry, mam pytanie odnośnie produktu",
                    "sent_by": "CLIENT",
                    "user_name": null,
                    "user_login": null
                },
                {
                    "date": "2020-01-01 11:02:56",
                    "message": "Jakiego konkretnie?",
                    "sent_by": "USER",
                    "user_name": "Jan Kowalski",
                    "user_login": "jkowalski"
                }
            ],
            "files": [
                {
                    "date": "2023-09-06 15:33:29",
                    "token": "188164338364f87fa936e48",
                    "sent_by": "CLIENT",
                    "user_name": null,
                    "user_login": null
                }
            ],
            "client_data": {
                "browser": "Chrome 96.0.4664",
                "ip": "127.0.0.1",
                "last_visited_url": "https://thulium.com",
                "os": "Linux",
                "referrer": "",
                "resolution": "1920x1080"
            }
       }
   ]
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/chats?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05&status=CLOSED&include_messages=true&include_files=true&include_client_data=true');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/chats?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05&status=CLOSED&include_messages=true&include_files=true&include_client_data=true");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/chats?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05&status=CLOSED&include_messages=true&include_files=true&include_client_data=true"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/chats limit==1 offset==0 date_from==2014-07-04 date_to==2014-07-05 status==CLOSED include_messages==true include_files==true include_client_data==true Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET chats/queues

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę kolejek czatów.

URL

https://your-system-name.thulium.com/api/chats/queues

Przykładowy request

GET https://your-system-name.thulium.com/api/chats/queues

Przykładowy response

[
  {
    "chat_queue_id": 3,
    "name": "BOK",
    "display_name": null
  },
  {
    "chat_queue_id": 4,
    "name": "service",
    "display_name": "Service queue"
  }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/chats/queues');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/chats/queues");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/chats/queues"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/chats/queues Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET chats/reports/summary

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca raport czatów.

URL

https://your-system-name.thulium.com/api/chats/reports/summary

Parametry

limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 100. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10
user_logins

opcjonalny

Lista loginów użytkowników dla której ma być wygenerowany raport. Przykładowa wartość: user_logins[]=jankowalski&user_logins[]=anowak
date_from

wymagany

Data rozpoczęcia. Przykładowa wartość: 2019-11-01 11:12:00
date_to

wymagany

Data zakończenia. Przykładowa wartość: 2019-11-02 11:12:00
sum_users

opcjonalny

Sumuj użytkowników, domyślnie false. Przykładowa wartość: true
aggregate_by

opcjonalny

Grupowanie, domyślenie miesiąc (month). Jedna z wartości: hour_of_day, minute, hour, day, week, month, year Przykładowa wartość: month
chat_queue_ids

opcjonalny

Lista identyfikatorów kolejek czatu. Przykładowa wartość: chat_queue_ids[]=1&chat_queue_ids[]=3
response_threshold

opcjonalny

Próg dla pierwszej odpowiedzi (s), domyślnie 20 Przykładowa wartość: 50

Przykładowy request

GET https://your-system-name.thulium.com/api/chats/reports/summary?user_logins[]=jkowalski&date_from=2024-02-27&date_to=2024-03-28&aggregate_by=day

Przykładowy response

[
  {
    "series": "2021-12",
    "user_name": "John Doe",
    "incoming": 1,
    "incoming_to_agent": 1,
    "incoming_including_empty": 1,
    "abandoned": 0,
    "answered": 1,
    "incoming_to_bot": 0,
    "transferred_by_bot": 0,
    "finished_by_bot": 0,
    "service_level_percent": 100,
    "chat_time": {
      "min": "00:00:48",
      "max": "00:00:48",
      "sum": "00:00:48",
      "avg": "00:00:48"
    },
    "wait_time": {
      "min": "00:00:00",
      "max": "00:00:00",
      "sum": "00:00:00",
      "avg": "00:00:00"
    },
    "sla_percent": 100,
    "rating": {
      "rate": {
        "sad": 0,
        "neutral": 0,
        "happy": 0
      },
      "satisfaction_percent": 0,
      "rated_percent": 0
    }
  }]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/chats/reports/summary?user_logins[]=jkowalski&date_from=2024-02-27&date_to=2024-03-28&aggregate_by=day');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/chats/reports/summary?user_logins[]=jkowalski&date_from=2024-02-27&date_to=2024-03-28&aggregate_by=day");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/chats/reports/summary?user_logins[]=jkowalski&date_from=2024-02-27&date_to=2024-03-28&aggregate_by=day"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/chats/reports/summary user_logins[]==jkowalski date_from==2024-02-27 date_to==2024-03-28 aggregate_by==day Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST chat_conversations/:id/message

Ostatnia modyfikacja 2024-03-20 13:15:19
Wysyła wiadomość na czacie w ramach danej konwersacji.

URL

https://your-system-name.thulium.com/api/chat_conversations/:id/message

Parametry

id

wymagany

Identyfikator konwersacji (zwrócony przez start). Przykładowa wartość: 6ed7c941-2c8a-411e-95d2-338a9f64800a
text

opcjonalny

Wiadomość do wysłania. Przykładowa wartość: Hello, world!

Przykładowy request

POST https://your-system-name.thulium.com/api/chat_conversations/6ed7c941-2c8a-411e-95d2-338a9f64800a/message
Dane {"text":"Hello, world!"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"text":"Hello, world!"}';

$request curl_init('https://your-system-name.thulium.com/api/chat_conversations/6ed7c941-2c8a-411e-95d2-338a9f64800a/message');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/chat_conversations/6ed7c941-2c8a-411e-95d2-338a9f64800a/message", "{\"text\":\"Hello, world!\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"text":"Hello, world!"}' "https://your-system-name.thulium.com/api/chat_conversations/6ed7c941-2c8a-411e-95d2-338a9f64800a/message"

HTTPie

echo '{"text":"Hello, world!"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/chat_conversations/6ed7c941-2c8a-411e-95d2-338a9f64800a/message

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST chat_conversations/:id/stop

Ostatnia modyfikacja 2024-03-20 13:15:19
Zakańcza konwersację na czacie.

URL

https://your-system-name.thulium.com/api/chat_conversations/:id/stop

Parametry

id

wymagany

Identyfikator konwersacji (zwrócony przez start). Przykładowa wartość: 6ed7c941-2c8a-411e-95d2-338a9f64800a

Przykładowy request

POST https://your-system-name.thulium.com/api/chat_conversations/6ed7c941-2c8a-411e-95d2-338a9f64800a/stop

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/chat_conversations/6ed7c941-2c8a-411e-95d2-338a9f64800a/stop');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/chat_conversations/6ed7c941-2c8a-411e-95d2-338a9f64800a/stop", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/chat_conversations/6ed7c941-2c8a-411e-95d2-338a9f64800a/stop"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/chat_conversations/6ed7c941-2c8a-411e-95d2-338a9f64800a/stop

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST chat_conversations/start

Ostatnia modyfikacja 2024-03-20 13:15:19

Rozpoczyna konwersację na czacie.

Kolejność dopasowania klientów z CRM:

  • Pole customer_id
  • Pole client_id
  • Adres e-mail

URL

https://your-system-name.thulium.com/api/chat_conversations/start

Parametry

chat_queue_id

wymagany

Identyfikator kolejki czata. Przykładowa wartość: 3
client_name

opcjonalny

Imię klienta. Przykładowa wartość: Jan
client_surname

opcjonalny

Nazwisko klienta. Przykładowa wartość: Kowalski
client_email

opcjonalny

Adres e-mail klienta. Przykładowa wartość: jan.kowalski@example.org
client_id

opcjonalny

Zewnętrzny identyfikator klienta. Przykładowa wartość: 1234
customer_id

opcjonalny

Identyfikator klienta w Thulium. Przykładowa wartość: 1

Przykładowy request

POST https://your-system-name.thulium.com/api/chat_conversations/start?chat_queue_id=3&client_id=1234

Przykładowy response

{
    "conversation_id": "6ed7c941-2c8a-411e-95d2-338a9f64800a"
}

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/chat_conversations/start?chat_queue_id=3&client_id=1234');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/chat_conversations/start?chat_queue_id=3&client_id=1234", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/chat_conversations/start?chat_queue_id=3&client_id=1234"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/chat_conversations/start

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE companies/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie firmy. Usuwa firmę i wszystkie jej zależności. Zachowane zostają informacje o połączeniach, czatach oraz zgłoszeniach.

URL

https://your-system-name.thulium.com/api/companies/:id

Parametry

id

wymagany

Identyfikator firmy, która ma być usunięta. Przykładowa wartość: 13

Przykładowy request

DELETE https://your-system-name.thulium.com/api/companies/13

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/companies/13');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/companies/13");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/companies/13"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/companies/13 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE customers/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie klienta. Usuwa klienta i wszystkie jego zależności. Zachowane zostają informacje o połączeniach, czatach oraz zgłoszeniach.

URL

https://your-system-name.thulium.com/api/customers/:id

Parametry

id

wymagany

Identyfikator klienta, który ma być usunięty. Przykładowa wartość: 13

Przykładowy request

DELETE https://your-system-name.thulium.com/api/customers/13

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/customers/13');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/customers/13");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/customers/13"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/customers/13 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET companies

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę firm zawężoną o podane kryteria wyszukiwania.

URL

https://your-system-name.thulium.com/api/companies

Parametry

identifier

opcjonalny

Identyfikator firmy. Jeśli zostanie ustawiony pusty zwróci firmy, które nie mają ustawionego identyfikatora. Przykładowa wartość: 3434558
email

opcjonalny

Adres e-mail firmy. Przykładowa wartość: jan.kowalski@foo.bar
phone_number

opcjonalny

Numer telefonu firmy. Przykładowa wartość: 555666777
nip

opcjonalny

Numer NIP firmy. Przykładowa wartość: 6783144527
type

opcjonalny

Tekstowa nazwa typu klienta zdefiniowana w systemie. Przykładowa wartość: custom type name
group

opcjonalny

Tekstowa nazwa grupy klienta zdefiniowana w systemie. Przykładowa wartość: custom group name
custom_fields

opcjonalny

Wyszukiwanie po wartościach pól specjalnych. Można wyszukiwać po wielu polach specjalnych na raz.
Dla każdego pola można podać kilka alternatywnych wartości.
Na przykład:
["custom_fields" => [
    "Kraj" => ["POLSKA", "NORWEGIA"],
    "Miasto" => "Kraków"
]];
Przykładowa wartość: custom_fields[Kraj][0]=POLSKA&custom_fields[Kraj][1]=NORWEGIA&custom_fields[Miasto]=Krak%C3%B3w
include_custom_fields

opcjonalny

Czy zwracać pola specjalne klienta. Przykładowa wartość: true
include_address

opcjonalny

Czy zwracać adres klienta. Przykładowa wartość: true
include_invoice_address

opcjonalny

Czy zwracać adres do faktur. Przykładowa wartość: true
include_mail_drop_address

opcjonalny

Czy zwracać adres korespondencyjny. Przykładowa wartość: true
limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 1000. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10
order

opcjonalny

Lista pól, po których będą posortowane rezultaty. Prefiks '-' oznacza sortowanie malejące, brak prefiksu rosnące. Możliwe jest sortowanie po polach: name, nip, company_id, identifier. Przykładowa wartość: name,-customer_id,nip

Przykładowy request

GET https://your-system-name.thulium.com/api/companies?nip=6783144527&include_custom_fields=true&include_address=true

Przykładowy response

[
        {
        "name": "Thulium",
        "company_id": 28,
        "customer_id": 13,
        "identifier": "3434558",
        "phone_number": "123456789",
        "phone_numbers": ["123456789", "987654321"],
        "email": "thulium@example.com",
        "emails": ["thulium@example.com", "thulium.bok@example.com"],
        "type": "internal",
        "group": "partner",
        "nip": "6783144527",
        "account_manager":"",
        "address":
        {
            "street": "Zlotej Jesieni",
            "building": "7",
            "flat": null,
            "postcode": "31-827",
            "city": "Krakow",
            "post_office": "Krakow",
            "borough": null,
            "county": null,
            "voivodship": null,
            "country": "Poland"
        },
       "custom_fields":
       {
          "ID": null,
          "Additional info": "none"
       }
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/companies?nip=6783144527&include_custom_fields=true&include_address=true');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/companies?nip=6783144527&include_custom_fields=true&include_address=true");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/companies?nip=6783144527&include_custom_fields=true&include_address=true"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/companies nip==6783144527 include_custom_fields==true include_address==true Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET companies/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca firmę o podanym identyfikatorze firmy.

URL

https://your-system-name.thulium.com/api/companies/:id

Parametry

id

wymagany

Identyfikator firmy. Przykładowa wartość: 28
include_custom_fields

opcjonalny

Czy zwracać pola specjalne klienta. Przykładowa wartość: true
include_address

opcjonalny

Czy zwracać adres klienta. Przykładowa wartość: true
include_invoice_address

opcjonalny

Czy zwracać adres do faktur. Przykładowa wartość: true
include_mail_drop_address

opcjonalny

Czy zwracać adres korespondencyjny. Przykładowa wartość: true

Przykładowy request

GET https://your-system-name.thulium.com/api/companies/28?include_custom_fields=true&include_address=true

Przykładowy response

{
    "name": "Thulium",
    "company_id": 28,
    "customer_id": 13,
    "type": "internal",
    "group": "partner",
    "nip": "6783144527",
    "account_manager":"",
    "address":
    {
        "street": "Zlotej Jesieni",
        "building": "7",
        "flat": null,
        "postcode": "31-827",
        "city": "Krakow",
        "post_office": "Krakow",
        "borough": null,
        "county": null,
        "voivodship": null,
        "country": "Poland"
    },
    custom_fields":
    {
      "ID": null,
      "Additional info": "none"
    }
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/companies/28?include_custom_fields=true&include_address=true');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/companies/28?include_custom_fields=true&include_address=true");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/companies/28?include_custom_fields=true&include_address=true"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/companies/28 include_custom_fields==true include_address==true Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET customer_id_by_outbound_status

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę identyfikatorów klientów zawężoną o aktualny status rekordu w kampanii.

URL

https://your-system-name.thulium.com/api/customer_id_by_outbound_status

Parametry

outbound_id[]

wymagany

Identyfikator kampanii (jeden lub wiele). Przykładowa wartość: 00010
status_id[]

wymagany

Identyfikator statusu z kampanii (jeden lub wiele). Przykładowa wartość: 1

Przykładowy request

GET https://your-system-name.thulium.com/api/customer_id_by_outbound_status?outbound_id[]=00002&status_id[]=1&outbound_id[]=00003&status_id[]=1

Przykładowy response

{"customer_id": [1, 2, 3, 4, 5, 6, 7]}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/customer_id_by_outbound_status?outbound_id[]=00002&status_id[]=1&outbound_id[]=00003&status_id[]=1');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/customer_id_by_outbound_status?outbound_id[]=00002&status_id[]=1&outbound_id[]=00003&status_id[]=1");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/customer_id_by_outbound_status?outbound_id[]=00002&status_id[]=1&outbound_id[]=00003&status_id[]=1"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/customer_id_by_outbound_status outbound_id[]==00002 status_id[]==1 outbound_id[]==00003 status_id[]==1 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET customers

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę klientów zawężonych o podane kryteria wyszukiwania.

URL

https://your-system-name.thulium.com/api/customers

Parametry

identifier

opcjonalny

Identyfikator klienta. Jeśli zostanie ustawiony pusty zwróci klientów, którzy nie mają ustawionego identyfikatora. Przykładowa wartość: 3434558
email

opcjonalny

Adres e-mail klienta. Przykładowa wartość: jan.kowalski@foo.bar
phone_number

opcjonalny

Numer telefonu klienta lub pustą wartość (klienci którzy nie mają numeru telefonu) Przykładowa wartość: 555666777
nip

opcjonalny

Numer NIP klienta. Przykładowa wartość: 6783144527
company_id

opcjonalny

Identyfikator firmy. Przykładowa wartość: 456
company_flag

opcjonalny

Klient jest firmą. Przykładowa wartość: true
type

opcjonalny

Tekstowa nazwa typu klienta zdefiniowana w systemie. Przykładowa wartość: custom type name
group

opcjonalny

Tekstowa nazwa grupy klienta zdefiniowana w systemie. Przykładowa wartość: custom group name
custom_fields

opcjonalny

Wyszukiwanie po wartościach pól specjalnych. Można wyszukiwać po wielu polach specjalnych na raz.
Dla każdego pola można podać kilka alternatywnych wartości.
Na przykład:
["custom_fields" => [
    "Kraj" => ["POLSKA", "NORWEGIA"],
    "Miasto" => "Kraków"
]];
Przykładowa wartość: custom_fields[Kraj][0]=POLSKA&custom_fields[Kraj][1]=NORWEGIA&custom_fields[Miasto]=Krak%C3%B3w
include_custom_fields

opcjonalny

Czy zwracać pola specjalne klienta. Przykładowa wartość: true
include_address

opcjonalny

Czy zwracać adres klienta. Przykładowa wartość: true
include_invoice_address

opcjonalny

Czy zwracać adres do faktur. Przykładowa wartość: true
include_mail_drop_address

opcjonalny

Czy zwracać adres korespondencyjny. Przykładowa wartość: true
limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 1000. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10
order

opcjonalny

Lista pól, po których będą posortowane rezultaty. Prefiks '-' oznacza sortowanie malejące, brak prefiksu rosnące. Możliwe jest sortowanie po polach: surname, name, nip, company_id, customer_id, identifier. Przykładowa wartość: name,-customer_id,nip

Przykładowy request

GET https://your-system-name.thulium.com/api/customers?email=jan.kowalski@foo.bar&include_custom_fields=true&include_address=true

Przykładowy response

[
    {
        "customer_id": 273,
        "name": "Jan",
        "surname": "Kowalski",
        "phone_number": "222333444",
        "phone_numbers": ["222333444", "213443523"],
        "email": "jan.kowalski@foo.bar",
        "emails": ["jan.kowalski@foo.bar", "j.kowalski@foo.bar],
        "company_id": "",
        "identifier": "",
        "type": "",
        "group": "",
        "company_flag": false,
        "birthdate": "",
        "gender": "",
        "homepage": "",
        "nip": "",
        "account_manager":"",
        "updated_at":"",
        "address":
        {
            "street": "Zlotej Jesieni",
            "building": "7",
            "flat": null,
            "postcode": "31-827",
            "city": "Krakow",
            "post_office": "Krakow",
            "borough": null,
            "county": null,
            "voivodship": null,
            "country": "Poland"
        },
        "custom_fields":
        {
           "ID": null,
           "Dodatkowe informacje": "Numer dowodu - AXX 121212"
        }
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/customers?email=jan.kowalski@foo.bar&include_custom_fields=true&include_address=true');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/customers?email=jan.kowalski@foo.bar&include_custom_fields=true&include_address=true");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/customers?email=jan.kowalski@foo.bar&include_custom_fields=true&include_address=true"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/customers email==jan.kowalski@foo.bar include_custom_fields==true include_address==true Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET customers/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca klienta o podanym identyfikatorze klienta.

URL

https://your-system-name.thulium.com/api/customers/:id

Parametry

id

wymagany

Identyfikator klienta. Przykładowa wartość: 273
include_custom_fields

opcjonalny

Czy zwracać pola specjalne klienta. Przykładowa wartość: true
include_address

opcjonalny

Czy zwracać adres klienta. Przykładowa wartość: true
include_invoice_address

opcjonalny

Czy zwracać adres do faktur. Przykładowa wartość: true
include_mail_drop_address

opcjonalny

Czy zwracać adres korespondencyjny. Przykładowa wartość: true

Przykładowy request

GET https://your-system-name.thulium.com/api/customers/273?include_custom_fields=true

Przykładowy response

{
    "customer_id": 273,
    "name": "Jan",
    "surname": "Kowalski",
    "phone_number": "222333444",
    "phone_numbers": ["222333444", "213443523"],
    "email": "jan.kowalski@foo.bar",
    "company_id": "",
    "identifier": "",
    "type": "",
    "group": "",
    "company_flag": "",
    "account_manager":"",
    "updated_at":"",
    "custom_fields":
    {
       "ID": null,
       "Dodatkowe informacje": "Numer dowodu - AXX 121212"
    }
}
    

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/customers/273?include_custom_fields=true');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/customers/273?include_custom_fields=true");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/customers/273?include_custom_fields=true"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/customers/273 include_custom_fields==true Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST companies

Ostatnia modyfikacja 2024-03-20 13:15:19

Dodanie firmy do CRM.

URL

https://your-system-name.thulium.com/api/companies

Parametry

name

wymagany

Nazwa firmy.
nip

opcjonalny

Numer NIP firmy. Jeśli jest podany, ma być unikatowy.
email

opcjonalny

Adres e-mail firmy.
phone_number

opcjonalny

Numer lub numery telefonu firmy.
type

opcjonalny

Tekstowa nazwa typu klienta zdefiniowana w systemie.
group

opcjonalny

Tekstowa nazwa grupy klienta zdefiniowana w systemie.
identifier

opcjonalny

Identyfikator firmy.
note

opcjonalny

Notatka.
custom_fields

opcjonalny

Obiekt z wartościami pól specjalnych. Przykładowa wartość: "custom_fields":{"field_name_1":"value_1","field_name_2":"value_2"}
fill_read_only_custom_fields

opcjonalny

Flaga definiująca czy pola specjalne zostaną wypełnione pomimo posiadania typu READ ONLY. Przykładowa wartość: true
account_manager

opcjonalny

Login opiekuna firmy
vip

opcjonalny

VIP Przykładowa wartość: true
address

opcjonalny

Adres firmy.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.
invoice_address

opcjonalny

Adres do faktur.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.
mail_drop_address

opcjonalny

Adres korespondencyjny.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.

Przykładowy request

POST https://your-system-name.thulium.com/api/companies
Dane {"name":"company","nip":"6783144527","address":{"city":"Krakow","street":"Zlotej Jesieni"}}

Przykładowy response

{
    "company_id": "21",
    "customer_id": "121"
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"name":"company","nip":"6783144527","address":{"city":"Krakow","street":"Zlotej Jesieni"}}';

$request curl_init('https://your-system-name.thulium.com/api/companies');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/companies", "{\"name\":\"company\",\"nip\":\"6783144527\",\"address\":{\"city\":\"Krakow\",\"street\":\"Zlotej Jesieni\"}}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"name":"company","nip":"6783144527","address":{"city":"Krakow","street":"Zlotej Jesieni"}}' "https://your-system-name.thulium.com/api/companies"

HTTPie

echo '{"name":"company","nip":"6783144527","address":{"city":"Krakow","street":"Zlotej Jesieni"}}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/companies

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST customers

Ostatnia modyfikacja 2024-03-20 13:15:19

Dodanie klienta do CRM.

URL

https://your-system-name.thulium.com/api/customers

Parametry

name

opcjonalny

Imię klienta.
surname

wymagany

Nazwisko klienta.
email

opcjonalny

Adres lub adresy e-mail klienta.
phone_number

opcjonalny

Numer lub numery telefonu firmy.
company_id

opcjonalny

Identyfikator firmy, do której ma być dodany klient.
type

opcjonalny

Tekstowa nazwa typu klienta zdefiniowana w systemie.
group

opcjonalny

Tekstowa nazwa grupy klienta zdefiniowana w systemie.
identifier

opcjonalny

Identyfikator klienta.
gender

opcjonalny

Płeć klienta.
homepage

opcjonalny

Strona WWW klienta.
birthdate

opcjonalny

Data urodzenia klienta.
nip

opcjonalny

NIP klienta.
note

opcjonalny

Notatka.
pesel

opcjonalny

Numer PESEL.
job

opcjonalny

Miejsce pracy.
job_title

opcjonalny

Stanowisko.
account_manager

opcjonalny

Login opiekuna klienta
custom_fields

opcjonalny

Obiekt z wartościami pól specjalnych. Przykładowa wartość: "custom_fields":{"field_name_1":"value_1","field_name_2":"value_2"}
fill_read_only_custom_fields

opcjonalny

Flaga definiująca czy pola specjalne zostaną wypełnione pomimo posiadania typu READ ONLY. Przykładowa wartość: true
vip

opcjonalny

VIP Przykładowa wartość: true
address

opcjonalny

Adres klienta.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.
invoice_address

opcjonalny

Adres do faktur.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.
mail_drop_address

opcjonalny

Adres korespondencyjny.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.

Przykładowy request

POST https://your-system-name.thulium.com/api/customers
Dane {"surname":"Kowalski","phone_number":["333444555","123432234"]}

Przykładowy response

{
    "customer_id": "324"
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"surname":"Kowalski","phone_number":["333444555","123432234"]}';

$request curl_init('https://your-system-name.thulium.com/api/customers');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/customers", "{\"surname\":\"Kowalski\",\"phone_number\":[\"333444555\",\"123432234\"]}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"surname":"Kowalski","phone_number":["333444555","123432234"]}' "https://your-system-name.thulium.com/api/customers"

HTTPie

echo '{"surname":"Kowalski","phone_number":["333444555","123432234"]}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/customers

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST customers/:id/feed_records

Ostatnia modyfikacja 2024-03-20 13:15:19

Dodanie wpisu do historii kontaktu.

URL

https://your-system-name.thulium.com/api/customers/:id/feed_records

Parametry

type

wymagany

Typ wpisu (możliwe typy: ZOWIE)
payload

wymagany

Dane wpisu.

Przykładowy request

POST https://your-system-name.thulium.com/api/customers/23/feed_records
Dane {"type":"ZOWIE","payload":"[{\"id\":\"sample-id\",\"type\":\"text\",\"payload\":{\"message\":\"Sample message\"},\"author\":\"customer\",\"time\":\"2021-02-02T10:10:12\"}]"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"type":"ZOWIE","payload":"[{\"id\":\"sample-id\",\"type\":\"text\",\"payload\":{\"message\":\"Sample message\"},\"author\":\"customer\",\"time\":\"2021-02-02T10:10:12\"}]"}';

$request curl_init('https://your-system-name.thulium.com/api/customers/23/feed_records');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/customers/23/feed_records", "{\"type\":\"ZOWIE\",\"payload\":\"[{\\"id\\":\\"sample-id\\",\\"type\\":\\"text\\",\\"payload\\":{\\"message\\":\\"Sample message\\"},\\"author\\":\\"customer\\",\\"time\\":\\"2021-02-02T10:10:12\\"}]\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"type":"ZOWIE","payload":"[{\"id\":\"sample-id\",\"type\":\"text\",\"payload\":{\"message\":\"Sample message\"},\"author\":\"customer\",\"time\":\"2021-02-02T10:10:12\"}]"}' "https://your-system-name.thulium.com/api/customers/23/feed_records"

HTTPie

echo '{"type":"ZOWIE","payload":"[{\"id\":\"sample-id\",\"type\":\"text\",\"payload\":{\"message\":\"Sample message\"},\"author\":\"customer\",\"time\":\"2021-02-02T10:10:12\"}]"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/customers/23/feed_records

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT companies/:id

Ostatnia modyfikacja 2024-03-20 13:15:19

Edycja firmy.

URL

https://your-system-name.thulium.com/api/companies/:id

Parametry

name

opcjonalny

Nazwa firmy.
nip

opcjonalny

Numer NIP firmy. Jeśli jest podany, ma być unikatowy.
email

opcjonalny

Adres e-mail firmy.
phone_number

opcjonalny

Numer lub numery telefonu firmy.
type

opcjonalny

Tekstowa nazwa typu klienta zdefiniowana w systemie.
group

opcjonalny

Tekstowa nazwa grupy klienta zdefiniowana w systemie.
identifier

opcjonalny

Identyfikator firmy.
note

opcjonalny

Notatka.
custom_fields

opcjonalny

Obiekt z wartościami pól specjalnych. Przykładowa wartość: "custom_fields":{"field_name_1":"value_1","field_name_2":"value_2"}
fill_read_only_custom_fields

opcjonalny

Flaga definiująca czy pola specjalne zostaną wypełnione pomimo posiadania typu READ ONLY. Przykładowa wartość: true
account_manager

opcjonalny

Login opiekuna firmy
vip

opcjonalny

VIP Przykładowa wartość: true
address

opcjonalny

Adres firmy.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.
invoice_address

opcjonalny

Adres do faktur.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.
mail_drop_address

opcjonalny

Adres korespondencyjny.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.

Przykładowy request

PUT https://your-system-name.thulium.com/api/companies/23
Dane {"name":"company","nip":"6783144527","address":{"city":"Krakow","street":"Zlotej Jesieni"}}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"name":"company","nip":"6783144527","address":{"city":"Krakow","street":"Zlotej Jesieni"}}';

$request curl_init('https://your-system-name.thulium.com/api/companies/23');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/companies/23", "{\"name\":\"company\",\"nip\":\"6783144527\",\"address\":{\"city\":\"Krakow\",\"street\":\"Zlotej Jesieni\"}}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{"name":"company","nip":"6783144527","address":{"city":"Krakow","street":"Zlotej Jesieni"}}' "https://your-system-name.thulium.com/api/companies/23"

HTTPie

echo '{"name":"company","nip":"6783144527","address":{"city":"Krakow","street":"Zlotej Jesieni"}}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/companies/23

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT customers/:id

Ostatnia modyfikacja 2024-03-20 13:15:19

Edycja klienta.

URL

https://your-system-name.thulium.com/api/customers/:id

Parametry

name

opcjonalny

Imię klienta.
surname

opcjonalny

Nazwisko klienta.
email

opcjonalny

Adres lub adresy e-mail klienta.
phone_number

opcjonalny

Numer lub numery telefonu firmy.
company_id

opcjonalny

Identyfikator firmy, do której ma być dodany klient.
type

opcjonalny

Tekstowa nazwa typu klienta zdefiniowana w systemie.
group

opcjonalny

Tekstowa nazwa grupy klienta zdefiniowana w systemie.
identifier

opcjonalny

Identyfikator klienta.
gender

opcjonalny

Płeć klienta.
homepage

opcjonalny

Strona WWW klienta.
birthdate

opcjonalny

Data urodzenia klienta.
nip

opcjonalny

NIP klienta.
note

opcjonalny

Notatka.
pesel

opcjonalny

Numer PESEL.
job

opcjonalny

Miejsce pracy.
job_title

opcjonalny

Stanowisko.
account_manager

opcjonalny

Login opiekuna klienta
custom_fields

opcjonalny

Obiekt z wartościami pól specjalnych. Przykładowa wartość: "custom_fields":{"field_name_1":"value_1","field_name_2":"value_2"}
fill_read_only_custom_fields

opcjonalny

Flaga definiująca czy pola specjalne zostaną wypełnione pomimo posiadania typu READ ONLY. Przykładowa wartość: true
vip

opcjonalny

VIP Przykładowa wartość: true
address

opcjonalny

Adres klienta.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.
invoice_address

opcjonalny

Adres do faktur.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.
mail_drop_address

opcjonalny

Adres korespondencyjny.
   street

   opcjonalny

Nazwa ulicy.
   building

   opcjonalny

Numer budynku.
   flat

   opcjonalny

Numer mieszkania.
   postcode

   opcjonalny

Kod pocztowy.
   city

   opcjonalny

Miasto.
   country

   opcjonalny

Kraj.

Przykładowy request

PUT https://your-system-name.thulium.com/api/customers/12
Dane {"surname":"Kowalski","phone_number":"333444555"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"surname":"Kowalski","phone_number":"333444555"}';

$request curl_init('https://your-system-name.thulium.com/api/customers/12');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/customers/12", "{\"surname\":\"Kowalski\",\"phone_number\":\"333444555\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{"surname":"Kowalski","phone_number":"333444555"}' "https://your-system-name.thulium.com/api/customers/12"

HTTPie

echo '{"surname":"Kowalski","phone_number":"333444555"}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/customers/12

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE batch/customers

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie klientów. Usuwa klientów i wszystkie ich zależności. Zachowane zostają informacje o połączeniach, czatach oraz zgłoszeniach.

URL

https://your-system-name.thulium.com/api/batch/customers

Parametry

customer_id[]

wymagany

Identyfikator klienta, który ma być usunięty (jeden lub wiele). Przykładowa wartość: 13

Przykładowy request

DELETE https://your-system-name.thulium.com/api/batch/customers?customer_id[]=13&customer_id[]=14

Przykładowy response

{
    "13": {
        "http_status": 204,
    },
    "14": {
        "http_status": 404,
        "message": "Customer not found."
    }
}

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/batch/customers?customer_id[]=13&customer_id[]=14');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/batch/customers?customer_id[]=13&customer_id[]=14");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/batch/customers?customer_id[]=13&customer_id[]=14"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/batch/customers customer_id[]==13 customer_id[]==14 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST batch/customers

Ostatnia modyfikacja 2024-03-20 13:15:19

Dodanie wielu klientów.

URL

https://your-system-name.thulium.com/api/batch/customers

Parametry

customers

wymagany

Lista klientów do dodania. Każdy klient zawiera:
          name

          opcjonalny

Imię klienta.
          surname

          wymagany

Nazwisko klienta.
          email

          opcjonalny

Adres lub adresy e-mail klienta.
          phone_number

          opcjonalny

Numer lub numery telefonu firmy.
          company_id

          opcjonalny

Identyfikator firmy, do której ma być dodany klient.
          type

          opcjonalny

Tekstowa nazwa typu klienta zdefiniowana w systemie.
          group

          opcjonalny

Tekstowa nazwa grupy klienta zdefiniowana w systemie.
          identifier

          opcjonalny

Identyfikator klienta.
          gender

          opcjonalny

Płeć klienta.
          homepage

          opcjonalny

Strona WWW klienta.
          birthdate

          opcjonalny

Data urodzenia klienta.
          nip

          opcjonalny

NIP klienta.
          note

          opcjonalny

Notatka.
          pesel

          opcjonalny

Numer PESEL.
          job

          opcjonalny

Miejsce pracy.
          job_title

          opcjonalny

Stanowisko.
          account_manager

          opcjonalny

Login opiekuna klienta
          custom_fields

          opcjonalny

Obiekt z wartościami pól specjalnych. Przykładowa wartość: "custom_fields":{"field_name_1":"value_1","field_name_2":"value_2"}
          fill_read_only_custom_fields

          opcjonalny

Flaga definiująca czy pola specjalne zostaną wypełnione pomimo posiadania typu READ ONLY. Przykładowa wartość: true
          vip

          opcjonalny

VIP Przykładowa wartość: true
          address

          opcjonalny

Adres klienta.
             street

             opcjonalny

Nazwa ulicy.
             building

             opcjonalny

Numer budynku.
             flat

             opcjonalny

Numer mieszkania.
             postcode

             opcjonalny

Kod pocztowy.
             city

             opcjonalny

Miasto.
             country

             opcjonalny

Kraj.
          invoice_address

          opcjonalny

Adres do faktur.
             street

             opcjonalny

Nazwa ulicy.
             building

             opcjonalny

Numer budynku.
             flat

             opcjonalny

Numer mieszkania.
             postcode

             opcjonalny

Kod pocztowy.
             city

             opcjonalny

Miasto.
             country

             opcjonalny

Kraj.
          mail_drop_address

          opcjonalny

Adres korespondencyjny.
             street

             opcjonalny

Nazwa ulicy.
             building

             opcjonalny

Numer budynku.
             flat

             opcjonalny

Numer mieszkania.
             postcode

             opcjonalny

Kod pocztowy.
             city

             opcjonalny

Miasto.
             country

             opcjonalny

Kraj.

Uwagi

Pole custom_fields musi zwawierać mapę pól specjalnych gdzie kluczem jest tekstowa nazwa pola specjalnego a wartością treść którą chcemy ustawić.
W obiekcie możemy przekazać tylko te pola, których wartości chcemy ustawić. Jeśli przekazana wartość pola specjalnego będzie pusta zawartość pola zostanie usunięta.
W przypadku gdy pole specjalne nie istnieje zostanie utworzone.
Odpowiedź zawiera obiekt, którego klucze odpowiadają kolejności klientów na liście customers

Przykładowy request

POST https://your-system-name.thulium.com/api/batch/customers
Dane {"customers":[{"surname":"Kowalski"},{"phone_number":"333444555"}]}

Przykładowy response

{
    "0": {
        "http_status": 201,
        "customer_id": "13"
    },
    "1": {
        "http_status": 400,
        "message": "Phone number must be numeric."
    }
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"customers":[{"surname":"Kowalski"},{"phone_number":"333444555"}]}';

$request curl_init('https://your-system-name.thulium.com/api/batch/customers');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/batch/customers", "{\"customers\":[{\"surname\":\"Kowalski\"},{\"phone_number\":\"333444555\"}]}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"customers":[{"surname":"Kowalski"},{"phone_number":"333444555"}]}' "https://your-system-name.thulium.com/api/batch/customers"

HTTPie

echo '{"customers":[{"surname":"Kowalski"},{"phone_number":"333444555"}]}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/batch/customers

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT batch/customers

Ostatnia modyfikacja 2024-03-20 13:15:19

Edycja wielu klientów.

URL

https://your-system-name.thulium.com/api/batch/customers

Parametry

customers

wymagany

Lista klientów do edycji. Każdy klient zawiera:
          customer_id

          wymagany

Identyfikator klienta który ma zostań zaktualizowany.
          name

          opcjonalny

Imię klienta.
          surname

          opcjonalny

Nazwisko klienta.
          email

          opcjonalny

Adres lub adresy e-mail klienta.
          phone_number

          opcjonalny

Numer lub numery telefonu firmy.
          company_id

          opcjonalny

Identyfikator firmy, do której ma być dodany klient.
          type

          opcjonalny

Tekstowa nazwa typu klienta zdefiniowana w systemie.
          group

          opcjonalny

Tekstowa nazwa grupy klienta zdefiniowana w systemie.
          identifier

          opcjonalny

Identyfikator klienta.
          gender

          opcjonalny

Płeć klienta.
          homepage

          opcjonalny

Strona WWW klienta.
          birthdate

          opcjonalny

Data urodzenia klienta.
          nip

          opcjonalny

NIP klienta.
          note

          opcjonalny

Notatka.
          pesel

          opcjonalny

Numer PESEL.
          job

          opcjonalny

Miejsce pracy.
          job_title

          opcjonalny

Stanowisko.
          account_manager

          opcjonalny

Login opiekuna klienta
          custom_fields

          opcjonalny

Obiekt z wartościami pól specjalnych. Przykładowa wartość: "custom_fields":{"field_name_1":"value_1","field_name_2":"value_2"}
          fill_read_only_custom_fields

          opcjonalny

Flaga definiująca czy pola specjalne zostaną wypełnione pomimo posiadania typu READ ONLY. Przykładowa wartość: true
          vip

          opcjonalny

VIP Przykładowa wartość: true
          address

          opcjonalny

Adres klienta.
             street

             opcjonalny

Nazwa ulicy.
             building

             opcjonalny

Numer budynku.
             flat

             opcjonalny

Numer mieszkania.
             postcode

             opcjonalny

Kod pocztowy.
             city

             opcjonalny

Miasto.
             country

             opcjonalny

Kraj.
          invoice_address

          opcjonalny

Adres do faktur.
             street

             opcjonalny

Nazwa ulicy.
             building

             opcjonalny

Numer budynku.
             flat

             opcjonalny

Numer mieszkania.
             postcode

             opcjonalny

Kod pocztowy.
             city

             opcjonalny

Miasto.
             country

             opcjonalny

Kraj.
          mail_drop_address

          opcjonalny

Adres korespondencyjny.
             street

             opcjonalny

Nazwa ulicy.
             building

             opcjonalny

Numer budynku.
             flat

             opcjonalny

Numer mieszkania.
             postcode

             opcjonalny

Kod pocztowy.
             city

             opcjonalny

Miasto.
             country

             opcjonalny

Kraj.

Przykładowy request

PUT https://your-system-name.thulium.com/api/batch/customers
Dane { "customers": [ { "customer_id": "13", "surname": "Kowalski" }, { "customer_id": "14", "phone_number": "333444555" } ] }

Przykładowy response

{
    "13": {
        "http_status": 204
    },
    "14": {
        "http_status": 404,
        "message": "Customer not found."
    }
}

Przykładowe wywołanie


PHP

<?php
$data 
'{
    "customers": [
        {
            "customer_id": "13",
            "surname": "Kowalski"
        },
        {
            "customer_id": "14",
            "phone_number": "333444555"
        }
    ]
}'
;

$request curl_init('https://your-system-name.thulium.com/api/batch/customers');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/batch/customers", "{
    \"customers\": [
        {
            \"customer_id\": \"13\",
            \"surname\": \"Kowalski\"
        },
        {
            \"customer_id\": \"14\",
            \"phone_number\": \"333444555\"
        }
    ]
}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{
    "customers": [
        {
            "customer_id": "13",
            "surname": "Kowalski"
        },
        {
            "customer_id": "14",
            "phone_number": "333444555"
        }
    ]
}' "https://your-system-name.thulium.com/api/batch/customers"

HTTPie

echo '{
    "customers": [
        {
            "customer_id": "13",
            "surname": "Kowalski"
        },
        {
            "customer_id": "14",
            "phone_number": "333444555"
        }
    ]
}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/batch/customers

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE outbounds/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwa kampanię wraz ze wszystkimi rekordami.

URL

https://your-system-name.thulium.com/api/outbounds/:id

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
delete_recordings

opcjonalny

Flaga, która określa, czy nagrania mają zostać usunięte. Domyślnie wyłączona. Przykładowa wartość: true

Uwagi

Kampania oraz nagrania nie są usuwane natychmiast, tylko dodawane do kolejki do usunięcia. Usunięcie wszystkich rekordów i nagrań może potrwać do kilku godzin.

Przykładowy request

DELETE https://your-system-name.thulium.com/api/outbounds/12?delete_recordings=true

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/outbounds/12?delete_recordings=true');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/outbounds/12?delete_recordings=true");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds/12?delete_recordings=true"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/outbounds/12 delete_recordings==true Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbounds

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę wszystkich kampanii.

URL

https://your-system-name.thulium.com/api/outbounds

Przykładowy request

GET https://your-system-name.thulium.com/api/outbounds

Przykładowy response

[
    {
        "id": "00002",
        "name": "API test",
        "crm": true,
        "order": 100,
        "parity": 50
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbounds');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbounds");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbounds Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbounds/:id/agents

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę wszystkich agentów w danej kampanii.

URL

https://your-system-name.thulium.com/api/outbounds/:id/agents

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001

Przykładowy request

GET https://your-system-name.thulium.com/api/outbounds/00001/agents

Przykładowy response

[
    {
        "login": "jkowalski",
        "number": "3113",
        "active": true,
        "active_in_outbound": true,
        "agent_id": 12
    },
    {
        "login": "anowak",
        "number": "3422",
        "active": false,
        "active_in_outbound": false,
        "agent_id": 43
    }
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbounds/00001/agents');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbounds/00001/agents");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds/00001/agents"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbounds/00001/agents Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbounds/:id/stats

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca statystykę rekordów dla kampanii.

URL

https://your-system-name.thulium.com/api/outbounds/:id/stats

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001

Uwagi

Zwracane pola to:
  • id identyfikator kampanii
  • records_count całkowita liczba rekordów w kampanii
  • completion_percent procent ukończenia kampanii

Przykładowy request

GET https://your-system-name.thulium.com/api/outbounds/00001/stats

Przykładowy response

{
    "id": "00001",
    "records_count": 1324,
    "completion_percent": 14.87
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbounds/00001/stats');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbounds/00001/stats");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds/00001/stats"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbounds/00001/stats Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbounds/:id/statuses

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę wszystkich statusów w danej kampanii.

URL

https://your-system-name.thulium.com/api/outbounds/:id/statuses

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001

Uwagi

Pole system_status:
  • TO_CALL Do dzwonienia (świeżo dodane rekordy)
  • IN_PROGRESS Obrabiane
  • CALL Dzwonić
  • MY_RECORD Mój rekord
  • NO_CALL Nie dzwonić
  • ABANDONED_AFTER_N_TRIES Odrzucony po n próbach
  • CALL_NO_SOONER_THAN Kontakt nie wcześniej niż
  • CALL_PROGRESSIVE Dzwonić w trybie progressive (np. dla spadów w trybie predictive)

Przykładowy request

GET https://your-system-name.thulium.com/api/outbounds/00001/statuses

Przykładowy response

[
    {
        "system_status": "CALL",
        "status_id": "3",
        "dictionary_status_id": 2,
        "name": "Contact needed"
    },
    {
        "system_status": "NO_CALL",
        "status_id": "4",
        "dictionary_status_id": null,
        "name": "Not interested"
    }
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbounds/00001/statuses');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbounds/00001/statuses");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds/00001/statuses"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbounds/00001/statuses Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbounds/stats

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca statystykę rekordów dla wszystkich aktywnych kampanii.

URL

https://your-system-name.thulium.com/api/outbounds/stats

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001

Uwagi

Zwracane pola to:
  • id identyfikator kampanii
  • records_count całkowita liczba rekordów w kampanii
  • completion_percent procent ukończenia kampanii

Przykładowy request

GET https://your-system-name.thulium.com/api/outbounds/stats

Przykładowy response

[
    {
        "id": "00001",
        "records_count": 1324,
        "completion_percent": 14.87
    },
    {
        "id": "00002",
        "records_count": 20,
        "completion_percent": 23
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbounds/stats');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbounds/stats");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds/stats"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbounds/stats Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST outbounds

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodaje kampanie.

URL

https://your-system-name.thulium.com/api/outbounds

Parametry

id

opcjonalny

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
name

wymagany

Nazwa tworzonej kampanii. Przykładowa wartość: Kampania sprzedażowa 2015
dialer

wymagany

Typ dialera dla tworzonej kampanii . Przykładowa wartość: preview
crm

wymagany

Określa sposób zasilania kampanii: CRM lub CSV. Przykładowa wartość: true
active

opcjonalny

Określa czy kampania ma być aktywna po utworzeniu. Domyślnie aktywna. Przykładowa wartość: true
start_date

opcjonalny

Data rozpoczęcia kampanii. Domyślnie dzisiejszy dzień. Przykładowa wartość: 2015-10-05
end_date

opcjonalny

Data zakończenia kampanii. Przykładowa wartość: 2015-10-25
order

opcjonalny

Kolejność kampanii, wartość z zakresu 1-99999. Domyślnie 50 Przykładowa wartość: 50
parity

opcjonalny

Parytet kampanii, wartość z zakresu 1-100. Domyślnie 50 Przykładowa wartość: 50
parameters

opcjonalny

Obiekt parametrów które będą ustawione dla kampanii. Przykładowa wartość: { "caller_id": "123456789" }
group_id

opcjonalny

Id grupy kampani. Przykładowa wartość: 15

Uwagi

Pole parameters musi zawierać mapę gdzie kluczem jest nazwa parametru a wartością treść, którą chcemy ustawić.
Obsługiwane parametry:
  • caller_id - numer którym będzie się prezentować kampania
  • preview_timeout - liczba sekund jakie agent ma na zapoznanie z rekordem
  • predictive_max_calls - maksymalna wartość współczynnika naddzwaniania
  • predictive_min_calls - minimalna wartość współczynnika naddzwaniania
Pole dialer posiada mozliwość wybrania jednego z poniższych dialerów:
  • predictive
  • progressive
  • preview

Przykładowy request

POST https://your-system-name.thulium.com/api/outbounds
Dane {"id":"09098","name":"Some outbound name","start_date":"2015-09-10","end_date":"2015-09-12","dialer":"predictive","crm":true,"parameters":{"caller_id":"1234"}}

Przykładowy response

{
    "id": "09098","outbound_id": "21"
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"id":"09098","name":"Some outbound name","start_date":"2015-09-10","end_date":"2015-09-12","dialer":"predictive","crm":true,"parameters":{"caller_id":"1234"}}';

$request curl_init('https://your-system-name.thulium.com/api/outbounds');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/outbounds", "{\"id\":\"09098\",\"name\":\"Some outbound name\",\"start_date\":\"2015-09-10\",\"end_date\":\"2015-09-12\",\"dialer\":\"predictive\",\"crm\":true,\"parameters\":{\"caller_id\":\"1234\"}}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"id":"09098","name":"Some outbound name","start_date":"2015-09-10","end_date":"2015-09-12","dialer":"predictive","crm":true,"parameters":{"caller_id":"1234"}}' "https://your-system-name.thulium.com/api/outbounds"

HTTPie

echo '{"id":"09098","name":"Some outbound name","start_date":"2015-09-10","end_date":"2015-09-12","dialer":"predictive","crm":true,"parameters":{"caller_id":"1234"}}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/outbounds

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST outbounds/:id/add_agents

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodaje listę agentów do kampanii.

URL

https://your-system-name.thulium.com/api/outbounds/:id/add_agents

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
logins

wymagany

Tablica loginów agentów, którzy będą dodani do kampanii. Przykładowa wartość: ["anowak", "jkowalski"]

Przykładowy request

POST https://your-system-name.thulium.com/api/outbounds/00001/add_agents
Dane {"logins":["anowak","jkowalski"]}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"logins":["anowak","jkowalski"]}';

$request curl_init('https://your-system-name.thulium.com/api/outbounds/00001/add_agents');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/outbounds/00001/add_agents", "{\"logins\":[\"anowak\",\"jkowalski\"]}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"logins":["anowak","jkowalski"]}' "https://your-system-name.thulium.com/api/outbounds/00001/add_agents"

HTTPie

echo '{"logins":["anowak","jkowalski"]}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/outbounds/00001/add_agents

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST outbounds/:id/clone

Ostatnia modyfikacja 2024-03-20 13:15:19
Klonuje kampanię.

URL

https://your-system-name.thulium.com/api/outbounds/:id/clone

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
new_id

opcjonalny

Pięcioznakowy identyfikator nowej kampanii. Zostanie wygenerowany jeśli nie zostanie przesłany. Przykładowa wartość: 02139
name

wymagany

Nazwa nowej kampanii. Przykładowa wartość: Kampania sprzedażowa 2015
start_date

opcjonalny

Data rozpoczęcia kampanii. Domyślnie dzisiejszy dzień. Przykładowa wartość: 2015-10-05
end_date

opcjonalny

Data zakończenia kampanii. Przykładowa wartość: 2015-10-25
parameters

opcjonalny

Obiekt parametrów które będą ustawione dla kampanii. Przykładowa wartość: { "caller_id": "123456789" }

Przykładowy request

POST https://your-system-name.thulium.com/api/outbounds/00001/clone
Dane {"new_id":"77744","name":"New cloned outbound","start_date":"2015-09-10","end_date":"2015-09-12","parameters":{"caller_id":"1234"}}

Przykładowy response

{
    "id": "77744"
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"new_id":"77744","name":"New cloned outbound","start_date":"2015-09-10","end_date":"2015-09-12","parameters":{"caller_id":"1234"}}';

$request curl_init('https://your-system-name.thulium.com/api/outbounds/00001/clone');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/outbounds/00001/clone", "{\"new_id\":\"77744\",\"name\":\"New cloned outbound\",\"start_date\":\"2015-09-10\",\"end_date\":\"2015-09-12\",\"parameters\":{\"caller_id\":\"1234\"}}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"new_id":"77744","name":"New cloned outbound","start_date":"2015-09-10","end_date":"2015-09-12","parameters":{"caller_id":"1234"}}' "https://your-system-name.thulium.com/api/outbounds/00001/clone"

HTTPie

echo '{"new_id":"77744","name":"New cloned outbound","start_date":"2015-09-10","end_date":"2015-09-12","parameters":{"caller_id":"1234"}}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/outbounds/00001/clone

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST outbounds/:id/remove_agents

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwa agentów z kampanii.

URL

https://your-system-name.thulium.com/api/outbounds/:id/remove_agents

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
logins

wymagany

Tablica loginów agentów, którzy będą usunięci z kampanii. Przykładowa wartość: ["anowak", "jkowalski"]

Przykładowy request

POST https://your-system-name.thulium.com/api/outbounds/00001/remove_agents
Dane {"logins":["anowak","jkowalski"]}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"logins":["anowak","jkowalski"]}';

$request curl_init('https://your-system-name.thulium.com/api/outbounds/00001/remove_agents');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/outbounds/00001/remove_agents", "{\"logins\":[\"anowak\",\"jkowalski\"]}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"logins":["anowak","jkowalski"]}' "https://your-system-name.thulium.com/api/outbounds/00001/remove_agents"

HTTPie

echo '{"logins":["anowak","jkowalski"]}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/outbounds/00001/remove_agents

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST outbounds/:id/set_agents

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodaje i usuwa agentów z kampanii.

URL

https://your-system-name.thulium.com/api/outbounds/:id/set_agents

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
logins

wymagany

Tablica loginów agentów, którzy mają być jedynymi agentami przypisanymi do kampanii. Przykładowa wartość: ["anowak", "jkowalski"]

Uwagi

Jeśli agent jest dodany do kampanii a nie został wysłany w liście agentów, zostanie usunięty.

Przykładowy request

POST https://your-system-name.thulium.com/api/outbounds/00001/set_agents
Dane {"logins":["anowak","jkowalski"]}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"logins":["anowak","jkowalski"]}';

$request curl_init('https://your-system-name.thulium.com/api/outbounds/00001/set_agents');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/outbounds/00001/set_agents", "{\"logins\":[\"anowak\",\"jkowalski\"]}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"logins":["anowak","jkowalski"]}' "https://your-system-name.thulium.com/api/outbounds/00001/set_agents"

HTTPie

echo '{"logins":["anowak","jkowalski"]}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/outbounds/00001/set_agents

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT outbounds/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Aktualizuje kampanie.

URL

https://your-system-name.thulium.com/api/outbounds/:id

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
name

opcjonalny

Nazwa tworzonej kampanii. Przykładowa wartość: Kampania sprzedażowa 2015
dialer

opcjonalny

Typ dialera dla tworzonej kampanii . Przykładowa wartość: preview
active

opcjonalny

Określa czy kampania ma być aktywna po utworzeniu. Domyślnie aktywna. Przykładowa wartość: true
start_date

opcjonalny

Data rozpoczęcia kampanii. Domyślnie dzisiejszy dzień. Przykładowa wartość: 2015-10-05
end_date

opcjonalny

Data zakończenia kampanii. Przykładowa wartość: 2015-10-25
order

opcjonalny

Kolejność kampanii, wartość z zakresu 1-99999. Domyślnie 50 Przykładowa wartość: 50
parity

opcjonalny

Parytet kampanii, wartość z zakresu 1-100. Domyślnie 50 Przykładowa wartość: 50
parameters

opcjonalny

Obiekt parametrów które będą ustawione dla kampanii. Przykładowa wartość: { "caller_id": "123456789" }
group_id

opcjonalny

Id grupy kampani. Przykładowa wartość: 15

Uwagi

Pole parameters musi zawierać mapę gdzie kluczem jest nazwa parametru a wartością treść, którą chcemy ustawić.
Obsługiwane parametry:
  • caller_id - numer którym będzie się prezentować kampania
  • preview_timeout - liczba sekund jakie agent ma na zapoznanie z rekordem
  • predictive_max_calls - maksymalna wartość współczynnika naddzwaniania
  • predictive_min_calls - minimalna wartość współczynnika naddzwaniania
Pole dialer posiada mozliwość wybrania jednego z poniższych dialerów:
  • predictive
  • progressive
  • preview

Przykładowy request

PUT https://your-system-name.thulium.com/api/outbounds/09098
Dane {"name":"Some new name","active":true,"parameters":{"caller_id":"1234"}}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"name":"Some new name","active":true,"parameters":{"caller_id":"1234"}}';

$request curl_init('https://your-system-name.thulium.com/api/outbounds/09098');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/outbounds/09098", "{\"name\":\"Some new name\",\"active\":true,\"parameters\":{\"caller_id\":\"1234\"}}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{"name":"Some new name","active":true,"parameters":{"caller_id":"1234"}}' "https://your-system-name.thulium.com/api/outbounds/09098"

HTTPie

echo '{"name":"Some new name","active":true,"parameters":{"caller_id":"1234"}}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/outbounds/09098

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE batch/outbounds

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie wielu kampanii wraz ze wszystkimi rekordami.

URL

https://your-system-name.thulium.com/api/batch/outbounds

Parametry

id[]

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
delete_recordings

opcjonalny

Flaga, która określa, czy nagrania mają zostać usunięte. Domyślnie wyłączona. Przykładowa wartość: true

Uwagi

Kampania oraz nagrania nie są usuwane natychmiast, tylko dodawane do kolejki do usunięcia. Usunięcie wszystkich rekordów i nagrań może potrwać do kilku godzin.
Możliwe statusy odpowiedzi:
  • REMOVAL_QUEUED - kampania dodana do kolejki
  • NOT_EXIST - kampania nie istnieje
  • ALREADY_QUEUED - kampania była wcześniej dodana do kolejki

Przykładowy request

DELETE https://your-system-name.thulium.com/api/batch/outbounds?id[]=00001&id[]=00002&id[]=00003&delete_recordings=true

Przykładowy response

[
    {
        "http_status": 200,
        "id": "00001",
        "status": "REMOVAL_QUEUED"
    },
    {
        "http_status": 404,
        "id": "00002",
        "status": "NOT_EXIST"
    },
    {
        "http_status": 400,
        "id": "00003",
        "status": "ALREADY_QUEUED"
    }
]

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/batch/outbounds?id[]=00001&id[]=00002&id[]=00003&delete_recordings=true');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/batch/outbounds?id[]=00001&id[]=00002&id[]=00003&delete_recordings=true");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/batch/outbounds?id[]=00001&id[]=00002&id[]=00003&delete_recordings=true"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/batch/outbounds id[]==00001 id[]==00002 id[]==00003 delete_recordings==true Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE crm_outbounds/:id/records/:customer_id

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie rekordu z kampanii CRM.

Rekord, który jest w trakcie rozmowy nie zostanie usunięty.

URL

https://your-system-name.thulium.com/api/crm_outbounds/:id/records/:customer_id

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
customer_id

wymagany

Identyfikator klienta zapisanego w CRM. Przykładowa wartość: 441

Przykładowy request

DELETE https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET crm_outbounds/:id/records

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę rekordów w kampanii wraz z podstawowymi parametrami w kolejności dodawania do kampanii.

Parametr count zwraca liczbę znalezionych rekordów w kampanii (uwzględniając filtry).

URL

https://your-system-name.thulium.com/api/crm_outbounds/:id/records

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 100. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10
order

opcjonalny

Lista pól, po których będą posortowane rezultaty. Prefiks '-' oznacza sortowanie malejące, brak prefiksu rosnące. Możliwe jest sortowanie po polach: next_call_date. Przykładowa wartość: -next_call_date
status_id[]

opcjonalny

Identyfikator statusu z kampanii (jeden lub wiele). Przykładowa wartość: [10, 15]
system_status[]

opcjonalny

Identyfikator statusu systemowego (jeden lub wiele). Przykładowa wartość: [TO_CALL, CALL]
create_date_from

opcjonalny

Minimalna data utworzenia rekordu. Format YYYY-MM-DD. Przykładowa wartość: 2016-10-18
create_date_to

opcjonalny

Maksymalna data utworzenia rekordu. Format YYYY-MM-DD. Przykładowa wartość: 2016-10-20
call_date_from

opcjonalny

Minimalna data ostatniej rozmowy. Format YYYY-MM-DD. Przykładowa wartość: 2016-10-18
call_date_to

opcjonalny

Maksymalna data ostatniej rozmowy. Format YYYY-MM-DD. Przykładowa wartość: 2016-10-20
include_customer

opcjonalny

Czy dołączyć dane klienta do zwracanych rekordów. Przykładowa wartość: true
include_custom_fields

opcjonalny

Czy zwracać pola specjalne klienta. Przykładowa wartość: true
include_address

opcjonalny

Czy zwracać adres klienta. Przykładowa wartość: true
include_invoice_address

opcjonalny

Czy zwracać adres do faktur. Przykładowa wartość: true
include_mail_drop_address

opcjonalny

Czy zwracać adres korespondencyjny. Przykładowa wartość: true

Uwagi

Pole system_status:
  • TO_CALL Do dzwonienia (świeżo dodane rekordy)
  • IN_PROGRESS Obrabiane
  • CALL Dzwonić
  • MY_RECORD Mój rekord
  • NO_CALL Nie dzwonić
  • ABANDONED_AFTER_N_TRIES Odrzucony po n próbach
  • CALL_NO_SOONER_THAN Kontakt nie wcześniej niż
  • CALL_PROGRESSIVE Dzwonić w trybie progressive (np. dla spadów w trybie predictive)

Przykładowy request

GET https://your-system-name.thulium.com/api/crm_outbounds/00001/records?limit=5&offset=0&order=-next_call_date&status_id[]=10&status_id[]=15

Przykładowy response

{
        "count": 1,
        "result": [
            {
                "record_id": 228,
                "phone_number": "5555",
                "system_status": "NO_CALL",
                "status": "Nie dzwonić",
                "status_id": 5,
                "call_date": "2016-10-19 14:02",
                "create_date": "2016-10-18 12:02",
                "next_call_date": "",
                "agent_name": "",
                "agent_login": "",
                "customer_id": 311,
                "last_note": "Ostatnia notatka dla rekordu",
                "order":""
            }
        ]
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/crm_outbounds/00001/records?limit=5&offset=0&order=-next_call_date&status_id[]=10&status_id[]=15');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/crm_outbounds/00001/records?limit=5&offset=0&order=-next_call_date&status_id[]=10&status_id[]=15");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/crm_outbounds/00001/records?limit=5&offset=0&order=-next_call_date&status_id[]=10&status_id[]=15"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/crm_outbounds/00001/records limit==5 offset==0 order==-next_call_date status_id[]==10 status_id[]==15 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET crm_outbounds/:id/records/:customer_id

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca informacje o rekordzie w kampanii zasilanej z CRM.

URL

https://your-system-name.thulium.com/api/crm_outbounds/:id/records/:customer_id

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
customer_id

wymagany

Identyfikator klienta zapisanego w CRM. Przykładowa wartość: 441

Uwagi

Pole system_status:
  • TO_CALL Do dzwonienia (świeżo dodane rekordy)
  • IN_PROGRESS Obrabiane
  • CALL Dzwonić
  • MY_RECORD Mój rekord
  • NO_CALL Nie dzwonić
  • ABANDONED_AFTER_N_TRIES Odrzucony po n próbach
  • CALL_NO_SOONER_THAN Kontakt nie wcześniej niż
  • CALL_PROGRESSIVE Dzwonić w trybie progressive (np. dla spadów w trybie predictive)

Przykładowy request

GET https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441

Przykładowy response

{
    "record_id": 47,
    "phone_number": "158433367",
    "system_status": "NO_CALL",
    "status": "Do not call",
    "status_id": 6,
    "call_date": "2016-10-19 14:02",
    "create_date": "2016-10-18 12:02",
    "next_call_date": "",
    "agent_name": "",
    "agent_login": "",
    "customer_id": 441,
    "last_note": "Last note for record",
    "order": ""
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST crm_outbounds/:id/records

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodanie rekordu do kampanii CRM.

URL

https://your-system-name.thulium.com/api/crm_outbounds/:id/records

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
customer_id

wymagany

Identyfikator klienta zapisanego w CRM. Przykładowa wartość: 441
status_id

opcjonalny

Identyfikator statusu rekordu w kampanii. Przykładowa wartość: 8
dictionary_status_id

opcjonalny

Identyfikator statusu słownikowego. Przykładowa wartość: 8
agent_login

opcjonalny

Login agenta do którego zostanie przypisany rekord. Wymagane dla statusu systemowego MY_RECORD. Przykładowa wartość: j.doe
next_call_date

opcjonalny

Data następnego kontaktu w formacie YYYY-MM-DD hh:mm. Wymagane dla statusu systemowego MY_RECORD i CALL_NO_SOONER_THAN. Przykładowa wartość: 2018-05-24 12:24
order

opcjonalny

Kolejność rekordu Przykładowa wartość: 50

Przykładowy request

POST https://your-system-name.thulium.com/api/crm_outbounds/00001/records
Dane {"customer_id":441,"status_id":3}

Przykładowy response

{
    "record_id": "231"
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"customer_id":441,"status_id":3}';

$request curl_init('https://your-system-name.thulium.com/api/crm_outbounds/00001/records');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/crm_outbounds/00001/records", "{\"customer_id\":441,\"status_id\":3}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"customer_id":441,"status_id":3}' "https://your-system-name.thulium.com/api/crm_outbounds/00001/records"

HTTPie

echo '{"customer_id":441,"status_id":3}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/crm_outbounds/00001/records

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST crm_outbounds/:id/records/:customer_id/copy_notes

Ostatnia modyfikacja 2024-03-20 13:15:19
Kopiuje notatki z kampanii do CRM.

URL

https://your-system-name.thulium.com/api/crm_outbounds/:id/records/:customer_id/copy_notes

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
customer_id

wymagany

Identyfikator klienta zapisanego w CRM. Przykładowa wartość: 441

Przykładowy request

POST https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441/copy_notes

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441/copy_notes');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441/copy_notes", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441/copy_notes"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441/copy_notes

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT crm_outbounds/:id/records/:customer_id

Ostatnia modyfikacja 2024-03-20 13:15:19
Edycja rekordu z kampanii zasilanej z CRM.

URL

https://your-system-name.thulium.com/api/crm_outbounds/:id/records/:customer_id

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
customer_id

wymagany

Identyfikator klienta zapisanego w CRM. Przykładowa wartość: 441
status_id

opcjonalny

Identyfikator statusu rekordu w kampanii. Przykładowa wartość: 8
dictionary_status_id

opcjonalny

Identyfikator statusu słownikowego. Przykładowa wartość: 8
agent_login

opcjonalny

Login agenta do którego zostanie przypisany rekord. Wymagane dla statusu systemowego MY_RECORD. Przykładowa wartość: j.doe
next_call_date

opcjonalny

Data następnego kontaktu w formacie YYYY-MM-DD hh:mm. Wymagane dla statusu systemowego MY_RECORD i CALL_NO_SOONER_THAN. Przykładowa wartość: 2018-05-24 12:24
order

opcjonalny

Kolejność rekordu Przykładowa wartość: 50

Przykładowy request

PUT https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441
Dane {"status_id":"3"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"status_id":"3"}';

$request curl_init('https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441", "{\"status_id\":\"3\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{"status_id":"3"}' "https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441"

HTTPie

echo '{"status_id":"3"}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/crm_outbounds/00001/records/441

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE batch/crm_outbounds/:id/records

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie wielu rekordów z kampanii CRM.

Rekord, który jest w trakcie rozmowy nie zostanie usunięty (zwróci status CALL_IN_PROGRESS).

URL

https://your-system-name.thulium.com/api/batch/crm_outbounds/:id/records

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
customer_id[]

wymagany

Identyfikator klienta zapisanego w CRM (jeden lub wiele). Przykładowa wartość: 441

Przykładowy request

DELETE https://your-system-name.thulium.com/api/batch/crm_outbounds/00001/records?customer_id[]=441&customer_id[]=442

Przykładowy response

{
    "441": {
        "http_status": 200,
        "record_id": 5235,
        "status": "REMOVED"
    },
    "442": {
        "http_status": 404,
        "status":"NOT_EXIST"
    }
}

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/batch/crm_outbounds/00001/records?customer_id[]=441&customer_id[]=442');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/batch/crm_outbounds/00001/records?customer_id[]=441&customer_id[]=442");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/batch/crm_outbounds/00001/records?customer_id[]=441&customer_id[]=442"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/batch/crm_outbounds/00001/records customer_id[]==441 customer_id[]==442 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST batch/crm_outbounds/:id/records

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodanie wielu rekordów do kampanii CRM.

W rezultacie zwracana jest lista klientów wraz z informacją o statusie oraz identyfikatorze dodanego rekordu. Zwracany status przyjmować może dwie wartości:
ADDED - klient został dodany do kampanii
ALREADY_EXISTS - klient już był dodany do kampanii,
FAILED - dodanie klienta do kampanii nie powiodło się.

URL

https://your-system-name.thulium.com/api/batch/crm_outbounds/:id/records

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
records

wymagany

Lista rekordów do dodania. Każdy rekord z parametrami:
          customer_id

          wymagany

Identyfikator klienta zapisanego w CRM. Przykładowa wartość: 441
          status_id

          opcjonalny

Identyfikator statusu rekordu w kampanii. Przykładowa wartość: 8
          dictionary_status_id

          opcjonalny

Identyfikator statusu słownikowego. Przykładowa wartość: 8
          agent_login

          opcjonalny

Login agenta do którego zostanie przypisany rekord. Wymagane dla statusu systemowego MY_RECORD. Przykładowa wartość: j.doe
          next_call_date

          opcjonalny

Data następnego kontaktu w formacie YYYY-MM-DD hh:mm. Wymagane dla statusu systemowego MY_RECORD i CALL_NO_SOONER_THAN. Przykładowa wartość: 2018-05-24 12:24
          order

          opcjonalny

Kolejność rekordu Przykładowa wartość: 50

Przykładowy request

POST https://your-system-name.thulium.com/api/batch/crm_outbounds/00001/records
Dane { "records": [ { "customer_id": 441, "status_id": 3 }, { "customer_id": 445, "status_id": 1 }, { "customer_id": 448, "status_id": 1 } ] }

Przykładowy response

{
    "441": {
        "http_status": 201,
        "record_id": 111,
        "status": "ADDED"
    },
    "445": {
        "http_status": 400,
        "record_id": 100,
        "status": "ALREADY_EXISTS"
    },
    "448": {
        "http_status": 400,
        "status": "FAILED",
        "message": "Customer not found."
    }
}

Przykładowe wywołanie


PHP

<?php
$data 
'{
    "records": [
        {
            "customer_id": 441,
            "status_id": 3
        },
        {
            "customer_id": 445,
            "status_id": 1
        },
        {
            "customer_id": 448,
            "status_id": 1
        }
    ]
}'
;

$request curl_init('https://your-system-name.thulium.com/api/batch/crm_outbounds/00001/records');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/batch/crm_outbounds/00001/records", "{
    \"records\": [
        {
            \"customer_id\": 441,
            \"status_id\": 3
        },
        {
            \"customer_id\": 445,
            \"status_id\": 1
        },
        {
            \"customer_id\": 448,
            \"status_id\": 1
        }
    ]
}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{
    "records": [
        {
            "customer_id": 441,
            "status_id": 3
        },
        {
            "customer_id": 445,
            "status_id": 1
        },
        {
            "customer_id": 448,
            "status_id": 1
        }
    ]
}' "https://your-system-name.thulium.com/api/batch/crm_outbounds/00001/records"

HTTPie

echo '{
    "records": [
        {
            "customer_id": 441,
            "status_id": 3
        },
        {
            "customer_id": 445,
            "status_id": 1
        },
        {
            "customer_id": 448,
            "status_id": 1
        }
    ]
}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/batch/crm_outbounds/00001/records

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE outbounds/:id/records/:phone_number

Ostatnia modyfikacja 2024-03-20 13:15:19

Usuwanie rekordu z kampanii.

Dla zduplikowanych numerów zostaną usunięte wszystkie znalezione rekordy.

Rekord, który jest w trakcie rozmowy nie zostanie usunięty.

URL

https://your-system-name.thulium.com/api/outbounds/:id/records/:phone_number

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
phone_number

wymagany

Numer telefonu który zostanie usunięty z kampanii. Przykładowa wartość: 333444555
search_in_additional_numbers

opcjonalny

Flaga odpowiedzialna za wyszukiwanie w numerach dodatkowych. Przykładowa wartość: true

Przykładowy request

DELETE https://your-system-name.thulium.com/api/outbounds/00001/records/333444555

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/outbounds/00001/records/333444555');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/outbounds/00001/records/333444555");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds/00001/records/333444555"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/outbounds/00001/records/333444555 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE outbounds/:id/records_by_identifier/:identifier

Ostatnia modyfikacja 2024-03-20 13:15:19

Usuwanie rekordu z kampanii.

Rekord, który jest w trakcie rozmowy nie zostanie usunięty.

URL

https://your-system-name.thulium.com/api/outbounds/:id/records_by_identifier/:identifier

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
identifier

wymagany

Unikalny identyfikator rekordu. Przykładowa wartość: 1234567890

Przykładowy request

DELETE https://your-system-name.thulium.com/api/outbounds/00001/records_by_identifier/:record_id

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/outbounds/00001/records_by_identifier/:record_id');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/outbounds/00001/records_by_identifier/:record_id");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds/00001/records_by_identifier/:record_id"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/outbounds/00001/records_by_identifier/:record_id Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbounds/:id/records

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę rekordów w kampanii wraz z podstawowymi parametrami w kolejności dodawania do kampanii.

Parametr count zwraca liczbę znalezionych rekordów w kampanii (uwzględniając filtry).

URL

https://your-system-name.thulium.com/api/outbounds/:id/records

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 100. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10
status_id[]

opcjonalny

Identyfikator statusu z kampanii (jeden lub wiele). Przykładowa wartość: [10, 15]
system_status[]

opcjonalny

Identyfikator statusu systemowego (jeden lub wiele). Przykładowa wartość: [TO_CALL, CALL]
create_date_from

opcjonalny

Minimalna data utworzenia rekordu. Format YYYY-MM-DD. Przykładowa wartość: 2016-10-18
create_date_to

opcjonalny

Maksymalna data utworzenia rekordu. Format YYYY-MM-DD. Przykładowa wartość: 2016-10-20
call_date_from

opcjonalny

Minimalna data ostatniej rozmowy. Format YYYY-MM-DD. Przykładowa wartość: 2016-10-18
call_date_to

opcjonalny

Maksymalna data ostatniej rozmowy. Format YYYY-MM-DD. Przykładowa wartość: 2016-10-20

Uwagi

Pole system_status:
  • TO_CALL Do dzwonienia (świeżo dodane rekordy)
  • IN_PROGRESS Obrabiane
  • CALL Dzwonić
  • MY_RECORD Mój rekord
  • NO_CALL Nie dzwonić
  • ABANDONED_AFTER_N_TRIES Odrzucony po n próbach
  • CALL_NO_SOONER_THAN Kontakt nie wcześniej niż
  • CALL_PROGRESSIVE Dzwonić w trybie progressive (np. dla spadów w trybie predictive)

Przykładowy request

GET https://your-system-name.thulium.com/api/outbounds/00001/records?limit=5&offset=0

Przykładowy response

{
        "count": 1,
        "result": [
            {
                "record_id": 228,
                "phone_number": "5555",
                "system_status": "NO_CALL",
                "status": "Do not call",
                "status_id": 5,
                "call_date": "2016-10-19 14:02",
                "create_date": "2016-10-18 12:02",
                "next_call_date": "",
                "agent_name": "",
                "agent_login": "",
                "last_note": "Last note for record",
                "identifier": "1234567890",
                "order": ""
            }
        ]
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbounds/00001/records?limit=5&offset=0');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbounds/00001/records?limit=5&offset=0");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds/00001/records?limit=5&offset=0"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbounds/00001/records limit==5 offset==0 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbounds/:id/records/:phone_number

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca informacje o rekordzie w kampanii.

URL

https://your-system-name.thulium.com/api/outbounds/:id/records/:phone_number

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
phone_number

wymagany

Numer telefonu dodany do kampanii. Przykładowa wartość: 333444555
include_record_fields

opcjonalny

Flaga odpowiedzialna za pokazywanie pól kampanii. Przykładowa wartość: true
search_in_additional_numbers

opcjonalny

Flaga odpowiedzialna za wyszukiwanie w numerach dodatkowych. Przykładowa wartość: true

Uwagi

W celu dołączenia pól zdefiniowanych w kampanii należy użyć flagi include_record_fields. Przyjmuje ona wartości true/false. Domyślnie jest ustawiona na false.
Przykładowe wywołanie: outbounds/00001/records/333444555?include_record_fields=true
W celu wyszukania po wszystkich numerach - łącznie z dodatkowymi należy użyć flagi search_in_additional_numbers. Przyjmuje ona wartości true/false. Domyślnie jest ustawiona na false.
Przykładowe wywołanie: outbounds/00001/records/333444555?search_in_additional_numbers=true
Pole system_status:
  • TO_CALL Do dzwonienia (świeżo dodane rekordy)
  • IN_PROGRESS Obrabiane
  • CALL Dzwonić
  • MY_RECORD Mój rekord
  • NO_CALL Nie dzwonić
  • ABANDONED_AFTER_N_TRIES Odrzucony po n próbach
  • CALL_NO_SOONER_THAN Kontakt nie wcześniej niż
  • CALL_PROGRESSIVE Dzwonić w trybie progressive (np. dla spadów w trybie predictive)

Przykładowy request

GET https://your-system-name.thulium.com/api/outbounds/00001/records/333444555

Przykładowy response

{
    "record_id": 228,
    "phone_number": "333444555",
    "system_status": "NO_CALL",
    "status": "Do not call",
    "status_id": 5,
    "call_date": "2016-10-19 14:02",
    "create_date": "2016-10-18 12:02",
    "next_call_date": "",
    "agent_name": "",
    "agent_login": "",
    "last_note": "Last note for record",
    "identifier": "1234567890",
    "order": ""
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbounds/00001/records/333444555');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbounds/00001/records/333444555");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds/00001/records/333444555"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbounds/00001/records/333444555 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbounds/:id/records_by_identifier/:identifier

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca informacje o rekordzie w kampanii.

URL

https://your-system-name.thulium.com/api/outbounds/:id/records_by_identifier/:identifier

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
identifier

wymagany

Unikalny identyfikator rekordu. Przykładowa wartość: 1234567890
include_record_fields

opcjonalny

Flaga odpowiedzialna za pokazywanie pól kampanii. Przykładowa wartość: true

Uwagi

W celu dołączenia pól zdefiniowanych w kampanii należy użyć flagi include_record_fields. Przyjmuje ona wartości true/false. Domyślnie jest ustawiona na false.
Przykładowe wywołanie: outbounds/00001/records_by_identifier/1234567890?include_record_fields=true
Pole system_status:
  • TO_CALL Do dzwonienia (świeżo dodane rekordy)
  • IN_PROGRESS Obrabiane
  • CALL Dzwonić
  • MY_RECORD Mój rekord
  • NO_CALL Nie dzwonić
  • ABANDONED_AFTER_N_TRIES Odrzucony po n próbach
  • CALL_NO_SOONER_THAN Kontakt nie wcześniej niż
  • CALL_PROGRESSIVE Dzwonić w trybie progressive (np. dla spadów w trybie predictive)

Przykładowy request

GET https://your-system-name.thulium.com/api/outbounds/00001/records_by_identifier/1234567890

Przykładowy response

{
    "record_id": 228,
    "phone_number": "333444555",
    "system_status": "NO_CALL",
    "status": "Do not call",
    "status_id": 5,
    "call_date": "2016-10-19 14:02",
    "create_date": "2016-10-18 12:02",
    "next_call_date": "",
    "agent_name": "",
    "agent_login": "",
    "last_note": "Last note for record",
    "identifier": "1234567890",
    "order": ""
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbounds/00001/records_by_identifier/1234567890');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbounds/00001/records_by_identifier/1234567890");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds/00001/records_by_identifier/1234567890"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbounds/00001/records_by_identifier/1234567890 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbounds_by_phone_number/:phone_number

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę kampanii, w których jest podany numer telefonu.

Brany pod uwagę jest tylko główny numer telefon.

URL

https://your-system-name.thulium.com/api/outbounds_by_phone_number/:phone_number

Przykładowy request

GET https://your-system-name.thulium.com/api/outbounds_by_phone_number/111222333

Przykładowy response

[
    {
        "id": "00002",
        "name": "API test",
        "status_id": 1,
        "system_status": "CALL"
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbounds_by_phone_number/111222333');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbounds_by_phone_number/111222333");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbounds_by_phone_number/111222333"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbounds_by_phone_number/111222333 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST outbound_status_by_phone_number

Ostatnia modyfikacja 2024-03-20 13:15:19

Wyszukuje wszystkie rekordy na podstawie numeru telefonu, a następnie aktualizuje w nich status kampanii na podstawie podanego statusu słownikowego.

Zwraca listę kampanii, w których zaktualizowano statusy.

Brany pod uwagę jest tylko główny numer telefon.

URL

https://your-system-name.thulium.com/api/outbound_status_by_phone_number

Parametry

status_id

wymagany

Identyfikator statusu słownikowego. Przykładowa wartość: 8
phone_number

wymagany

Numer telefonu w kampanii. Przykładowa wartość: 333444555

Przykładowy request

POST https://your-system-name.thulium.com/api/outbound_status_by_phone_number
Dane { "phone_number": "111222333", "status_id": "3" }

Przykładowy response

{
    "outbound_id": [
        "00001",
        "00002",
        "00003"
    ]
}

Przykładowe wywołanie


PHP

<?php
$data 
'{
    "phone_number": "111222333",
    "status_id": "3"
}'
;

$request curl_init('https://your-system-name.thulium.com/api/outbound_status_by_phone_number');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/outbound_status_by_phone_number", "{
    \"phone_number\": \"111222333\",
    \"status_id\": \"3\"
}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{
    "phone_number": "111222333",
    "status_id": "3"
}' "https://your-system-name.thulium.com/api/outbound_status_by_phone_number"

HTTPie

echo '{
    "phone_number": "111222333",
    "status_id": "3"
}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/outbound_status_by_phone_number

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST outbounds/:id/records

Ostatnia modyfikacja 2024-03-20 13:15:19

Dodanie rekordu do kampanii.

Za pomocą API nie można dodawać zduplikowanych numerów.

URL

https://your-system-name.thulium.com/api/outbounds/:id/records

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
phone_number

wymagany

Numer telefonu, na który będą wykonywane połączenia. Przykładowa wartość: 333444555
status_id

opcjonalny

Identyfikator statusu rekordu w kampanii. Przykładowa wartość: 8
dictionary_status_id

opcjonalny

Identyfikator statusu słownikowego. Przykładowa wartość: 8
identifier

opcjonalny

Unikalny identyfikator rekordu. Przykładowa wartość: 1234567890
agent_login

opcjonalny

Login agenta do którego zostanie przypisany rekord. Wymagane dla statusu systemowego MY_RECORD. Przykładowa wartość: j.doe
next_call_date

opcjonalny

Data następnego kontaktu w formacie YYYY-MM-DD hh:mm. Wymagane dla statusu systemowego MY_RECORD i CALL_NO_SOONER_THAN. Przykładowa wartość: 2018-05-24 12:24
record_fields

opcjonalny

Obiekt z wartościami struktury kampanii. Przykładowa wartość: {"field1":"value1","field2":"value2"}
order

opcjonalny

Kolejność rekordu. Przykładowa wartość: 50

Uwagi

Pole record_fields musi zawierać mapę pól struktury kampanii gdzie kluczem jest tekstowa nazwa pola a wartością treść którą chcemy ustawić.
W obiekcie możemy przekazać tylko te pola, których wartości chcemy ustawić. Jeśli przekazana wartość pola kampanii będzie pusta zawartość pola zostanie usunięta.
W przypadku gdy pole specjalne nie istnieje zostanie zwrócony błąd walidacji.
Wartości pól kampanii możemy ustalać tylko w kampaniach nie CRM.

Przykładowy request

POST https://your-system-name.thulium.com/api/outbounds/00001/records
Dane { "phone_number": "111222333", "status_id": "3", "record_fields": { "field1": "value1", "field2": "value2" } }

Przykładowy response

{
    "record_id": "231"
}

Przykładowe wywołanie


PHP

<?php
$data 
'{
    "phone_number": "111222333",
    "status_id": "3",
    "record_fields": {
        "field1": "value1",
        "field2": "value2"
    }
}'
;

$request curl_init('https://your-system-name.thulium.com/api/outbounds/00001/records');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/outbounds/00001/records", "{
    \"phone_number\": \"111222333\",
    \"status_id\": \"3\",
    \"record_fields\": {
        \"field1\": \"value1\",
        \"field2\": \"value2\"
    }
}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{
    "phone_number": "111222333",
    "status_id": "3",
    "record_fields": {
        "field1": "value1",
        "field2": "value2"
    }
}' "https://your-system-name.thulium.com/api/outbounds/00001/records"

HTTPie

echo '{
    "phone_number": "111222333",
    "status_id": "3",
    "record_fields": {
        "field1": "value1",
        "field2": "value2"
    }
}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/outbounds/00001/records

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT outbounds/:id/records/:phone_number

Ostatnia modyfikacja 2024-03-20 13:15:19

Edytowanie rekordu w kampanii.

Za pomocą API nie można edytować zduplikowanych numerów.

URL

https://your-system-name.thulium.com/api/outbounds/:id/records/:phone_number

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
phone_number

wymagany

Numer telefonu, na który będą wykonywane połączenia. Przykładowa wartość: 333444555
status_id

opcjonalny

Identyfikator statusu rekordu w kampanii. Przykładowa wartość: 8
dictionary_status_id

opcjonalny

Identyfikator statusu słownikowego. Przykładowa wartość: 8
agent_login

opcjonalny

Login agenta do którego zostanie przypisany rekord. Wymagane dla statusu systemowego MY_RECORD. Przykładowa wartość: j.doe
next_call_date

opcjonalny

Data następnego kontaktu w formacie YYYY-MM-DD hh:mm. Wymagane dla statusu systemowego MY_RECORD i CALL_NO_SOONER_THAN. Przykładowa wartość: 2018-05-24 12:24
record_fields

opcjonalny

Obiekt z wartościami struktury kampanii. Przykładowa wartość: {"field1":"value1","field2":"value2"}
search_in_additional_numbers

opcjonalny

Flaga odpowiedzialna za wyszukiwanie w numerach dodatkowych. Przykładowa wartość: true

Uwagi

W celu wyszukania po wszystkich numerach - łącznie z dodatkowymi należy użyć flagi search_in_additional_numbers. Przyjmuje ona wartości true/false. Domyślnie jest ustawiona na false.
Przykładowe wywołanie: outbounds/00001/records/333444555?search_in_additional_numbers=true

Przykładowy request

PUT https://your-system-name.thulium.com/api/outbounds/00001/records/333444555
Dane {"status_id":"3"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"status_id":"3"}';

$request curl_init('https://your-system-name.thulium.com/api/outbounds/00001/records/333444555');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/outbounds/00001/records/333444555", "{\"status_id\":\"3\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{"status_id":"3"}' "https://your-system-name.thulium.com/api/outbounds/00001/records/333444555"

HTTPie

echo '{"status_id":"3"}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/outbounds/00001/records/333444555

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT outbounds/:id/records_by_identifier/:identifier

Ostatnia modyfikacja 2024-03-20 13:15:19

Edytowanie rekordu w kampanii.

URL

https://your-system-name.thulium.com/api/outbounds/:id/records_by_identifier/:identifier

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
identifier

wymagany

Unikalny identyfikator rekordu. Przykładowa wartość: 1234567890
status_id

opcjonalny

Identyfikator statusu rekordu w kampanii. Przykładowa wartość: 8
dictionary_status_id

opcjonalny

Identyfikator statusu słownikowego. Przykładowa wartość: 8
agent_login

opcjonalny

Login agenta do którego zostanie przypisany rekord. Wymagane dla statusu systemowego MY_RECORD. Przykładowa wartość: j.doe
record_fields

opcjonalny

Obiekt z wartościami struktury kampanii. Przykładowa wartość: {"field1":"value1","field2":"value2"}
next_call_date

opcjonalny

Data następnego kontaktu w formacie YYYY-MM-DD hh:mm. Wymagane dla statusu systemowego MY_RECORD i CALL_NO_SOONER_THAN. Przykładowa wartość: 2018-05-24 12:24

Przykładowy request

PUT https://your-system-name.thulium.com/api/outbounds/:id/records_by_identifier/1234567890
Dane {"status_id":"3"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"status_id":"3"}';

$request curl_init('https://your-system-name.thulium.com/api/outbounds/:id/records_by_identifier/1234567890');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/outbounds/:id/records_by_identifier/1234567890", "{\"status_id\":\"3\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{"status_id":"3"}' "https://your-system-name.thulium.com/api/outbounds/:id/records_by_identifier/1234567890"

HTTPie

echo '{"status_id":"3"}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/outbounds/:id/records_by_identifier/1234567890

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE batch/outbounds/:id/records

Ostatnia modyfikacja 2024-03-20 13:15:19

Usuwanie rekordów z kampanii.

Dla zduplikowanych numerów zostaną usunięte wszystkie znalezione rekordy.

Rekord, który jest w trakcie rozmowy nie zostanie usunięty (zwróci status CALL_IN_PROGRESS).

URL

https://your-system-name.thulium.com/api/batch/outbounds/:id/records

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
phone_number[]

wymagany

Numer telefonu który zostanie usunięty z kampanii (jeden lub wiele). Przykładowa wartość: 333444555
search_in_additional_numbers

opcjonalny

Flaga odpowiedzialna za wyszukiwanie w numerach dodatkowych. Przykładowa wartość: true

Przykładowy request

DELETE https://your-system-name.thulium.com/api/batch/outbounds/00001/records/?phone_number[]=441&phone_number[]=442

Przykładowy response

{
    "441": [
        {
            "http_status": 200,
            "record_id": 5235,
            "status": "REMOVED"
        },
        {
            "http_status": 200,
            "record_id": 5226,
            "status": "REMOVED"
        }
    ],
    "442": [
        {
            "http_status": 404,
            "status": "NOT_EXIST"
        }
    ]
}

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/batch/outbounds/00001/records/?phone_number[]=441&phone_number[]=442');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/batch/outbounds/00001/records/?phone_number[]=441&phone_number[]=442");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/batch/outbounds/00001/records/?phone_number[]=441&phone_number[]=442"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/batch/outbounds/00001/records/ phone_number[]==441 phone_number[]==442 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST batch/outbounds/:id/records

Ostatnia modyfikacja 2024-03-20 13:15:19

Dodanie wielu rekordów do kampanii.

Za pomocą API nie można dodawać zduplikowanych numerów.

W rezultacie zwracana jest lista numerów wraz z informacją o statusie oraz identyfikatorze dodanego rekordu. Zwracany status przyjmować może dwie wartości:
ADDED - rekord został dodany do kampanii,
ALREADY_EXISTS - rekord już istnieje w kampanii,
FAILED - dodanie rekordu nie powiodło się.

URL

https://your-system-name.thulium.com/api/batch/outbounds/:id/records

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
records

wymagany

Lista rekordów do dodania. Każdy rekord z parametrami:
          phone_number

          wymagany

Numer telefonu, na który będą wykonywane połączenia. Przykładowa wartość: 333444555
          status_id

          opcjonalny

Identyfikator statusu rekordu w kampanii. Przykładowa wartość: 8
          dictionary_status_id

          opcjonalny

Identyfikator statusu słownikowego. Przykładowa wartość: 8
          identifier

          opcjonalny

Unikalny identyfikator rekordu. Przykładowa wartość: 1234567890
          agent_login

          opcjonalny

Login agenta do którego zostanie przypisany rekord. Wymagane dla statusu systemowego MY_RECORD. Przykładowa wartość: j.doe
          next_call_date

          opcjonalny

Data następnego kontaktu w formacie YYYY-MM-DD hh:mm. Wymagane dla statusu systemowego MY_RECORD i CALL_NO_SOONER_THAN. Przykładowa wartość: 2018-05-24 12:24
          record_fields

          opcjonalny

Obiekt z wartościami struktury kampanii. Przykładowa wartość: {"field1":"value1","field2":"value2"}
          order

          opcjonalny

Kolejność rekordu. Przykładowa wartość: 50

Uwagi

Pole record_fields musi zawierać mapę pól struktury kampanii gdzie kluczem jest tekstowa nazwa pola a wartością treść którą chcemy ustawić.
W obiekcie możemy przekazać tylko te pola, których wartości chcemy ustawić. Jeśli przekazana wartość pola kampanii będzie pusta zawartość pola zostanie usunięta.
W przypadku gdy pole specjalne nie istnieje zostanie zwrócony błąd walidacji.
Wartości pól kampanii możemy ustalać tylko w kampaniach nie CRM.

Przykładowy request

POST https://your-system-name.thulium.com/api/batch/outbounds/00001/records
Dane { "records": [ { "phone_number": "111222333", "status_id": "3", "record_fields": { "pole1": "wartosc1", "pole2": "wartosc2" } }, { "phone_number": "222333444", "status_id": "1", "record_fields": { "pole1": "jakas wartosc" } }, { "phone_number": "555123321", "status_id": "3" }, { "phone_number": "123123123", "agent_login": "user" } ] }

Przykładowy response

{
    "111222333": {
        "http_status": 201,
        "record_id": 123,
        "status": "ADDED"
    },
    "222333444": {
        "http_status": 201,
        "record_id": 124,
        "status": "ADDED"
    },
    "555123321": {
        "http_status": 400,
        "record_id": 100,
        "status": "ALREADY_EXISTS"
    },
    "123123123": {
        "http_status": 400,
        "status": "FAILED",
        "message": "Agent not found."
    }
}

Przykładowe wywołanie


PHP

<?php
$data 
'{
    "records": [
        {
            "phone_number": "111222333",
            "status_id": "3",
            "record_fields": {
                "pole1": "wartosc1",
                "pole2": "wartosc2"
            }
        },
        {
            "phone_number": "222333444",
            "status_id": "1",
            "record_fields": {
                "pole1": "jakas wartosc"
            }
        },
        {
            "phone_number": "555123321",
            "status_id": "3"
        },
        {
            "phone_number": "123123123",
            "agent_login": "user"
        }
    ]
}'
;

$request curl_init('https://your-system-name.thulium.com/api/batch/outbounds/00001/records');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/batch/outbounds/00001/records", "{
    \"records\": [
        {
            \"phone_number\": \"111222333\",
            \"status_id\": \"3\",
            \"record_fields\": {
                \"pole1\": \"wartosc1\",
                \"pole2\": \"wartosc2\"
            }
        },
        {
            \"phone_number\": \"222333444\",
            \"status_id\": \"1\",
            \"record_fields\": {
                \"pole1\": \"jakas wartosc\"
            }
        },
        {
            \"phone_number\": \"555123321\",
            \"status_id\": \"3\"
        },
        {
            \"phone_number\": \"123123123\",
            \"agent_login\": \"user\"
        }
    ]
}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{
    "records": [
        {
            "phone_number": "111222333",
            "status_id": "3",
            "record_fields": {
                "pole1": "wartosc1",
                "pole2": "wartosc2"
            }
        },
        {
            "phone_number": "222333444",
            "status_id": "1",
            "record_fields": {
                "pole1": "jakas wartosc"
            }
        },
        {
            "phone_number": "555123321",
            "status_id": "3"
        },
        {
            "phone_number": "123123123",
            "agent_login": "user"
        }
    ]
}' "https://your-system-name.thulium.com/api/batch/outbounds/00001/records"

HTTPie

echo '{
    "records": [
        {
            "phone_number": "111222333",
            "status_id": "3",
            "record_fields": {
                "pole1": "wartosc1",
                "pole2": "wartosc2"
            }
        },
        {
            "phone_number": "222333444",
            "status_id": "1",
            "record_fields": {
                "pole1": "jakas wartosc"
            }
        },
        {
            "phone_number": "555123321",
            "status_id": "3"
        },
        {
            "phone_number": "123123123",
            "agent_login": "user"
        }
    ]
}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/batch/outbounds/00001/records

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT batch/outbounds/:id/records

Ostatnia modyfikacja 2024-03-20 13:15:19

Edytowanie wielu rekordów w kampanii.

Za pomocą API nie można edytować zduplikowanych numerów.

URL

https://your-system-name.thulium.com/api/batch/outbounds/:id/records

Parametry

id

wymagany

Pięcioznakowy identyfikator kampanii. Przykładowa wartość: 00001
records

wymagany

Lista rekordów do edycji. Każdy rekord z parametrami:
          phone_number

          wymagany

Numer telefonu, na który będą wykonywane połączenia. Przykładowa wartość: 333444555
          status_id

          opcjonalny

Identyfikator statusu rekordu w kampanii. Przykładowa wartość: 8
          dictionary_status_id

          opcjonalny

Identyfikator statusu słownikowego. Przykładowa wartość: 8
          agent_login

          opcjonalny

Login agenta do którego zostanie przypisany rekord. Wymagane dla statusu systemowego MY_RECORD. Przykładowa wartość: j.doe
          next_call_date

          opcjonalny

Data następnego kontaktu w formacie YYYY-MM-DD hh:mm. Wymagane dla statusu systemowego MY_RECORD i CALL_NO_SOONER_THAN. Przykładowa wartość: 2018-05-24 12:24
          record_fields

          opcjonalny

Obiekt z wartościami struktury kampanii. Przykładowa wartość: {"field1":"value1","field2":"value2"}
          search_in_additional_numbers

          opcjonalny

Flaga odpowiedzialna za wyszukiwanie w numerach dodatkowych. Przykładowa wartość: true

Uwagi

W celu wyszukania po wszystkich numerach - łącznie z dodatkowymi należy użyć flagi search_in_additional_numbers. Przyjmuje ona wartości true/false. Domyślnie jest ustawiona na false.
Przykładowe wywołanie: batch/outbounds/00001/records?search_in_additional_numbers=true

Przykładowy request

PUT https://your-system-name.thulium.com/api/batch/outbounds/00001/records
Dane { "records": [ { "phone_number": "111222333", "status_id": "3", "record_fields": { "pole1": "wartosc1", "pole2": "wartosc2" } }, { "phone_number": "555123321", "agent_login": "user" } ] }

Przykładowy response

{
    "111222333": {
        "http_status": 204
    },
    "555123321": {
        "http_status": 400,
        "message": "Agent not found."
    }
}

Przykładowe wywołanie


PHP

<?php
$data 
'{
    "records": [
        {
            "phone_number": "111222333",
            "status_id": "3",
            "record_fields": {
                "pole1": "wartosc1",
                "pole2": "wartosc2"
            }
        },
        {
            "phone_number": "555123321",
            "agent_login": "user"
        }
    ]
}'
;

$request curl_init('https://your-system-name.thulium.com/api/batch/outbounds/00001/records');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/batch/outbounds/00001/records", "{
    \"records\": [
        {
            \"phone_number\": \"111222333\",
            \"status_id\": \"3\",
            \"record_fields\": {
                \"pole1\": \"wartosc1\",
                \"pole2\": \"wartosc2\"
            }
        },
        {
            \"phone_number\": \"555123321\",
            \"agent_login\": \"user\"
        }
    ]
}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{
    "records": [
        {
            "phone_number": "111222333",
            "status_id": "3",
            "record_fields": {
                "pole1": "wartosc1",
                "pole2": "wartosc2"
            }
        },
        {
            "phone_number": "555123321",
            "agent_login": "user"
        }
    ]
}' "https://your-system-name.thulium.com/api/batch/outbounds/00001/records"

HTTPie

echo '{
    "records": [
        {
            "phone_number": "111222333",
            "status_id": "3",
            "record_fields": {
                "pole1": "wartosc1",
                "pole2": "wartosc2"
            }
        },
        {
            "phone_number": "555123321",
            "agent_login": "user"
        }
    ]
}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/batch/outbounds/00001/records

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbound_groups

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę grup kampanii.

URL

https://your-system-name.thulium.com/api/outbound_groups

Przykładowy request

GET https://your-system-name.thulium.com/api/outbound_groups

Przykładowy response

    [
    {
        "id": 1,
        "name": "Test Group"
    },
    {
        "id": 2,
        "name": "Test Group 2"
    },
    ]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbound_groups');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbound_groups");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbound_groups"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbound_groups Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET outbound_groups/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca grupę kampanii.

URL

https://your-system-name.thulium.com/api/outbound_groups/:id

Parametry

id

wymagany

Id grupy kampani. Przykładowa wartość: 7

Przykładowy request

GET https://your-system-name.thulium.com/api/outbound_groups/7

Przykładowy response

    {
        "id": 1,
        "name": "Test Group"
    }

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/outbound_groups/7');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/outbound_groups/7");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/outbound_groups/7"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/outbound_groups/7 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST outbound_groups

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodaje grupę kampanii.

URL

https://your-system-name.thulium.com/api/outbound_groups

Parametry

name

wymagany

Nazwa grupy kampani. Przykładowa wartość: Test Group

Przykładowy request

POST https://your-system-name.thulium.com/api/outbound_groups
Dane {"name":"Test Group"}

Przykładowy response

    {
        "id": 45,
        "name": "Test Group"
    }

Przykładowe wywołanie


PHP

<?php
$data 
'{"name":"Test Group"}';

$request curl_init('https://your-system-name.thulium.com/api/outbound_groups');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/outbound_groups", "{\"name\":\"Test Group\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"name":"Test Group"}' "https://your-system-name.thulium.com/api/outbound_groups"

HTTPie

echo '{"name":"Test Group"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/outbound_groups

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET queues

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę kolejek.

URL

https://your-system-name.thulium.com/api/queues

Przykładowy request

GET https://your-system-name.thulium.com/api/queues

Przykładowy response

[
    {
        "queue_id": 1,
        "name": "BOK"
    },
    {
        "queue_id": 2,
        "name": "Serwis"
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/queues');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/queues");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/queues"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/queues Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET queues/:id/topics

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca tematy rozmów dostępnych dla danej kolejki.

Tematy rozmów są pogrupowane (tak jak przy wyborze grup tematów dla danej kolejki).

Zwracane są jedynie aktywne grupy tematów a w ich ramach jedynie aktywne tematy.

Jeżeli grupa tematów jest pusta także się wyświetla.

URL

https://your-system-name.thulium.com/api/queues/:id/topics

Parametry

id

wymagany

Identyfikator kolejki. Przykładowa wartość: 2

Przykładowy request

GET https://your-system-name.thulium.com/api/queues/2/topics

Przykładowy response

[
    "topic_groups": [
        {
            group_name: "First group",
            topics: [
                {
                    "id": 1,
                    "name": "only one",
                    "show_custom_fields": true
                }
            ]
        },
        {
            group_name: "Empty group",
            topics: []
        },
        {
            group_name: "Group with multiple",
            topics: [
                {
                    "id": 2,
                    "name": "first",
                    "show_custom_fields": true
                },
                {
                    "id": 3,
                    "name": "second",
                    "show_custom_fields": true
                },
                {
                    "id": 4,
                    "name": "third",
                    "show_custom_fields": false
                }
            ]
        }
    ],
    "custom_fields": [
        {
          "id": 1,
          "name": "Field 1",
          "type": "LONG_TEXT",
          "require": false
        },
        {
          "id": 2,
          "name": "Field 2",
          "type": "TEXT",
          "require": false
        }
    ]
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/queues/2/topics');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/queues/2/topics");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/queues/2/topics"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/queues/2/topics Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET queues/:id/waiting_list

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca numery telefonów osób oczekujących w kolejce.

Jeśli numer telefonu zostanie jednoznacznie odnaleziony w CRM, to zwracany jest identyfikator i imię/nazwisko osoby lub nazwa firmy.

URL

https://your-system-name.thulium.com/api/queues/:id/waiting_list

Parametry

id

wymagany

Identyfikator kolejki. Przykładowa wartość: 2

Przykładowy request

GET https://your-system-name.thulium.com/api/queues/2/waiting_list

Przykładowy response

[
    {
        phone_number: "613459851",
        started_at: "2014-08-06 14:30:37",
        customer_id: null,
        customer_label: null
    },
    {
        phone_number: "840526437",
        started_at: "2014-08-06 14:30:36",
        customer_id: null,
        customer_label: null
    },
    {
        phone_number: "746842523",
        started_at: "2014-08-06 14:30:35",
        customer_id: 123,
        customer_label: "Jan Kowalski"
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/queues/2/waiting_list');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/queues/2/waiting_list");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/queues/2/waiting_list"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/queues/2/waiting_list Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET queues/:id/waiting_stats

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca liczbę osób oczekujących w kolejce oraz przewidywany czas oczekiwania na połączenie.

Dane zwrócone z zasobu prezentują dane z ostatniej godziny.

URL

https://your-system-name.thulium.com/api/queues/:id/waiting_stats

Parametry

id

wymagany

Identyfikator kolejki. Przykładowa wartość: 2

Przykładowy request

GET https://your-system-name.thulium.com/api/queues/2/waiting_stats

Przykładowy response

{
    "in_queue": 2,
    "approx_wait_time": "00:00:30"
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/queues/2/waiting_stats');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/queues/2/waiting_stats");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/queues/2/waiting_stats"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/queues/2/waiting_stats Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST queues/:id/schedule_call

Ostatnia modyfikacja 2024-03-20 13:15:19
Zaplanowanie połączenia, które zostanie wykonane w kolejce.

URL

https://your-system-name.thulium.com/api/queues/:id/schedule_call

Parametry

id

wymagany

Identyfikator kolejki. Przykładowa wartość: 2
phone_number

wymagany

Numer telefonu na który zostanie wykonane połączenie. Przykładowa wartość: 500333222
call_at

opcjonalny

Data połączenia. Domyślnie data wywołania. Przykładowa wartość: 2020-11-06 14:42:11

Przykładowy request

POST https://your-system-name.thulium.com/api/queues/2/schedule_call
Dane {"phone_number":"500333222","call_at":"2020-11-06 14:42:11"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"phone_number":"500333222","call_at":"2020-11-06 14:42:11"}';

$request curl_init('https://your-system-name.thulium.com/api/queues/2/schedule_call');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/queues/2/schedule_call", "{\"phone_number\":\"500333222\",\"call_at\":\"2020-11-06 14:42:11\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"phone_number":"500333222","call_at":"2020-11-06 14:42:11"}' "https://your-system-name.thulium.com/api/queues/2/schedule_call"

HTTPie

echo '{"phone_number":"500333222","call_at":"2020-11-06 14:42:11"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/queues/2/schedule_call

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE recordings

Ostatnia modyfikacja 2024-03-20 13:15:19
Umieszcza nagranie w kolejce do usunięcia.

URL

https://your-system-name.thulium.com/api/recordings

Parametry

filename

wymagany

Nazwa pliku z nagraniem Przykładowa wartość: sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav

Przykładowy request

DELETE https://your-system-name.thulium.com/api/recordings?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/recordings?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/recordings?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/recordings?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/recordings filename==sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET recordings

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę nagrań

Opis pól:
  • count - zwraca całkowitą liczbę znalezionych rekordów (bez uwzględnienia limitu),
  • date - data połączenia
  • created_at - data utworzenia nagrania
  • disposition - zawiera rezultat rozmowy. Zawsze zwraca ANSWERED.
  • duration - zawiera czas rozmowy,
  • billsec - zawiera czas bilingowy,
  • src - numer źródłowy,
  • dst - numer docelowy,
  • filename - nazwa pliku z nagraniem (do wykorzystania w recordings/stream i recordings/download),
  • user - imię i nazwisko użytkownika wykonującego połączenie,
  • connection_id - unikalny identyfikator połączenia,
  • type - typ połączenia: wychodzące lub przychodzące (OUTBOUND/INBOUND).

URL

https://your-system-name.thulium.com/api/recordings

Parametry

limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 100. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10
date_from

opcjonalny

Minimalna data utworzenia nagrania. Przykładowa wartość: 2014-07-04
date_to

opcjonalny

Maksymalna data utworzenia nagrania. Przykładowa wartość: 2014-07-14 12:34
src

opcjonalny

Numer źródłowy. Przykładowa wartość: 123321
dst

opcjonalny

Numer docelowy. Przykładowa wartość: 123321
connection_id

opcjonalny

Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341

Przykładowy request

GET https://your-system-name.thulium.com/api/recordings?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05

Przykładowy response

{
           "count": 1,
           "result": [   {
                 "date": "2014-07-07 11:08",
                 "created_at": "2014-07-07 13:28",
                 "src": "123123",
                 "dst": "",
                 "disposition": "ANSWERED",
                 "duration": 129,
                 "billsec": 104,
                 "filename": "sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav",
                 "user": "Bob Smith",
                 "connection_id": "1416225570.341",
                 "type": "INBOUND"
           }]
        }

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/recordings?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/recordings?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/recordings?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/recordings limit==1 offset==0 date_from==2014-07-04 date_to==2014-07-05 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET recordings/download

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca plik z nagraniem.

URL

https://your-system-name.thulium.com/api/recordings/download

Parametry

filename

wymagany

Nazwa pliku z nagraniem. Przykładowa wartość: sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav

Przykładowy request

GET https://your-system-name.thulium.com/api/recordings/download?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav

Przykładowy response

Dane binarne

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/recordings/download?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/recordings/download?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/recordings/download?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/recordings/download filename==sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET recordings/stream

Ostatnia modyfikacja 2024-03-20 13:15:19
Strumieniuje plik z nagraniem.

URL

https://your-system-name.thulium.com/api/recordings/stream

Parametry

filename

wymagany

Nazwa pliku z nagraniem. Przykładowa wartość: sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav

Przykładowy request

GET https://your-system-name.thulium.com/api/recordings/stream?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav

Przykładowy response

Dane binarne

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/recordings/stream?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/recordings/stream?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/recordings/stream?filename=sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/recordings/stream filename==sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET downloads/:id/attached_file

Ostatnia modyfikacja 2024-03-20 13:15:19
Pobieranie pliku załączonego do klienta.

URL

https://your-system-name.thulium.com/api/downloads/:id/attached_file

Parametry

id

wymagany

Identyfikator pliku. Przykładowa wartość: 21

Przykładowy request

GET https://your-system-name.thulium.com/api/downloads/21/attached_file

Przykładowy response

Dane binarne

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/downloads/21/attached_file');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/downloads/21/attached_file");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/downloads/21/attached_file"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/downloads/21/attached_file Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET files/:token

Ostatnia modyfikacja 2024-03-20 13:15:19
Pobieranie pliku (np. załącznik do zgłoszenia).

URL

https://your-system-name.thulium.com/api/files/:token

Parametry

token

wymagany

Token pliku. Przykładowa wartość: 1175982115cb861c810534

Przykładowy request

GET https://your-system-name.thulium.com/api/files/1175982115cb861c810534

Przykładowy response

Dane binarne

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/files/1175982115cb861c810534');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/files/1175982115cb861c810534");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/files/1175982115cb861c810534"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/files/1175982115cb861c810534 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST temporary_files

Ostatnia modyfikacja 2024-03-20 13:15:19

Tworzy na serwerze tymczasowy plik dostępny przez 24 godziny. Zwrócony token jest używany np. przy dodawaniu załączników do zgłoszenia.

URL

https://your-system-name.thulium.com/api/temporary_files

Parametry

filename

wymagany

Nazwa pliku. Przykładowa wartość: file.txt

Przykładowy request

POST https://your-system-name.thulium.com/api/temporary_files?filename=file.txt
Dane file content

Przykładowy response

{"filename":"file.txt","token":"180174033853be57b76ed6a","size":12}

Przykładowe wywołanie


PHP

<?php
$data 
'file content';

$request curl_init('https://your-system-name.thulium.com/api/temporary_files?filename=file.txt');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/octet-stream',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.postRawData("https://your-system-name.thulium.com/api/temporary_files?filename=file.txt", new ByteArrayInputStream("content".getBytes(StandardCharsets.UTF_8)));
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/octet-stream" --data-binary @file.png "https://your-system-name.thulium.com/api/temporary_files?filename=file.txt"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/temporary_files filename==file.txt Content-type:application/octet-stream @file.png

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET connections

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę połączeń

Opis pól:
  • count - zwraca całkowitą liczbę znalezionych rekordów (bez uwzględnienia limitu),
  • disposition - zawiera rezultat połączenia. Możliwe wartości to: BUSY, FAILED, ANSWERED, NO ANSWER.
  • duration - zawiera czas rozmowy,
  • billsec - zawiera czas bilingowy,
  • src - numer źródłowy,
  • dst - numer docelowy,
  • operator - operator użyty przy połączeniu,
  • filename - nazwa pliku z nagraniem (do wykorzystania w recordings/stream i recordings/download),
  • user - imię i nazwisko użytkownika wykonującego połączenie,
  • connection_id - unikalny identyfikator połączenia,
  • type - typ połączenia: wychodzące lub przychodzące (OUTBOUND/INBOUND).
  • queue_id - identyfikator kolejki połaczenia.
  • topic_id - identyfikator tematu rozmowy.
  • customer_id - identyfikator klienta.
  • tags - załączone tagi.

URL

https://your-system-name.thulium.com/api/connections

Parametry

limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 100. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10
date_from

opcjonalny

Minimalna data rozmowy. Przykładowa wartość: 2014-07-04
date_to

opcjonalny

Maksymalna data rozmowy. Przykładowa wartość: 2014-07-14 12:34
src

opcjonalny

Numer źródłowy. Przykładowa wartość: 123321
dst

opcjonalny

Numer docelowy. Przykładowa wartość: 123321
connection_id

opcjonalny

Unikalny identyfikator połączenia Przykładowa wartość: 1416225570.341
user_login

opcjonalny

Login dzwoniącego użytkownika Przykładowa wartość: j.doe
queue_id

opcjonalny

Identyfikator kolejki połączenia Przykładowa wartość: 542
topic_id

opcjonalny

Identyfikator tematu rozmowy Przykładowa wartość: 365
customer_id

opcjonalny

Identyfikator klienta z CRM. Przykładowa wartość: 321
tags

opcjonalny

Załączony tag dla rozmowy. Przykładowa wartość: tags[]=tag1&tags[]=tag2&tags[]=tag3
include_tags

opcjonalny

Czy zwracać załączony tag dla rozmowy. Przykładowa wartość: true
include_topics

opcjonalny

Czy zwracać temat rozmowy. Przykładowa wartość: true

Przykładowy request

GET https://your-system-name.thulium.com/api/connections?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05

Przykładowy response

{
           "count": 1,
           "result": [   {
                 "date": "2014-07-07 11:08",
                 "src": "123123",
                 "dst": "1234",
                 "disposition": "ANSWERED",
                 "duration": 129,
                 "billsec": 104,
                 "operator": "siptrunk",
                 "filename": "sprzedaz/2014-07-07/2014-07-07_093545_921063395.234.wav",
                 "user": "Bob Smith",
                 "user_login": "bob_smith",
                 "dst_user": "John Doe",
                 "dst_user_login": "john_doe",
                 "customer_id": 123456,
                 "outbound_id": "",
                 "connection_id": "1416225570.341",
                 "type": "INBOUND",
                 "rating": {
                    "type": "face",
                    "rate": "happy"
                 },
                 "queue_id": 34,
                 "tags": ["tag1", "tag2", "tag3"]
           }]
        }

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/connections?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/connections?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/connections?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/connections limit==1 offset==0 date_from==2014-07-04 date_to==2014-07-05 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET connections/:id/topic

Ostatnia modyfikacja 2024-03-20 13:15:19

URL

https://your-system-name.thulium.com/api/connections/:id/topic

Parametry

id

wymagany

Unikalne ID połączenia. Przykładowa wartość: xxxxx

Przykładowy request

GET https://your-system-name.thulium.com/api/connections/123423.23/topic

Przykładowy response

{
    "topic_id": 96,
    "agent_login": "jan.kowalski",
    "comment": "komentarz do rozmowy",
    "custom_fields": [
        {
            "field_id": 1,
            "value": "pole 1 wartość"
        },
        {
            "field_id": 2,
            "value": "pole 2 wartość"
        }
    ]
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/connections/123423.23/topic');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/connections/123423.23/topic");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/connections/123423.23/topic"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/connections/123423.23/topic Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST connections/:id/hangup

Ostatnia modyfikacja 2024-03-20 13:15:19
Rozłącza połączenie.

URL

https://your-system-name.thulium.com/api/connections/:id/hangup

Parametry

id

wymagany

Unikalne ID połączenia. Przykładowa wartość: xxxxx

Przykładowy request

POST https://your-system-name.thulium.com/api/connections/xxxxx/hangup

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/connections/xxxxx/hangup');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/connections/xxxxx/hangup", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/connections/xxxxx/hangup"

HTTPie

http -a api_user:api_pass POST https://your-system-name.thulium.com/api/connections/xxxxx/hangup

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST connections/call

Ostatnia modyfikacja 2024-03-20 13:15:19

Zestawia połączenie na wskazany numer.

Ponieważ w chwili wywoływania metody nieznany jest rezultat z jakim zakończy się próba połączenia, to metoda nic nie zwraca.

URL

https://your-system-name.thulium.com/api/connections/call

Parametry

sip

wymagany

Numer SIP, dla którego ma być zestawione połączenie. Przykładowa wartość: 301
phone_number

wymagany

Numer telefonu, na który system zadzwoni. Przykładowa wartość: 666777888

Przykładowy request

POST https://your-system-name.thulium.com/api/connections/call
Dane {"sip":"391","phone_number":"666777888"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"sip":"391","phone_number":"666777888"}';

$request curl_init('https://your-system-name.thulium.com/api/connections/call');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/connections/call", "{\"sip\":\"391\",\"phone_number\":\"666777888\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"sip":"391","phone_number":"666777888"}' "https://your-system-name.thulium.com/api/connections/call"

HTTPie

echo '{"sip":"391","phone_number":"666777888"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/connections/call

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST connections/topic

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodaje lub aktualizuje temat połączenia.

URL

https://your-system-name.thulium.com/api/connections/topic

Parametry

connection_id

wymagany

Unikalne ID połączenia. Przykładowa wartość: xxxxx
topic_id

wymagany

ID wybranego tematu tematu rozmowy. Zarówno temat jak i grupa do której należy muszą być aktywne. Można je zdobyć odpytując queue/:id/topics. Przykładowa wartość: 11
comment

opcjonalny

Komentarz do połączenia. Przykładowa wartość: nic ciekawego
custom_fields

opcjonalny

Lista parametrów używanych do zapisania wartości pól dodatkowych. Lista obiektów o atrybutach 'field_id', 'value'. Oba atrybuty są wymagane jeżeli taki obiekt wystąpi. Przykładowa wartość: [ { "field_id": 1, "value": "pewna wartość" }, { "field_id": 2, "value": "wartość druga" } ]

Przykładowy request

POST https://your-system-name.thulium.com/api/connections/topic
Dane {"connection_id":"xxxxx","topic_id":1,"comment":"nic ciekawego","custom_fields":[{"field_id":1,"value":"pewna wartosc"},{"field_id":2,"value":"wartosc druga"}]}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"connection_id":"xxxxx","topic_id":1,"comment":"nic ciekawego","custom_fields":[{"field_id":1,"value":"pewna wartosc"},{"field_id":2,"value":"wartosc druga"}]}';

$request curl_init('https://your-system-name.thulium.com/api/connections/topic');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/connections/topic", "{\"connection_id\":\"xxxxx\",\"topic_id\":1,\"comment\":\"nic ciekawego\",\"custom_fields\":[{\"field_id\":1,\"value\":\"pewna wartosc\"},{\"field_id\":2,\"value\":\"wartosc druga\"}]}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"connection_id":"xxxxx","topic_id":1,"comment":"nic ciekawego","custom_fields":[{"field_id":1,"value":"pewna wartosc"},{"field_id":2,"value":"wartosc druga"}]}' "https://your-system-name.thulium.com/api/connections/topic"

HTTPie

echo '{"connection_id":"xxxxx","topic_id":1,"comment":"nic ciekawego","custom_fields":[{"field_id":1,"value":"pewna wartosc"},{"field_id":2,"value":"wartosc druga"}]}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/connections/topic

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE forwardings/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie przekierowania.

URL

https://your-system-name.thulium.com/api/forwardings/:id

Parametry

id

wymagany

Identyfikator przekierowania. Przykładowa wartość: 12

Przykładowy request

DELETE https://your-system-name.thulium.com/api/forwardings/12

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/forwardings/12');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/forwardings/12");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/forwardings/12"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/forwardings/12 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET forwardings

Ostatnia modyfikacja 2024-03-20 13:15:19
Pobieranie przekierowań.

URL

https://your-system-name.thulium.com/api/forwardings

Parametry

destination_number

opcjonalny

Numer docelowy. Przykładowa wartość: 1234

Przykładowy request

GET https://your-system-name.thulium.com/api/forwardings?destination_number=1234

Przykładowy response

[
  {
    "id": 12,
    "source_number": "1232",
    "destination_number": "1234",
    "forward_to": "234234",
    "date_from": "2015-08-24",
    "date_to": "2015-08-27",
    "time_from": "11:30",
    "time_to": "12:30",
    "description": "forwarding"
  }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/forwardings?destination_number=1234');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/forwardings?destination_number=1234");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/forwardings?destination_number=1234"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/forwardings destination_number==1234 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST forwardings

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodawanie przekierowania.

URL

https://your-system-name.thulium.com/api/forwardings

Parametry

source_number

opcjonalny

Numer źródłowy. Przykładowa wartość: 123
destination_number

opcjonalny

Numer docelowy. Przykładowa wartość: 123
forward_to

wymagany

Numer, na który nastąpi przekierowanie. Przykładowa wartość: 12345
date_from

opcjonalny

Data, od której przekierowanie będzie aktywne. Przykładowa wartość: 2015-08-24
date_to

opcjonalny

Data, do której przekierowanie będzie aktywne. Przykładowa wartość: 2015-09-24
time_from

opcjonalny

Godzina, od której przekierowanie będzie aktywne. Przykładowa wartość: 12:00
time_to

opcjonalny

Godzina, do której przekierowanie będzie aktywne. Przykładowa wartość: 13:00
description

opcjonalny

Opis przekierowania. Przykładowa wartość: Opis

Przykładowy request

POST https://your-system-name.thulium.com/api/forwardings
Dane {"source_number":"111","destination_number":"222","forward_to":"333","date_from":"2001-01-01","date_to":"2007-07-07","time_from":"01:01","time_to":"07:07","description":"a description"}

Przykładowy response

{
    "id": "21"
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"source_number":"111","destination_number":"222","forward_to":"333","date_from":"2001-01-01","date_to":"2007-07-07","time_from":"01:01","time_to":"07:07","description":"a description"}';

$request curl_init('https://your-system-name.thulium.com/api/forwardings');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/forwardings", "{\"source_number\":\"111\",\"destination_number\":\"222\",\"forward_to\":\"333\",\"date_from\":\"2001-01-01\",\"date_to\":\"2007-07-07\",\"time_from\":\"01:01\",\"time_to\":\"07:07\",\"description\":\"a description\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"source_number":"111","destination_number":"222","forward_to":"333","date_from":"2001-01-01","date_to":"2007-07-07","time_from":"01:01","time_to":"07:07","description":"a description"}' "https://your-system-name.thulium.com/api/forwardings"

HTTPie

echo '{"source_number":"111","destination_number":"222","forward_to":"333","date_from":"2001-01-01","date_to":"2007-07-07","time_from":"01:01","time_to":"07:07","description":"a description"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/forwardings

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT forwardings/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Zmiana przekierowania.

URL

https://your-system-name.thulium.com/api/forwardings/:id

Parametry

id

wymagany

Identyfikator przekierowania. Przykładowa wartość: 12
source_number

opcjonalny

Numer źródłowy. Przykładowa wartość: 123
destination_number

opcjonalny

Numer docelowy. Przykładowa wartość: 123
forward_to

opcjonalny

Numer, na który nastąpi przekierowanie. Przykładowa wartość: 12345
date_from

opcjonalny

Data, od której przekierowanie będzie aktywne. Przykładowa wartość: 2015-08-24
date_to

opcjonalny

Data, do której przekierowanie będzie aktywne. Przykładowa wartość: 2015-09-24
time_from

opcjonalny

Godzina, od której przekierowanie będzie aktywne. Przykładowa wartość: 12:00
time_to

opcjonalny

Godzina, do której przekierowanie będzie aktywne. Przykładowa wartość: 13:00
description

opcjonalny

Opis przekierowania. Przykładowa wartość: Opis

Przykładowy request

PUT https://your-system-name.thulium.com/api/forwardings/12
Dane {"source_number":"111","destination_number":"222","forward_to":"333","date_from":"2001-01-01","date_to":"2007-07-07","time_from":"01:01","time_to":"07:07","description":"a new description"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"source_number":"111","destination_number":"222","forward_to":"333","date_from":"2001-01-01","date_to":"2007-07-07","time_from":"01:01","time_to":"07:07","description":"a new description"}';

$request curl_init('https://your-system-name.thulium.com/api/forwardings/12');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/forwardings/12", "{\"source_number\":\"111\",\"destination_number\":\"222\",\"forward_to\":\"333\",\"date_from\":\"2001-01-01\",\"date_to\":\"2007-07-07\",\"time_from\":\"01:01\",\"time_to\":\"07:07\",\"description\":\"a new description\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{"source_number":"111","destination_number":"222","forward_to":"333","date_from":"2001-01-01","date_to":"2007-07-07","time_from":"01:01","time_to":"07:07","description":"a new description"}' "https://your-system-name.thulium.com/api/forwardings/12"

HTTPie

echo '{"source_number":"111","destination_number":"222","forward_to":"333","date_from":"2001-01-01","date_to":"2007-07-07","time_from":"01:01","time_to":"07:07","description":"a new description"}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/forwardings/12

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET system/pauses

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę pauz.

URL

https://your-system-name.thulium.com/api/system/pauses

Przykładowy request

GET https://your-system-name.thulium.com/api/system/pauses

Przykładowy response

[
    {
        "id": 2,
        "name": "przerwa"
    },
    {
        "id": 0,
        "name": "wrap-up"
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/system/pauses');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/system/pauses");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/system/pauses"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/system/pauses Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET system/transfer_shortcuts

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca skróty do przekierowań.

URL

https://your-system-name.thulium.com/api/system/transfer_shortcuts

Uwagi

W polu icon zwracany jest obrazek zakodowany przy pomocy Base64.

Przykładowy request

GET https://your-system-name.thulium.com/api/system/transfer_shortcuts

Przykładowy response

[
    {
        "transfer_shortcut_id": 1,
        "queue": "BOK",
        "number": "",
        "icon": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8\/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAe9JREFUeNqMUz1rG0EQfbva08fJsmwQCbLgirhyYYhcqAop1BnjJqDCfQIK+QEp3bhJEVKFCJJ\/kV4gVKXSL3CQDxxd4UJGHyBp9y4zK22IjKxkYJhhdt7bt7O7otFowFlydGSjEOKcQhmP2yBJku+cqL+r4uYGcRCAFg++XV62jNZYxDG0MYiTxPZkMhm8u7pq2v67u3UCTKcQYQhTqQhJQCYAkywWmFE0VGOLjRGp21sI6mcClnvwRwWTRNHLbrttCRgSE3BOKlhJmhTwOvWxpF\/KGFNptVpfGNzr9VCtVu2O2+zFycmF53kXzWbzLROI2WxmFygH568+\/4D2CpjP51iQswJFO+fyeezs7uJpXuHTaYn7hdJaS81nXRFwnmT38Pz4GJPxGJPJxBLJdBq5QgE7+\/vg+Wh9z71yjYAje8lPIYoiiOWdIpvNwiPPkQqPbqPkS9e7meDj2RNIKR+cnOdybz22CiyJlDQw6YDOu90uxiS\/0+lsjLyul9e7JOCps6+KqNVqNt8WV5jNCtr0Bv4nOoKUO6WbRb1eh1Jqa7RTIawaDofpfr9vC6PRCJwPBgP8y8rlMhgrisXia5rqs\/UvMZVhGL5\/DBwEwQff92O6qZ+iQI\/DSXeWOjx8kzwgXfu1BDTX11\/5OL8FGABX1Xth+tuNFgAAAABJRU5ErkJggg==",
        "name": "BOK"
    },
    {
        "transfer_shortcut_id": 3,
        "queue": "",
        "number": "123456789",
        "icon": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8\/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAe9JREFUeNqMUz1rG0EQfbva08fJsmwQCbLgirhyYYhcqAop1BnjJqDCfQIK+QEp3bhJEVKFCJJ\/kV4gVKXSL3CQDxxd4UJGHyBp9y4zK22IjKxkYJhhdt7bt7O7otFowFlydGSjEOKcQhmP2yBJku+cqL+r4uYGcRCAFg++XV62jNZYxDG0MYiTxPZkMhm8u7pq2v67u3UCTKcQYQhTqQhJQCYAkywWmFE0VGOLjRGp21sI6mcClnvwRwWTRNHLbrttCRgSE3BOKlhJmhTwOvWxpF\/KGFNptVpfGNzr9VCtVu2O2+zFycmF53kXzWbzLROI2WxmFygH568+\/4D2CpjP51iQswJFO+fyeezs7uJpXuHTaYn7hdJaS81nXRFwnmT38Pz4GJPxGJPJxBLJdBq5QgE7+\/vg+Wh9z71yjYAje8lPIYoiiOWdIpvNwiPPkQqPbqPkS9e7meDj2RNIKR+cnOdybz22CiyJlDQw6YDOu90uxiS\/0+lsjLyul9e7JOCps6+KqNVqNt8WV5jNCtr0Bv4nOoKUO6WbRb1eh1Jqa7RTIawaDofpfr9vC6PRCJwPBgP8y8rlMhgrisXia5rqs\/UvMZVhGL5\/DBwEwQff92O6qZ+iQI\/DSXeWOjx8kzwgXfu1BDTX11\/5OL8FGABX1Xth+tuNFgAAAABJRU5ErkJggg==",
        "name": "FAX"
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/system/transfer_shortcuts');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/system/transfer_shortcuts");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/system/transfer_shortcuts"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/system/transfer_shortcuts Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT system/announcement

Ostatnia modyfikacja 2024-03-20 13:15:19
Ustawia komunikat systemowy dla użytkowników.

URL

https://your-system-name.thulium.com/api/system/announcement

Parametry

message

wymagany

Treść komunikatu.
color

opcjonalny

Kolor komunikatu w formacie hex (np. #B94A48).

Przykładowy request

PUT https://your-system-name.thulium.com/api/system/announcement
Dane {"message":"Message for the users!"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"message":"Message for the users!"}';

$request curl_init('https://your-system-name.thulium.com/api/system/announcement');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/system/announcement", "{\"message\":\"Message for the users!\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{"message":"Message for the users!"}' "https://your-system-name.thulium.com/api/system/announcement"

HTTPie

echo '{"message":"Message for the users!"}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/system/announcement

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET users/:login

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca informacje o użytkowniku (przypisane konta SIP).

URL

https://your-system-name.thulium.com/api/users/:login

Parametry

login

wymagany

Login użytkownika. Przykładowa wartość: jkowalski

Przykładowy request

GET https://your-system-name.thulium.com/api/users/jkowalski

Przykładowy response

{
  "login": "jkowalski",
  "name": "Jan",
  "surname": "Kowalski",
  "sip_accounts": [
    {
      "phone_number": "124",
      "phone_type": "hardphone"
    },
    {
      "phone_number": "125",
      "phone_type": "softphone"
    }
  ]
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/users/jkowalski');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/users/jkowalski");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/users/jkowalski"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/users/jkowalski Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET todos/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca informacje o zadaniu.

URL

https://your-system-name.thulium.com/api/todos/:id

Parametry

id

wymagany

Identyfikator zadania. Przykładowa wartość: 12

Przykładowy request

GET https://your-system-name.thulium.com/api/todos/12

Przykładowy response

{
  "user_login": "user123",
  "author_login": "author123",
  "target_date": "2024-03-21 19:00:00",
  "task": "sdf",
  "description": "Example description",
  "created_at": "2024-03-20 19:00:00",
  "done_at": null,
  "id": 14
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/todos/12');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/todos/12");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/todos/12"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/todos/12 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST todos

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodaje zadanie użytkownikowi.

URL

https://your-system-name.thulium.com/api/todos

Parametry

task

wymagany

Zadanie. Przykładowa wartość: Uaktualnienie systemu
description

opcjonalny

Opis. Przykładowa wartość: Najpierw należy pobrać najnowszą wersję panelu programu ze strony producenta.
user_login

wymagany

Login. Przykładowa wartość: janek123
author_login

opcjonalny

Login autora. Przykładowa wartość: admin
target_date

wymagany

Dzień i godzina. Przykładowa wartość: 2023-03-20 19:00:00

Przykładowy request

POST https://your-system-name.thulium.com/api/todos
Dane {"task":"Uaktualnienie systemu.","description":"Najpierw nale\u017cy pobra\u0107 najnowsz\u0105 wersj\u0119 panelu programu ze strony producenta.","user_login":"janek123","author_login":"admin","target_date":"2023-03-20 19:00:00"}

Przykładowy response

{
    id: 123
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"task":"Uaktualnienie systemu.","description":"Najpierw nale\u017cy pobra\u0107 najnowsz\u0105 wersj\u0119 panelu programu ze strony producenta.","user_login":"janek123","author_login":"admin","target_date":"2023-03-20 19:00:00"}';

$request curl_init('https://your-system-name.thulium.com/api/todos');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/todos", "{\"task\":\"Uaktualnienie systemu.\",\"description\":\"Najpierw nale\u017cy pobra\u0107 najnowsz\u0105 wersj\u0119 panelu programu ze strony producenta.\",\"user_login\":\"janek123\",\"author_login\":\"admin\",\"target_date\":\"2023-03-20 19:00:00\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"task":"Uaktualnienie systemu.","description":"Najpierw nale\u017cy pobra\u0107 najnowsz\u0105 wersj\u0119 panelu programu ze strony producenta.","user_login":"janek123","author_login":"admin","target_date":"2023-03-20 19:00:00"}' "https://your-system-name.thulium.com/api/todos"

HTTPie

echo '{"task":"Uaktualnienie systemu.","description":"Najpierw nale\u017cy pobra\u0107 najnowsz\u0105 wersj\u0119 panelu programu ze strony producenta.","user_login":"janek123","author_login":"admin","target_date":"2023-03-20 19:00:00"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/todos

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE tickets/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie zgłoszenia. Usuwa zgłoszenie i wszystkie jego zależności.

URL

https://your-system-name.thulium.com/api/tickets/:id

Parametry

id

wymagany

Identyfikator zgłoszenia, który ma być usunięty. Przykładowa wartość: 21

Przykładowy request

DELETE https://your-system-name.thulium.com/api/tickets/21

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/tickets/21');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/tickets/21");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/tickets/21"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/tickets/21 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET ticket_categories

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę kategorii zgłoszeń.

URL

https://your-system-name.thulium.com/api/ticket_categories

Przykładowy request

GET https://your-system-name.thulium.com/api/ticket_categories

Przykładowy response

[
    {
      "id": "23962",
      "name": "category1"
    },
    {
      "id": "23963",
      "name": "category2"
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/ticket_categories');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/ticket_categories");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/ticket_categories"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/ticket_categories Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET ticket_queues

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę kolejek zgłoszeń.

URL

https://your-system-name.thulium.com/api/ticket_queues

Przykładowy request

GET https://your-system-name.thulium.com/api/ticket_queues

Przykładowy response

[
    {
      "id": 23962,
      "name": "queue1"
    },
    {
      "id": 23963,
      "name": "queue2"
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/ticket_queues');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/ticket_queues");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/ticket_queues"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/ticket_queues Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET ticket_statuses

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę statusów zgłoszeń.

URL

https://your-system-name.thulium.com/api/ticket_statuses

Przykładowy request

GET https://your-system-name.thulium.com/api/ticket_statuses

Przykładowy response

[
    {
      "status_id": "23962",
      "substatus_id": null,
      "name": "status1"
    },
    {
      "status_id": "23963",
      "substatus_id": "12",
      "name": "status2"
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/ticket_statuses');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/ticket_statuses");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/ticket_statuses"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/ticket_statuses Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET tickets

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca listę zgłoszeń. Domyślnie posortowana po dacie modyfikacji od najnowszych.

Parametr count zwraca całkowitą ilość znalezionych zgłoszeń (bez uwzględnienia limitu).

URL

https://your-system-name.thulium.com/api/tickets

Parametry

limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 100. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10
date_from

opcjonalny

Minimalna data modyfikacji zgłoszenia. Przykładowa wartość: 2014-07-04
date_to

opcjonalny

Maksymalna data modyfikacji zgłoszenia. Przykładowa wartość: 2014-07-14 12:34
create_date_from

opcjonalny

Minimalna data utworzenia zgłoszenia. Przykładowa wartość: 2014-07-04
create_date_to

opcjonalny

Maksymalna data utworzenia zgłoszenia. Przykładowa wartość: 2014-07-14 12:34
company_id

opcjonalny

Identyfikator firmy, do której przypisane są zgłoszenia. Jeśli firma nie istnieje zgłoszenie nie zostanie znalezione. Przykładowa wartość: 21
customer_id

opcjonalny

Identyfikator klienta z CRM. Przykładowa wartość: 32122
user_login

opcjonalny

Login przypisanego użytkownika. Przykładowa wartość: akowalski
source

opcjonalny

Źródło zgłoszenia. Przykładowa wartość: www
ticket_queue_id

opcjonalny

Identyfikator kolejki zgłoszeń. Przykładowa wartość: 2
category_id

opcjonalny

Identyfikator kategorii zgłoszeń. Przykładowa wartość: 2
message_id

opcjonalny

Identyfikator wiadomości w zgłoszeniu. Przykładowa wartość: 432
status_id[]

opcjonalny

Identyfikator statusu zgłoszenia (jeden lub wiele). Przykładowa wartość: [1, 2]
custom_fields

opcjonalny

Wyszukiwanie po wartościach pól specjalnych. Można wyszukiwać po wielu polach specjalnych na raz.
Dla każdego pola można podać kilka alternatywnych wartości.
Na przykład:
["custom_fields" => [
    "ID" => ["1", "2"],
    "Uwagi" => "information"
]];
Przykładowa wartość: custom_fields[ID][0]=1&custom_fields[ID][1]=2&custom_fields[Uwagi]=information
include_custom_fields

opcjonalny

Czy zwracać pola specjalne zgłoszenia. Przykładowa wartość: true
order

opcjonalny

Lista pól, po których będą posortowane rezultaty. Prefiks '-' oznacza sortowanie malejące, brak prefiksu rosnące. Możliwe jest sortowanie po polach: create_date, update_date. Przykładowa wartość: name,-customer_id,nip

Uwagi

W celu rozróżnienia typu wiadomości w zgłoszeniu, pole type jest ustawione na jedną z wartości:
  • MAIL - wiadomość przysłana od klienta
  • REPLY - wiadomość wysłana do klienta
  • COMMENT - komentarz

Przykładowy request

GET https://your-system-name.thulium.com/api/tickets?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05&company_id=21&user_login=akowalski&include_custom_fields=true

Przykładowy response

{
           "count": 3,
           "result": [   {
              "ticket_id": "23962",
              "user_login": "akowalski",
              "from": "bob@test.pl",
              "ticket_queue_name": "help@thulium.com",
              "ticket_queue_id": 32,
              "subject": "subject",
              "category_id": 2,
              "source": "email",
              "status_id": "2",
              "substatus_id": "2",
              "tags": ["abc", "xyz"],
              "customer_id": 32122,
              "full_status_name": "some status - some sub status",
              "created_at": "2013-08-02 09:47",
              "updated_at": "2014-07-04 16:15",
              "closed_at": "2014-09-04 17:33",
              "close_time": "123:33:44",
              "first_agent_responded_at": "2014-07-04 15:15",
              "first_agent_response_time": "01:00:12",
              "messages":       [
                {
                    "message_id": 432,
                    "user_login": "",
                    "type": "MAIL",
                    "body": "hello",
                    "comment": "",
                    "system_comment": "",
                    "created_at": "2013-08-02 09:47",
                    "attachments": [],
                    "ratings": []
                },
                {
                    "message_id": 433,
                    "user_login": "",
                    "type": "MAIL",
                    "body": "hello2",
                    "comment": "",
                    "system_comment": "",
                    "created_at": "2014-07-04 16:15",
                    "attachments": ["1175982115cb861c810534", "85734759348c94a5983b12],                    
                    "ratings": [2, 3]
                 }
              ],
              "custom_fields":
              {
                 "ID": null,
                 "Uwagi": "information"
              }
           }]
        }

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/tickets?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05&company_id=21&user_login=akowalski&include_custom_fields=true');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/tickets?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05&company_id=21&user_login=akowalski&include_custom_fields=true");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/tickets?limit=1&offset=0&date_from=2014-07-04&date_to=2014-07-05&company_id=21&user_login=akowalski&include_custom_fields=true"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/tickets limit==1 offset==0 date_from==2014-07-04 date_to==2014-07-05 company_id==21 user_login==akowalski include_custom_fields==true Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET tickets/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca informacje o zgłoszeniu.

URL

https://your-system-name.thulium.com/api/tickets/:id

Parametry

id

wymagany

Identyfikator zgłoszenia. Przykładowa wartość: 1234
include_custom_fields

opcjonalny

Czy zwracać pola specjalne zgłoszenia. Przykładowa wartość: true

Uwagi

W celu rozróżnienia typu wiadomości w zgłoszeniu, pole type jest ustawione na jedną z wartości:
  • MAIL - wiadomość przysłana od klienta
  • REPLY - wiadomość wysłana do klienta
  • COMMENT - komentarz

Przykładowy request

GET https://your-system-name.thulium.com/api/tickets/1234?include_custom_fields=true

Przykładowy response

{
    "ticket_id": 1234,
    "from": "john.doe@foo.bar",
    "ticket_queue_name": "test@thulium.pl",
    "ticket_queue_id": 32,
    "subject": "Example ticket subject",
    "status_id": "2",
    "substatus_id": "2",
    "customer_id": 32122,
    "full_status_name": "some status - some sub status",
    "category_id": "3",
    "user_login": "akowalski",
    "created_at": "2014-07-08 08:05",
    "updated_at": "2014-07-11 08:05",
    "closed_at": "2014-09-04 17:33",
    "close_time": "123:33:44",
    "first_agent_responded_at": "2014-07-04 15:15",
    "first_agent_response_time": "01:00:12",
    "messages": [
        {
            "message_id": 432,
            "user_login": "akowalski",
            "type": "COMMENT",
            "body": "",
            "comment": "Example comment",
            "system_comment": "",
            "created_at": "2014-07-08 08:05",
            "attachments": []
        },
        {
            "message_id": 433,
            "user_login": "akowalski",
            "type": "COMMENT",
            "body": "",
            "comment": "",
            "system_comment": "Changed status from [Oczekuje na klienta] to [Nowe]",
            "created_at": "2014-07-02 13:56",
            "attachments": []
        },
        {
            "message_id": 434,
            "user_login": "akowalski",
            "type": "COMMENT",
            "body": "",
            "comment": "Example comment",
            "system_comment": "",
            "created_at": "2014-07-02 13:54",
            "attachments": []
        },
        {
            "message_id": 435,
            "user_login": "akowalski",
            "type": "REPLY",
            "body": "Reply message send to client",
            "comment": "",
            "system_comment": "Changed status from [Nowe] to [Oczekuje na klienta]",
            "created_at": "2014-07-02 13:44",
            "attachments": ["1175982115cb861c810534", "85734759348c94a5983b12]
        },
        {
            "message_id": 436,
            "user_login": "",
            "type": "MAIL",
            "body": "Email content",
            "comment": "",
            "system_comment": "",
            "created_at": "2014-07-02 12:28",
            "attachments": []            
        }
    ],
    "custom_fields":
    {
       "ID": null,
       "Uwagi": "information"
    }
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/tickets/1234?include_custom_fields=true');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/tickets/1234?include_custom_fields=true");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/tickets/1234?include_custom_fields=true"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/tickets/1234 include_custom_fields==true Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET tickets/today_stats

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca statystyki zgłoszeń dla obecnego dnia.

URL

https://your-system-name.thulium.com/api/tickets/today_stats

Przykładowy request

GET https://your-system-name.thulium.com/api/tickets/today_stats

Przykładowy response

{
    "new_tickets": 23,
    "new_mails": 12,
    "new_replies": 11,
    "new_comments": 32
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/tickets/today_stats');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/tickets/today_stats");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/tickets/today_stats"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/tickets/today_stats Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST tickets

Ostatnia modyfikacja 2024-03-20 13:15:19

Dodanie zgłoszenia.

URL

https://your-system-name.thulium.com/api/tickets

Parametry

to

wymagany

Adres e-mail odbiorcy (zgodnie ze zdefiniowaną w systemie skrzynką).
from

opcjonalny

Adres e-mail autora zgłoszenia.
subject

wymagany

Temat zgłoszenia.
body

wymagany

Treść zgłoszenia.
body_type

opcjonalny

Typ wiadomości zgłoszenia.
Domyślna wartość: PLAIN. Przykładowa wartość: HTML|PLAIN
comment

opcjonalny

Komentarz zgłoszenia.
cc

opcjonalny

Tablica adresów kopii.
attachments

opcjonalny

Tablica tokenów zwróconych przez zasób pliki tymczasowe.
source

opcjonalny

Źródło dodawanego zgłoszenia.
Domyślna wartość: email. Przykładowa wartość: email|phone|sms|chat|www
direction

opcjonalny

Kierunek dodawanego zgłoszenia. Możliwe wartości: w imieniu klienta (in_behalf_of) i wychodzący e-mail do klienta (out).
Domyślna wartość: in_behalf_of. Przykładowa wartość: in_behalf_of|out
user_login

opcjonalny

Login przypisanego użytkownika. Przykładowa wartość: akowalski
customer_id

opcjonalny

Identyfikator klienta z CRM. Przykładowa wartość: 32122
tags

opcjonalny

Tagi Przykładowa wartość: "tags":["tag1", "tag2", "tag3"]
status_id

opcjonalny

Identyfikator statusu zgłoszenia zwrócony przez zasób statusy
substatus_id

opcjonalny

Identyfikator podstatusu zgłoszenia zwrócony przez zasób statusy
category_id

opcjonalny

Identyfikator kategorii zgłoszenia zwrócony przez zasób kategorie
ticket_queue_id

opcjonalny

Identyfikator kolejki zgłoszeń. Jeśli nie jest podany, to kolejka jest wybierana na podstawie skrzynki odbiorczej.
custom_fields

opcjonalny

Obiekt z wartościami pól specjalnych. Przykładowa wartość: "custom_fields":{"field_name_1":"value_1","field_name_2":"value_2"}

Przykładowy request

POST https://your-system-name.thulium.com/api/tickets
Dane {"to":"mailbox@foo.bar","subject":"ticket subject","from":"john.doe@foo.bar","body":"email content","comment":"ticket comment","attachments":["61527075253ba62a76ca5c"],"cc":["cc_mail1@foo.bar","cc_mail2@foo.bar"]}

Przykładowy response

{
    ticket_id: 1232
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"to":"mailbox@foo.bar","subject":"ticket subject","from":"john.doe@foo.bar","body":"email content","comment":"ticket comment","attachments":["61527075253ba62a76ca5c"],"cc":["cc_mail1@foo.bar","cc_mail2@foo.bar"]}';

$request curl_init('https://your-system-name.thulium.com/api/tickets');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/tickets", "{\"to\":\"mailbox@foo.bar\",\"subject\":\"ticket subject\",\"from\":\"john.doe@foo.bar\",\"body\":\"email content\",\"comment\":\"ticket comment\",\"attachments\":[\"61527075253ba62a76ca5c\"],\"cc\":[\"cc_mail1@foo.bar\",\"cc_mail2@foo.bar\"]}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"to":"mailbox@foo.bar","subject":"ticket subject","from":"john.doe@foo.bar","body":"email content","comment":"ticket comment","attachments":["61527075253ba62a76ca5c"],"cc":["cc_mail1@foo.bar","cc_mail2@foo.bar"]}' "https://your-system-name.thulium.com/api/tickets"

HTTPie

echo '{"to":"mailbox@foo.bar","subject":"ticket subject","from":"john.doe@foo.bar","body":"email content","comment":"ticket comment","attachments":["61527075253ba62a76ca5c"],"cc":["cc_mail1@foo.bar","cc_mail2@foo.bar"]}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/tickets

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST tickets/:id/agent_response

Ostatnia modyfikacja 2024-03-20 13:15:19

Wysłanie wiadomości do zgłoszenia klienta.

URL

https://your-system-name.thulium.com/api/tickets/:id/agent_response

Parametry

id

wymagany

Identyfikator zgłoszenia. Przykładowa wartość: 1234
body

wymagany

Treść wiadomości (jako tekst lub HTML). Przykładowa wartość:

This is body.

body_type

opcjonalny

Typ wiadomości zgłoszenia.
Domyślna wartość: HTML. Przykładowa wartość: HTML|PLAIN
user_login

wymagany

Login agenta wysyłającego wiadomość Przykładowa wartość: testowy.agent11
date

opcjonalny

Data wysłania wiadomości Przykładowa wartość: 2014-07-14 12:34

Przykładowy request

POST https://your-system-name.thulium.com/api/tickets/1234/agent_response
Dane {"id":"1777","body":"Hello world.","user_login":"testowy.agent17","date":"2014-07-14 12:34"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"id":"1777","body":"Hello world.","user_login":"testowy.agent17","date":"2014-07-14 12:34"}';

$request curl_init('https://your-system-name.thulium.com/api/tickets/1234/agent_response');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/tickets/1234/agent_response", "{\"id\":\"1777\",\"body\":\"Hello world.\",\"user_login\":\"testowy.agent17\",\"date\":\"2014-07-14 12:34\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"id":"1777","body":"Hello world.","user_login":"testowy.agent17","date":"2014-07-14 12:34"}' "https://your-system-name.thulium.com/api/tickets/1234/agent_response"

HTTPie

echo '{"id":"1777","body":"Hello world.","user_login":"testowy.agent17","date":"2014-07-14 12:34"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/tickets/1234/agent_response

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST tickets/:id/comment

Ostatnia modyfikacja 2024-03-20 13:15:19

Dodanie komentarza do zgłoszenia.

URL

https://your-system-name.thulium.com/api/tickets/:id/comment

Parametry

id

wymagany

Identyfikator zgłoszenia. Przykładowa wartość: 1234
comment

wymagany

Treść komentarza. Przykładowa wartość: My ticket comment.
comment_type

opcjonalny

Typ komentarza.
Domyślna wartość: HTML. Przykładowa wartość: HTML|PLAIN
user_login

wymagany

Login użytkownika. Przykładowa wartość: jkowalski

Przykładowy request

POST https://your-system-name.thulium.com/api/tickets/1234/comment
Dane {"comment":"My ticket comment.","user_login":"jkowalski"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"comment":"My ticket comment.","user_login":"jkowalski"}';

$request curl_init('https://your-system-name.thulium.com/api/tickets/1234/comment');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/tickets/1234/comment", "{\"comment\":\"My ticket comment.\",\"user_login\":\"jkowalski\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"comment":"My ticket comment.","user_login":"jkowalski"}' "https://your-system-name.thulium.com/api/tickets/1234/comment"

HTTPie

echo '{"comment":"My ticket comment.","user_login":"jkowalski"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/tickets/1234/comment

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST tickets/:id/customer_response

Ostatnia modyfikacja 2024-03-20 13:15:19

Dodanie odpowiedzi od klienta do zgłoszenia.

URL

https://your-system-name.thulium.com/api/tickets/:id/customer_response

Parametry

id

wymagany

Identyfikator zgłoszenia. Przykładowa wartość: 1234
body

wymagany

Treść odpowiedzi (jako tekst lub HTML). Przykładowa wartość:

This is body.

body_type

opcjonalny

Typ odpowiedzi.
Domyślna wartość: HTML. Przykładowa wartość: HTML|PLAIN
date

opcjonalny

Data odpowiedzi Przykładowa wartość: 2014-07-14 12:34

Przykładowy request

POST https://your-system-name.thulium.com/api/tickets/1234/customer_response
Dane {"body":"Hello world."}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"body":"Hello world."}';

$request curl_init('https://your-system-name.thulium.com/api/tickets/1234/customer_response');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/tickets/1234/customer_response", "{\"body\":\"Hello world.\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"body":"Hello world."}' "https://your-system-name.thulium.com/api/tickets/1234/customer_response"

HTTPie

echo '{"body":"Hello world."}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/tickets/1234/customer_response

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT tickets/:id

Ostatnia modyfikacja 2024-03-20 13:15:19

Edycja zgłoszenia.

Żeby nie aktualizować poszczególnych parametrów, należy je pominąć w ramach requestu lub ustawić jako null.

URL

https://your-system-name.thulium.com/api/tickets/:id

Parametry

user_login

opcjonalny

Login przypisanego użytkownika. Przykładowa wartość: akowalski
status_id

opcjonalny

Identyfikator statusu zgłoszenia zwrócony przez zasób statusy.
substatus_id

opcjonalny

Identyfikator podstatusu zgłoszenia zwrócony przez zasób statusy.
category_id

opcjonalny

Identyfikator kategorii zgłoszenia zwrócony przez zasób kategorii.
tags

opcjonalny

Lista tagów. Przykładowa wartość: "tags":["tag1", "tag2", "tag3"]
ticket_queue_id

opcjonalny

Identyfikator kolejki zgłoszeń. Jeśli nie jest podany, to kolejka jest wybierana na podstawie skrzynki odbiorczej.
custom_fields

opcjonalny

Obiekt z wartościami pól specjalnych. Przykładowa wartość: "custom_fields":{"field_name_1":"value_1","field_name_2":"value_2"}

Przykładowy request

PUT https://your-system-name.thulium.com/api/tickets/12
Dane {"status_id":"1","substatus_id":"2","category_id":"3"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"status_id":"1","substatus_id":"2","category_id":"3"}';

$request curl_init('https://your-system-name.thulium.com/api/tickets/12');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/tickets/12", "{\"status_id\":\"1\",\"substatus_id\":\"2\",\"category_id\":\"3\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{"status_id":"1","substatus_id":"2","category_id":"3"}' "https://your-system-name.thulium.com/api/tickets/12"

HTTPie

echo '{"status_id":"1","substatus_id":"2","category_id":"3"}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/tickets/12

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT ivr/:branch/activate

Ostatnia modyfikacja 2024-03-20 13:15:19
Aktywuje gałąź IVR.

URL

https://your-system-name.thulium.com/api/ivr/:branch/activate

Parametry

branch

wymagany

Identyfikator gałęzi. Przykładowa wartość: 1-2

Przykładowy request

PUT https://your-system-name.thulium.com/api/ivr/1-2/activate

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/ivr/1-2/activate');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/ivr/1-2/activate", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/ivr/1-2/activate"

HTTPie

http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/ivr/1-2/activate

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT ivr/:branch/deactivate

Ostatnia modyfikacja 2024-03-20 13:15:19
Deaktywuje gałąź IVR.

URL

https://your-system-name.thulium.com/api/ivr/:branch/deactivate

Parametry

branch

wymagany

Identyfikator gałęzi. Przykładowa wartość: 1-2

Przykładowy request

PUT https://your-system-name.thulium.com/api/ivr/1-2/deactivate

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/ivr/1-2/deactivate');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/ivr/1-2/deactivate", "");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '' "https://your-system-name.thulium.com/api/ivr/1-2/deactivate"

HTTPie

http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/ivr/1-2/deactivate

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT ivr/:branch/prompt_file

Ostatnia modyfikacja 2024-03-20 13:15:19
Zmiana nagrania.

URL

https://your-system-name.thulium.com/api/ivr/:branch/prompt_file

Parametry

branch

wymagany

Identyfikator gałęzi. Przykładowa wartość: 1-2
token

opcjonalny

Token pliku tymczasowego zwróconego przez zasób pliki tymczasowe. Przykładowa wartość: 180174033853be57b76ed6a

Przykładowy request

PUT https://your-system-name.thulium.com/api/ivr/1-2/prompt_file
Dane {"token":"180174033853be57b76ed6a"}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"token":"180174033853be57b76ed6a"}';

$request curl_init('https://your-system-name.thulium.com/api/ivr/1-2/prompt_file');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/ivr/1-2/prompt_file", "{\"token\":\"180174033853be57b76ed6a\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{"token":"180174033853be57b76ed6a"}' "https://your-system-name.thulium.com/api/ivr/1-2/prompt_file"

HTTPie

echo '{"token":"180174033853be57b76ed6a"}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/ivr/1-2/prompt_file

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET customer_field_groups

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę grup pól specjalnych klienta

URL

https://your-system-name.thulium.com/api/customer_field_groups

Parametry

limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 1000. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10

Przykładowy request

GET https://your-system-name.thulium.com/api/customer_field_groups

Przykładowy response

{
   "count": 1,
   "result": [
      {
         "group_id": 2,
         "name": "Orders",
         "fields": [
            {
               "field_id": 12,
               "name": "Product"
            },
            {
               "field_id": 8,
               "name": "Count"
            },
            {
               "field_id": 9,
               "name": "Confirmed"
            },
            {
               "field_id": 10,
               "name": "Comment"
            }
         ]
      }
   ]
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/customer_field_groups');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/customer_field_groups");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/customer_field_groups"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/customer_field_groups Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE customer_field_group_items/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwanie rekordu pól specjalnych klienta.

URL

https://your-system-name.thulium.com/api/customer_field_group_items/:id

Parametry

id

wymagany

Identyfikator rekordu, który ma być usunięty. Przykładowa wartość: 13

Przykładowy request

DELETE https://your-system-name.thulium.com/api/customer_field_group_items/13

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/customer_field_group_items/13');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/customer_field_group_items/13");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/customer_field_group_items/13"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/customer_field_group_items/13 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET customer_field_group_items

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca listę rekordów pól specjalnych klienta

URL

https://your-system-name.thulium.com/api/customer_field_group_items

Parametry

group_id

opcjonalny

Identyfikator grupy pól zwrócony przez zasób grupy pól specjalnych
customer_id

opcjonalny

Identyfikator klienta zwrócony przez zasób klienci
limit

opcjonalny

Liczba rekordów, które mają być zwrócone. Domyślnie: 100. Maksymalna wartość: 1000. Przykładowa wartość: 100
offset

opcjonalny

Od którego rekordu należy zwrócić rezultat (używane, gdy rekordów jest więcej, niż limit). Domyślna wartość: 0. Przykładowa wartość: 10

Przykładowy request

GET https://your-system-name.thulium.com/api/customer_field_group_items?group_id=1&customer_id=123

Przykładowy response

{
   "count": 1,
   "result": [
      {
         "group_id": 2,
         "name": "Orders",
         "fields": [
            {
               "field_id": 12,
               "name": "Product"
            },
            {
               "field_id": 8,
               "name": "Count"
            },
            {
               "field_id": 9,
               "name": "Confirmed"
            },
            {
               "field_id": 10,
               "name": "Comment"
            }
         ]
      }
   ]
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/customer_field_group_items?group_id=1&customer_id=123');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/customer_field_group_items?group_id=1&customer_id=123");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/customer_field_group_items?group_id=1&customer_id=123"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/customer_field_group_items group_id==1 customer_id==123 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST customer_field_group_items

Ostatnia modyfikacja 2024-03-20 13:15:19

Dodanie rekordu pól specjalnych dla klienta.

URL

https://your-system-name.thulium.com/api/customer_field_group_items

Parametry

group_id

wymagany

Identyfikator grupy pól zwrócony przez zasób grupy pól specjalnych
customer_id

wymagany

Identyfikator klienta zwrócony przez zasób klienci
values

wymagany

Lista wartości dla pól w grupie. Identyfikatory pól można uzyskać poprzez zasób customer_field_groups Przykładowa wartość: { "field_id": 12, "value": "phone" }

Przykładowy request

POST https://your-system-name.thulium.com/api/customer_field_group_items
Dane { "group_id": 2, "customer_id": 1, "values": [ { "field_id": 12, "value": "phone" }, { "field_id": 8, "value": 13 }, { "field_id": 10, "value": "comment" } ] }

Przykładowy response

{"item_id": 38}

Przykładowe wywołanie


PHP

<?php
$data 
'{
    "group_id": 2,
    "customer_id": 1,
    "values": [
        {
            "field_id": 12,
            "value": "phone"
        },
        {
            "field_id": 8,
            "value": 13
        },
        {
            "field_id": 10,
            "value": "comment"
        }
    ]
}'
;

$request curl_init('https://your-system-name.thulium.com/api/customer_field_group_items');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/customer_field_group_items", "{
    \"group_id\": 2,
    \"customer_id\": 1,
    \"values\": [
        {
            \"field_id\": 12,
            \"value\": \"phone\"
        },
        {
            \"field_id\": 8,
            \"value\": 13
        },
        {
            \"field_id\": 10,
            \"value\": \"comment\"
        }
    ]
}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{
    "group_id": 2,
    "customer_id": 1,
    "values": [
        {
            "field_id": 12,
            "value": "phone"
        },
        {
            "field_id": 8,
            "value": 13
        },
        {
            "field_id": 10,
            "value": "comment"
        }
    ]
}' "https://your-system-name.thulium.com/api/customer_field_group_items"

HTTPie

echo '{
    "group_id": 2,
    "customer_id": 1,
    "values": [
        {
            "field_id": 12,
            "value": "phone"
        },
        {
            "field_id": 8,
            "value": 13
        },
        {
            "field_id": 10,
            "value": "comment"
        }
    ]
}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/customer_field_group_items

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP PUT

PUT customer_field_group_items/:id

Ostatnia modyfikacja 2024-03-20 13:15:19

Edycja rekordu pól specjalnych klienta.

URL

https://your-system-name.thulium.com/api/customer_field_group_items/:id

Parametry

values

wymagany

Lista wartości dla pól w grupie. Identyfikatory pól można uzyskać poprzez zasób customer_field_groups Przykładowa wartość: { "field_id": 12, "value": "phone" }

Przykładowy request

PUT https://your-system-name.thulium.com/api/customer_field_group_items/32
Dane { "values": [ { "field_id": 12, "value": "phone" }, { "field_id": 8, "value": 13 }, { "field_id": 10, "value": "comment" } ] }

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{
    "values": [
        {
            "field_id": 12,
            "value": "phone"
        },
        {
            "field_id": 8,
            "value": 13
        },
        {
            "field_id": 10,
            "value": "comment"
        }
    ]
}'
;

$request curl_init('https://your-system-name.thulium.com/api/customer_field_group_items/32');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'PUT');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.put("https://your-system-name.thulium.com/api/customer_field_group_items/32", "{
    \"values\": [
        {
            \"field_id\": 12,
            \"value\": \"phone\"
        },
        {
            \"field_id\": 8,
            \"value\": 13
        },
        {
            \"field_id\": 10,
            \"value\": \"comment\"
        }
    ]
}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X PUT -H "Content-type: application/json" -d '{
    "values": [
        {
            "field_id": 12,
            "value": "phone"
        },
        {
            "field_id": 8,
            "value": 13
        },
        {
            "field_id": 10,
            "value": "comment"
        }
    ]
}' "https://your-system-name.thulium.com/api/customer_field_group_items/32"

HTTPie

echo '{
    "values": [
        {
            "field_id": 12,
            "value": "phone"
        },
        {
            "field_id": 8,
            "value": 13
        },
        {
            "field_id": 10,
            "value": "comment"
        }
    ]
}' | http -a api_user:api_pass PUT https://your-system-name.thulium.com/api/customer_field_group_items/32

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP DELETE

DELETE webhooks/:id

Ostatnia modyfikacja 2024-03-20 13:15:19
Usuwa element webhook.

URL

https://your-system-name.thulium.com/api/webhooks/:id

Parametry

id

wymagany

Identyfikator

Przykładowy request

DELETE https://your-system-name.thulium.com/api/webhooks/1

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'';

$request curl_init('https://your-system-name.thulium.com/api/webhooks/1');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'DELETE');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.delete("https://your-system-name.thulium.com/api/webhooks/1");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X DELETE -H "Accept: application/json" "https://your-system-name.thulium.com/api/webhooks/1"

HTTPie

http -a api_user:api_pass DELETE https://your-system-name.thulium.com/api/webhooks/1 Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET webhooks

Ostatnia modyfikacja 2024-03-20 13:15:19
Zwraca wszystkie elementy webhook.

URL

https://your-system-name.thulium.com/api/webhooks

Przykładowy request

GET https://your-system-name.thulium.com/api/webhooks

Przykładowy response

[
    {
        "id": 1,
        "actions": ["CHAT_AGENT_ASSIGNED"],
        "subscription_url": "https://example.com/",
        "http_auth_user": "",
        "http_auth_password": ""
    },
    {
        "id": 2,
        "actions": ["CHAT_CONVERSATION_CREATED"],
        "subscription_url": "https://example.com/",
        "http_auth_user": "",
        "http_auth_password": ""
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/webhooks');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/webhooks");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/webhooks"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/webhooks Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST webhooks

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodaje element webhook.

URL

https://your-system-name.thulium.com/api/webhooks

Parametry

actions

wymagany

Akcje (zobacz więcej)
subscription_url

wymagany

Docelowy adres URL
http_auth_user

opcjonalny

Login Auth Basic
http_auth_password

opcjonalny

Hasło Auth Basic

Przykładowy request

POST https://your-system-name.thulium.com/api/webhooks
Dane {"actions":["CHAT_CONVERSATION_CREATED"],"subscription_url":"https:\/\/example.pl"}

Przykładowy response

{
        "id": 5,
        "actions": ["CHAT_CONVERSATION_CREATED"],
        "subscription_url": "https://example.pl",
        "http_auth_user": "",
        "http_auth_password": ""
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"actions":["CHAT_CONVERSATION_CREATED"],"subscription_url":"https:\/\/example.pl"}';

$request curl_init('https://your-system-name.thulium.com/api/webhooks');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/webhooks", "{\"actions\":[\"CHAT_CONVERSATION_CREATED\"],\"subscription_url\":\"https:\/\/example.pl\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"actions":["CHAT_CONVERSATION_CREATED"],"subscription_url":"https:\/\/example.pl"}' "https://your-system-name.thulium.com/api/webhooks"

HTTPie

echo '{"actions":["CHAT_CONVERSATION_CREATED"],"subscription_url":"https:\/\/example.pl"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/webhooks

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST voicebots/:name/calls/:call_id/transcript

Ostatnia modyfikacja 2024-03-20 13:15:19
Dodaje transkrypcję połączenia z voicebotem.

URL

https://your-system-name.thulium.com/api/voicebots/:name/calls/:call_id/transcript

Parametry

name

wymagany

Nazwa voicebota Przykładowa wartość: VendorName
call_id

wymagany

Identyfikator rozmowy z nagłówka SIP "X-Thulium-Id" Przykładowa wartość: 1234567.89
duration

opcjonalny

Czas trwania rozmowy w formacie HH:MM:SS Przykładowa wartość: 02:05:12
language

opcjonalny

Język rozmowy (np. pl, en, de) Przykładowa wartość: pl
note

opcjonalny

Notatka Przykładowa wartość: Opis konwersacji
status

wymagany

Status zakończenia połączenia z voicebotem. Dopuszczalne wartości: TRANSFERRED (przełączono rozmowę do kolejki), ABANDONED (klient się rozłączył). Przykładowa wartość: TRANSSFERRED|ABANDONED
body

wymagany

Transkrypcja Przykładowa wartość: [{"party":"bot","message":"Hej, w czym moge pomoc","timestamp":"2022-05-01T15:10:00.000Z"},{"party":"caller","message":"Przelacz mnie do kolejki","timestamp":"2022-05-01T15:10:05.000Z"}]
party

wymagany

Strona połączenia. Dopuszczalne wartości: voicebot, caller Przykładowa wartość: bot|caller
message

wymagany

Treść wypowiedzi Przykładowa wartość: Dzień dobry, chciałem porozmawiać o produkcie x
timestamp

wymagany

Znacznik czasu rozpoczęcia wypowiedzi w formacie YYYY-MM-DDThh:mm:ss.sssZ Przykładowa wartość: 2022-05-01T15:10:05.000Z

Przykładowy request

POST https://your-system-name.thulium.com/api/voicebots/some-voicebot-name/calls/1234567.89/transcript
Dane {"duration":"00:02:51","language":"pl","status":"TRANSFERRED","note":"Opis konwersacji","body":[{"party":"voicebot","message":"Hej, w czym moge pomoc","timestamp":"2022-05-01T15:10:00.000Z"},{"party":"caller","message":"Przelacz mnie do kolejki","timestamp":"2022-05-01T15:10:05.000Z"}]}

Przykładowy response

<!-- pusty -->

Przykładowe wywołanie


PHP

<?php
$data 
'{"duration":"00:02:51","language":"pl","status":"TRANSFERRED","note":"Opis konwersacji","body":[{"party":"voicebot","message":"Hej, w czym moge pomoc","timestamp":"2022-05-01T15:10:00.000Z"},{"party":"caller","message":"Przelacz mnie do kolejki","timestamp":"2022-05-01T15:10:05.000Z"}]}';

$request curl_init('https://your-system-name.thulium.com/api/voicebots/some-voicebot-name/calls/1234567.89/transcript');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/voicebots/some-voicebot-name/calls/1234567.89/transcript", "{\"duration\":\"00:02:51\",\"language\":\"pl\",\"status\":\"TRANSFERRED\",\"note\":\"Opis konwersacji\",\"body\":[{\"party\":\"voicebot\",\"message\":\"Hej, w czym moge pomoc\",\"timestamp\":\"2022-05-01T15:10:00.000Z\"},{\"party\":\"caller\",\"message\":\"Przelacz mnie do kolejki\",\"timestamp\":\"2022-05-01T15:10:05.000Z\"}]}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"duration":"00:02:51","language":"pl","status":"TRANSFERRED","note":"Opis konwersacji","body":[{"party":"voicebot","message":"Hej, w czym moge pomoc","timestamp":"2022-05-01T15:10:00.000Z"},{"party":"caller","message":"Przelacz mnie do kolejki","timestamp":"2022-05-01T15:10:05.000Z"}]}' "https://your-system-name.thulium.com/api/voicebots/some-voicebot-name/calls/1234567.89/transcript"

HTTPie

echo '{"duration":"00:02:51","language":"pl","status":"TRANSFERRED","note":"Opis konwersacji","body":[{"party":"voicebot","message":"Hej, w czym moge pomoc","timestamp":"2022-05-01T15:10:00.000Z"},{"party":"caller","message":"Przelacz mnie do kolejki","timestamp":"2022-05-01T15:10:05.000Z"}]}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/voicebots/some-voicebot-name/calls/1234567.89/transcript

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET topics

Ostatnia modyfikacja 2024-03-20 13:15:19

Zwraca tematy rozmów.

Zwracane są jedynie aktywne grupy tematów a w ich ramach jedynie aktywne tematy.

URL

https://your-system-name.thulium.com/api/topics

Przykładowy request

GET https://your-system-name.thulium.com/api/topics

Przykładowy response

[
    {
        "id": 1,
        "name": "Topic name 1,
        "show_custom_fields": true,
        "group_name": "Group 1"
    },
    {
        "id": 2,
        "name": "Topic name 2,
        "show_custom_fields": true,
        "group_name": "Group 1"
    },
    {
        "id": 3,
        "name": "Topic name 3,
        "show_custom_fields": false,
        "group_name": "Group 2"
    }
]

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/topics');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/topics");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/topics"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/topics Accept:application/json

Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST sms_messages

Ostatnia modyfikacja 2024-03-20 13:15:19

Wysłanie SMS-a.

URL

https://your-system-name.thulium.com/api/sms_messages

Parametry

phone_number

wymagany

Numer telefonu odbiorcy. Przykładowa wartość: 48666777888
body

wymagany

Treść SMS-a. Przykładowa wartość: Hello, world!
customer_id

opcjonalny

Identyfikator klienta zapisanego w CRM (SMS zostanie zapisany w jego historii kontaktu). Przykładowa wartość: 41
sms_mailbox_id

opcjonalny

Identyfikator skrzynki SMS, którą zostanie wysłana wiadomość (jeśli puste, to wysyła nastąpi z konta domyślnego). Przykładowa wartość: 2
user_login

opcjonalny

Login użytkownika, w imieniu którego wysyłamy wiadomość (jak puste, to wyśle się z konta Automat). Przykładowa wartość: jan.kowalski

Przykładowy request

POST https://your-system-name.thulium.com/api/sms_messages
Dane {"phone_number":"48666777888","body":"Hello, world!","customer_id":1,"sms_mailbox_id":2,"user_login":"jan.kowalski"}

Przykładowy response

{
    sms_message_id: 1234
}

Przykładowe wywołanie


PHP

<?php
$data 
'{"phone_number":"48666777888","body":"Hello, world!","customer_id":1,"sms_mailbox_id":2,"user_login":"jan.kowalski"}';

$request curl_init('https://your-system-name.thulium.com/api/sms_messages');
curl_setopt($requestCURLOPT_HTTPHEADER, array(
    
'Content-Type: application/json; charset=utf-8',
    
'Content-Length: ' mb_strlen($data)
));
curl_setopt($requestCURLOPT_USERPWD'api_user:api_pass');
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);
curl_setopt($requestCURLOPT_CUSTOMREQUEST'POST');
curl_setopt($requestCURLOPT_POSTFIELDS$data);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_HTTP_CODE);
    if (
$httpCode == 200){
        
print_r(json_decode($response));
    } else {
        echo 
$response;
    }
} else {
    
trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA

public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/sms_messages", "{\"phone_number\":\"48666777888\",\"body\":\"Hello, world!\",\"customer_id\":1,\"sms_mailbox_id\":2,\"user_login\":\"jan.kowalski\"}");
        System.out.println(response);
    }
}

CURL

curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{"phone_number":"48666777888","body":"Hello, world!","customer_id":1,"sms_mailbox_id":2,"user_login":"jan.kowalski"}' "https://your-system-name.thulium.com/api/sms_messages"

HTTPie

echo '{"phone_number":"48666777888","body":"Hello, world!","customer_id":1,"sms_mailbox_id":2,"user_login":"jan.kowalski"}' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/sms_messages