Integruj własną aplikację z systemem Sugester. REST API z JSON — klienci, zadania, maile, deale, formularze i więcej.
Pełna dokumentacja na GitHubOpis jak zintegrować własną aplikację lub serwis z systemem
Dzięki API można z innych systemów dodawać posty/sugestie/błędy itp
Po zalogowaniu się do Sugester w menu Ustawienie > API znajdują się przykłady działające na danym koncie. Są one też dostępne na stronie http://api.sugester.pl/app/account/api
+ Pobieranie danych wszystkich klientów
+ Pobieranie danych wszystkich zadań(z helpdesku)
+ Dodanie komentarza do zadania
+ Pobieranie danych wszystkich deali
+ Aktualizacja danych kontaktu
+ Dodanie nowej listy odbiorców
+ Pobranie danych listy odbiorców
+ Aktualizacja danych listy odbiorców
Kod autoryzacyjny API (API_TOKEN) należy pobrać z ustawień aplikacji w menu: Ustawienia > API > Kod autoryzacyjny API. Dzięku niemu w wywołaniach API nie trzeba będzie podawać swojego loginu/hasła.
curl http://YOUR-PREFIX.sugester.pl/app/clients.json\ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "client": { "name":"client 1 from API", "email": "[email protected]", "note": "note 1" } }'
curl http://YOUR-PREFIX.sugester.pl/app/clients.json?api_token=YOUR_API_TOKEN
curl http://YOUR-PREFIX.sugester.pl/app/clients/1234.json?api_token=YOUR_API_TOKEN
curl http://YOUR-PREFIX.sugester.pl/app/clients/1234.json\ -X PUT \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "client": { "note": "note from API" } }'
curl -X DELETE http://YOUR-PREFIX.sugester.pl/app/clients/12345.json?api_token=YOUR_API_TOKEN
curl http://YOUR-PREFIX.sugester.pl/app/posts.json \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "post": { "title":"task title 1 from API", "content": "task content 1", "task_kind": "task", "client_id": null, "responsible_id": 1234 } }'
curl http://YOUR-PREFIX.sugester.pl/app.json?api_token=YOUR_API_TOKEN
curl http://YOUR-PREFIX.sugester.pl/app/posts/1234.json?api_token=YOUR_API_TOKEN
curl http://YOUR-PREFIX.sugester.pl/app/posts.json \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "post": { "post_id": 123, "title":"comment for task 123", "content": "comment content 1", "task_kind": "comment", "client_id": null, "responsible_id": 1234 } }'
curl http://YOUR-PREFIX.sugester.pl/app/deals.json\ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "deal": { "name":"deal 1 from API", "description": "desc 1", "client_id": null } }'
curl http://YOUR_PREFIX.sugester.pl/app/deals/1234.json\ -X PUT \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "deal": { "description": "new description from API" } }'
curl http://YOUR-PREFIX.sugester.pl/app/deals.json?api_token=YOUR_API_TOKEN
curl http://YOUR-PREFIX.sugester.pl/app/deals/1234.json?api_token=YOUR_API_TOKEN
curl -X DELETE http://YOUR-PREFIX.sugester.pl/app/deals/12345.json?api_token=YOUR_API_TOKEN
curl http://YOUR_PREFIX.sugester.pl/app/contacts.json\ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "contact": { "name":"contact 1 from API", "description": "new contact from API", "first_name": "John", "last_name": "Doe", "responsible_id": 1, "email": "[email protected]", "phone": "123456789" } }'
curl http://YOUR-PREFIX.sugester.pl/app/contacts/1234.json?api_token=YOUR_API_TOKEN
curl http://YOUR_PREFIX.sugester.pl/app/contacts/1234.json\ -X PUT \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "contact": { "description": "new description from API" } }'
curl https://YOUR_PREFIX.sugester.pl/app/contact_lists.json \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_KEY", "contact_list": { "name": "New contact list" } }'
curl https://YOUR_PREFIX.sugester.pl/app/contact_lists/10.json?api_token=YOUR_API_TOKEN
curl https://YOUR_PREFIX.sugester.pl/app/contact_lists/10.json \ -X PUT \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "contact_list": { "name": "New contact list updated" } }'
curl http://your-prefix.sugester.pl/app/posts.json \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "API_TOKEN", "post": { "title":"post title2", "content": "post content 2", "kind": "error" } }'
curl http://YOUR-PREFIX.sugester.pl/app/account.json \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "account": { "prefix":"sugester2", "initial_module": "crm", "from_partner": "partner1" }, "user": { "login": "login1", "email": "[email protected]", "password": "password1" } }'
curl https://YOUR_PREFIX.sugester.pl/app/clients.json \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "client": { "name": "client 2 from External APP via API", "email": "[email protected]", "note": "note ext 2", "external_ids": { "myapp_client_id": "17" } } }'
curl https://YOUR_PREFIX.sugester.pl/app/deals.json \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d ' { "api_token": "YOUR_API_TOKEN", "deal": { "name": "deal 2 from External APP via API", "description": "desc 2", "price": 117, "client": { "name": "client 2 from External APP via API", "email": "[email protected]", "external_ids": { "myapp_client_id": "17" } }, "external_ids": { "myapp_invoice_id": "21" } } }'
{
"id": id klienta
"name": nazwa klienta
"tax_no": numer nip
"post_code": kod pocztowy
"city": miejscowosc
"street": ulica
"first_name": imię
"country": kraj
"email": e-mail
"phone": telefon
"www": strona www
"fax": fax
"created_at": utworzenie
"updated_at": aktualizcja
"street_no": ulica
"kind": rodza ('buyer/seller')
"bank": nazwa banku
"bank_account": konto bankowe
"bank_account_id":
"shortcut": skrót nazwy klienta
"note": notatka
"last_name": nazwisko
"discount": zniżka
"payment_to_kind": domyślny cza płatności faktury
"use_delivery_address": adres korespondencyjny aktywny
"delivery_address": adres korespondencyjny
"mobile_phone": telefon komórkowy
"company": czy firma
"register_number": numer regon
"description": opis
"project_id": id projektu
"contact_id": id kontaktu głównego
"appendixes_count": ilość załączników
"posts_count": ilość emaili/zadań
"contacts_count": ilość kontaktów
"last_activity": ostatnia aktywność
"string1..10": pola dodatkowe
"integer1..10": pola dodatkowe
"decimal1..10": pola dodatkowe
"checkbox1..10": pola dodatkowe
"date1..10": pola dodatkowe
"text1..10": pola dodatkowe
"datetime1..10": pola dodatkowe
"avatar_file_name": avatar
"avatar_content_type"
"avatar_file_size"
"avatar_updated_at"
"status_id": id statusu
"category_id": id kategorii
"department_id": id departamentu
"position": pozycja
"creator_id": id osoby ktora dodala
"updater_id": id osoby ktora ostatnio aktualizowala
"responsible_id": id osoby odpowiedzialnej
"province": wojewodztwo
"sensitive_data": czy dane ukryte
"external_id": ID klienta
"token": token klienta
"paid_from": od kiedy płatny
"paid_to": do kiedy płatny
"paid_total": suma płatności od klienta
}{
"id": id posta
"title": tytuł
"content": treść
"kind": rodzaj sugestii ('suggestion', 'error', 'question', 'praise', 'private'),
"user_id": id usera
"points": liczba punktów
"nick": nick usera
"votes_cache": ilość oddanych głosów
"comments_cache": ilość oddanych komentarzy
"forum_id": id forum
"category_id": id category
"created_at": czas utworzenia
"updated_at": czas ostatniej modyfikacji
"ip": ip z którego oddano post
"agent": info o przeglądarce
"response": odpowiedź główna
"response_user_id": id osoby która odpowiedziała
"referrer": refferer
"responsible_id": id przypisanej osoby
"last_action_status": status ("created"),
"email": email nadawcy
"uid": token użytkownika,
"spam_kind": rodzaj spamu,
"answer": odpowiedz,
"answered": czy jest odpowiedz,
"duplicate_from_id": id duplikatu,
"abstract": abstrakt,
"status_id": id status,
"view_count": ilość wyświetleń,
"tags": tagi,
"facebook_likes": ilość like facebokoowych,
"min_votes_to_start": ilość głosów do rozpoczęcia prac,
"use_html": czy html,
"email_to": adres email do,
"email_cc": adres email cc,
"email_bcc": adres email bcc,
"spam_score": scoring spamowy,
"spam_report": info o spamie,
"closed": czy zamkniete (true/false),
"scheduled_at": przypisana data wykonania,
"task_kind": rodzaj zadania ('feedback', 'email', 'task', 'help', 'chat', 'phone', 'lead', 'error', 'idea'),
"priority": priorytet,
"title_note": null,
"user_spam_report": zgłoszenie spamu,
"client_id": id klienta,
"project_id": id projektu,
"help_link": klucz linka pomocy,
"help_content": treść pomocy,
"post_id": id postu nadrzędnego,
"www": strona www dodajacego post,
"private": czy prywatny (true/false),
"unread": czy nie przeczytany (true/false),
"email_recipient": do kogo jest dany post (uzywane w helpdesk/mail),
"email_reply_to": reply to (uzywane w helpdesk/mail)
}