Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,24 @@ Shows the number of reached goals.

Returns current LiveChat status.

### Tickets

#### api.tickets.list(parameters, callback)

Returns all tickets.

#### api.tickets.get(id, parameters, callback)

Returns single ticket item for the given `id`.

#### api.tickets.create(parameters, callback)

Create a ticket.

#### api.tickets.tags(id, parameters, callback)

Update tags of a single ticket item for the given `id`.

### Visitors

### api.visitors.list(callback)
Expand Down
37 changes: 35 additions & 2 deletions lib/api.js
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions src/api.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,22 @@ class PushPages extends BasicCrud
constructor: (@api) ->
super @api, 'push_pages'

class Tickets extends BasicCrud
constructor: (@api) ->
super @api, 'tickets'

delete @.update
delete @.delete

tags: (id, params = {}, callback) =>
if typeof params == 'function' and !callback?
callback = params
params = {}

@api.put 'tickets/' + id + '/tags', params, (response) =>
if callback?
callback response

class TrackingCode
constructor: (@api) ->
@path = 'tracking_code'
Expand Down Expand Up @@ -367,6 +383,7 @@ class LiveChatApi extends Requester
@groups = new Groups(@) # 2
@reports = new Reports(@) # @ 2
@greetings = new Greetings(@) # 2
@tickets = new Tickets(@) # 2
else if @apiVersion == 1
@operators = new Operators(@) # 1
@offline_messages = new OfflineMessages(@) # 1
Expand Down