Ticket

Downloading a list of tickets

All tickets can be downloaded using the API method [GET] messages/list.

Sample query

 curl -H 'x-user-token=1234567890' -i https://app.ngchat.com/api/messages/list

Sample server response

{ "status": 1,
"messages": [{
 "id": "593",
 "domain_token": "eglwK",
 "body": "Dzien dobry. Jestem zainteresowana zestawem http:\/\/sklepsunspa.pl\/opalanie-natryskowe\/urzadzenia-opalajace\/zestaw-do-opalania-natryskowego-venus-z-certyfikatem.html wraz ze szkoleniem. Na szkolenie musze przyjechac w ustalone miejsce czy Panstwo sie do mnie pofatyguja?? pozdrawiam ",
 "email": "user@domain.com",
 "time_send": "1440940413",
 "time_read": "1440951965",
 "ngchat_user_data": {
 "cart_info": {
 "products": [],
 "total_cart_price": [{
 "total_price": 0,
 "currency_code": null
 }]
 },
 "user_info": {
 "uuid": "d7530120-430d-80d1-f4ec2b646405",
 "email": null,
 "name": null,
 "lastname": null,
 "conversion": "0.00",
 "street": [],
 "city": null,
 "postcode": null,
 "country": null,
 "telephone": null
 },
 "order_info": {
 "order": [],
 "total": [{
 "qty": 0,
 "total_price": "0.00",
 "average": "0.00",
 "currency_code": "PLN"
 }]
 },
 "latest24": {
 "view": [{
 "id_prod": "113",
 "name_prod": "Zestaw do opalania natryskowego do domowego u\u017cytku",
 "price_prod": 1600,
 "currency_code": "PLN",
 "url_prod": "http:\/\/domain.com\/zestaw-do-opalania-natryskowego-do-domowego-uzytku.html\/",
 "img_url_prod": "http:\/\/domain.com\/media\/catalog\/product\/o\/p\/opalanienatryskowezestaw.jpg"
 }],
 "cart": [],
 "order": []
 },
 "conversion": {
 "customer": {
 "view_c": "1",
 "order_c": "0",
 "cart_c": "0",
 "conversion": "0.00"
 },
 "geolocal_country": {
 "view_c": "6459",
 "order_c": "102",
 "cart_c": "310",
 "conversion": "1.58"
 },
 "geolocal_city": null
 },
 "abandoned_products": []
 },
 "client_uuid": "d4af6218",
 "geoinfo": "no data",
 "direction": "1",
 "display": null
 }

Downloading the ticket

A single ticket can be downloaded using the API method [GET] messages/showmessages/:id.

Parameters:

  • id – ticket ID

Sample query

 curl -H 'x-user-token=1234567890'  -i https://app.ngchat.com/api/messages/showmessage/597

Sample server response

 {
 "status": 1,
 "messages": [{
 "domain_token": "eglwK",
 "body": "witam!",
 "email": "user@somedomain.com",
 "time_send": "1441705286",
 "time_read": "1441705303",
 "ngchat_user_data": "{\"cart_info\":{\"products\":[],\"total_cart_price\":[{\"total_price\":0,\"currency_code\":null}]},\"user_info\":{\"uuid\":\"5dd46a8d-46ac-8caa-fe2b25a3c494\",\"email\":null,\"name\":null,\"lastname\":null,\"conversion\":\"0.00\",\"street\":[\"\"],\"city\":null,\"postcode\":null,\"country\":null,\"telephone\":null},\"order_info\":{\"order\":[],\"total\":[{\"qty\":0,\"total_price\":\"0.00\",\"average\":\"0.00\",\"currency_code\":\"PLN\"}]},\"latest24\":{\"view\":[],\"cart\":[],\"order\":[]},\"conversion\":{\"customer\":{\"view_c\":\"7\",\"order_c\":\"0\",\"cart_c\":\"2\",\"conversion\":\"0.00\"},\"geolocal_country\":{\"view_c\":\"7023\",\"order_c\":\"104\",\"cart_c\":\"316\",\"conversion\":\"1.48\"},\"geolocal_city\":null},\"abandoned_products\":[{\"id_prod\":\"79\",\"name_prod\":\"Koktail do mezoterapii mikroig\\u0142owej Clarena\",\"url_prod\":\"http:\\\/\\\/domain.com\\\/koktail-do-mezoterapii-mikroiglowej-clarena.html\\\/\",\"img_url_prod\":\"http:\\\/\\\/sklepsunspa.pl\\\/media\\\/catalog\\\/product\\\/c\\\/l\\\/clarena.jpg\",\"price_prod\":120,\"currency_code\":\"PLN\"},{\"id_prod\":\"96\",\"name_prod\":\"P\\u0142atki pod oczy do przed\\u0142u\\u017cania rz\\u0119s metod\\u0105 1:1 1 para\",\"url_prod\":\"http:\\\/\\\/domain.com\\\/platki-pod-oczy-do-przedluzania-rzes-metoda-1-19.html\\\/\",\"img_url_prod\":\"http:\\\/\\\/domain.com\\\/media\\\/catalog\\\/product\\\/p\\\/5\\\/p5106926.jpg\",\"price_prod\":4.99,\"currency_code\":\"PLN\"}]}",
 "client_uuid": "f82db837",
 "geoinfo": "{\"user_ip\":\"193.239.56.196\",\"user_location\":\"Wroc\\u0142aw\",\"country_name\":\"Poland\",\"region_name\":\"Lower Silesian Voivodeship\",\"lt\":51.1,\"lg\":17.033,\"time_zone\":\"Europe\\\/Warsaw\",\"country_code\":\"pl\",\"browser_type\":\"Chrome 39\",\"user_referer\":\"http:\\\/\\\/domain.com\",\"os\":\"linux\",\"mobile\":null}",
 "direction": "1",
 "display": null,
 "users": {
 "name": "Konsultant",
 "email": "admin@domain.com",
 "role": "admin",
 "status": "2",
 "chats": "1",
 "conversationblocks": "[{\"width\":\"3\",\"blocks\":[{\"name\":\"browser-info\",\"index\":1},{\"name\":\"informations\",\"index\":2}]},{\"width\":\"4\",\"blocks\":[{\"name\":\"notes\",\"index\":1},{\"name\":\"pages-info\",\"index\":2},{\"name\":\"custom_fields\",\"index\":3},{\"name\":\"cart\",\"index\":4},{\"name\":\"orders-info\",\"index\":5}]},{\"width\":\"5\",\"blocks\":[{\"name\":\"chat\",\"index\":1,\"background\":\"#F59B19\"},{\"name\":\"latest24\",\"index\":6},{\"name\":\"abandoned_products\",\"index\":7}]},{\"blocks\":[{\"name\":\"conversion-info\",\"index\":0},{\"name\":\"geolocal_country\",\"index\":1},{\"name\":\"geolocal_city\",\"index\":2},{\"name\":\"\\n\",\"index\":3},{\"name\":\"VwOkpZhHAuVF\",\"index\":4}]}]",
 "uuid": "cEqnl9YF2jKUe9hZ4TClHBzDOHF0D7",
 "job_title": "Konsultant"
 }
 }, {
 "domain_token": null,
 "body": "elo",
 "email": "user@somedomain.com",
 "time_send": "1441705309",
 "time_read": null,
 "ngchat_user_data": null,
 "client_uuid": "f82db837",
 "geoinfo": null,
 "direction": "0",
 "display": null,
 "users": {
 "name": "Konsultant",
 "email": "admin@domain.com",
 "role": "admin",
 "status": "2",
 "chats": "1",
 "conversationblocks": "[{\"width\":\"3\",\"blocks\":[{\"name\":\"browser-info\",\"index\":1},{\"name\":\"informations\",\"index\":2}]},{\"width\":\"4\",\"blocks\":[{\"name\":\"notes\",\"index\":1},{\"name\":\"pages-info\",\"index\":2},{\"name\":\"custom_fields\",\"index\":3},{\"name\":\"cart\",\"index\":4},{\"name\":\"orders-info\",\"index\":5}]},{\"width\":\"5\",\"blocks\":[{\"name\":\"chat\",\"index\":1,\"background\":\"#F59B19\"},{\"name\":\"latest24\",\"index\":6},{\"name\":\"abandoned_products\",\"index\":7}]},{\"blocks\":[{\"name\":\"conversion-info\",\"index\":0},{\"name\":\"geolocal_country\",\"index\":1},{\"name\":\"geolocal_city\",\"index\":2},{\"name\":\"\\n\",\"index\":3},{\"name\":\"VwOkpZhHAuVF\",\"index\":4}]}]",
 "uuid": "cEqnl9YF2jKUe9hZ4TClHBzDOHF0D7",
 "job_title": "Konsultant"
 }
 }]
}