Module: WixAnswers::REST::Ticket
- Included in:
- API
- Defined in:
- lib/wixanswers/rest/ticket.rb
Instance Method Summary collapse
-
#add(options = {}) ⇒ WixAnswers::Models::Ticket
Create a ticket for the authenticated user associated with the JWT token.
-
#add_as_agent(ticket_id, reply_id, options = {}) ⇒ WixAnswers::Models::Ticket
Create a new ticket from an existing user reply.
-
#add_as_guest(options = {}) ⇒ WixAnswers::Models::Ticket
Create a new ticket for an unauthenticated user who has provided an email address.
-
#add_callback_request(options = {}) ⇒ WixAnswers::Models::Ticket
Create a new callback request ticket to the passed phone number, for the user associated with the JWT token.
-
#add_on_behalf(options = {}) ⇒ WixAnswers::Models::Ticket
Create a ticket on behalf of an authenticated or unauthenticated user.
-
#assign(ticket_id) ⇒ WixAnswers::Models::Ticket
Assign a ticket to an agent or an agent group.
-
#assign_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Assign one or more tickets to an agent or an agent group.
-
#authenticate(ticket_id) ⇒ WixAnswers::Models::Ticket
Authenticate a ticket.
-
#count(options = {}) ⇒ Hash
Get the number of tickets matching one or more saved filters.
-
#find_by_number(ticket_number) ⇒ WixAnswers::Models::Ticket
Get a ticket by its ticket reference number (issue ID).
-
#mark_not_spam(ticket_id) ⇒ WixAnswers::Models::Ticket
Mark a ticket as not spam.
-
#mark_not_spam_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Mark one or more tickets as not spam.
-
#mark_spam(ticket_id) ⇒ WixAnswers::Models::Ticket
Mark a ticket as spam.
-
#mark_spam_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Mark one or more tickets as spam.
-
#my_ticket(ticket_id) ⇒ WixAnswers::Models::Ticket
Get one of your tickets by its ID.
-
#search(options = {}) ⇒ Array<WixAnswers::Models::Ticket>
Get list of tickets that match the search/filtering criteria.
-
#search_mine(options = {}) ⇒ Array<WixAnswers::Models::Ticket>
Get list of your tickets that match the search/filtering criteria.
-
#ticket(ticket_id) ⇒ WixAnswers::Models::Ticket
(also: #find_by_id)
Get a ticket by its ID.
-
#transfer(ticket_id, options = {}) ⇒ WixAnswers::Models::Ticket
Transfer a ticket; this changes the user associated with a ticket.
-
#unassign(ticket_id) ⇒ WixAnswers::Models::Ticket
Remove the agent or group assignment from a ticket.
-
#unassign_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Remove the agent or group assignment from one or more tickets.
-
#update_priority(ticket_id, options = {}) ⇒ WixAnswers::Models::Ticket
Update a ticket’s priority.
-
#update_priority_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Update one or more tickets’ priorities.
-
#update_status(ticket_id, options = {}) ⇒ WixAnswers::Models::Ticket
Update a ticket’s status.
-
#update_status_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Update one or more tickets’ statuses.
Instance Method Details
#add(options = {}) ⇒ WixAnswers::Models::Ticket
Create a ticket for the authenticated user associated with the JWT token
16 17 18 |
# File 'lib/wixanswers/rest/ticket.rb', line 16 def add( = {}) WixAnswers::Models::Ticket.new(perform_request("/tickets", :post, )) end |
#add_as_agent(ticket_id, reply_id, options = {}) ⇒ WixAnswers::Models::Ticket
Create a new ticket from an existing user reply. The new ticket takes many of its details (user, priority, status, and so forth) from the existing ticket, and the new contents from the reply. After creating the ticket, Wix Answer invokes the Ticket Created webhook.
68 69 70 |
# File 'lib/wixanswers/rest/ticket.rb', line 68 def add_as_agent(ticket_id, reply_id, = {}) WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/replies/#{reply_id}/createTicket", :post, )) end |
#add_as_guest(options = {}) ⇒ WixAnswers::Models::Ticket
Create a new ticket for an unauthenticated user who has provided an email address. Use this API only when a user GUID is not available, for example when an unregistered user creates a ticket on your site or widget.
52 53 54 |
# File 'lib/wixanswers/rest/ticket.rb', line 52 def add_as_guest( = {}) WixAnswers::Models::Ticket.new(perform_request("/tickets/guest", :post, )) end |
#add_callback_request(options = {}) ⇒ WixAnswers::Models::Ticket
Create a new callback request ticket to the passed phone number, for the user associated with the JWT token. Requires a line that supports outbound calls.
83 84 85 86 |
# File 'lib/wixanswers/rest/ticket.rb', line 83 def add_callback_request( = {}) [:phoneNumber] = [:phoneNumber].is_a?(WixAnswers::Models::PhoneNumber) ? [:phoneNumber].attrs : [:phoneNumber] WixAnswers::Models::Ticket.new(perform_request("/tickets/callbackRequests", :post, )) end |
#add_on_behalf(options = {}) ⇒ WixAnswers::Models::Ticket
Create a ticket on behalf of an authenticated or unauthenticated user. Use this in response to a user request where the agent creates the ticket based on that request on behalf of the user.
35 36 37 |
# File 'lib/wixanswers/rest/ticket.rb', line 35 def add_on_behalf( = {}) WixAnswers::Models::Ticket.new(perform_request("/tickets/onBehalf", :post, )) end |
#assign(ticket_id) ⇒ WixAnswers::Models::Ticket
Assign a ticket to an agent or an agent group.
168 169 170 |
# File 'lib/wixanswers/rest/ticket.rb', line 168 def assign(ticket_id) WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/assign", :post)) end |
#assign_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Assign one or more tickets to an agent or an agent group.
184 185 186 |
# File 'lib/wixanswers/rest/ticket.rb', line 184 def assign_many(={}) perform_request("/tickets/assign", :post, ).map {|ticket| WixAnswers::Models::Ticket.new(ticket)} end |
#authenticate(ticket_id) ⇒ WixAnswers::Models::Ticket
Authenticate a ticket.
268 269 270 |
# File 'lib/wixanswers/rest/ticket.rb', line 268 def authenticate(ticket_id) WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/authenticate", :post)) end |
#count(options = {}) ⇒ Hash
Get the number of tickets matching one or more saved filters.
157 158 159 |
# File 'lib/wixanswers/rest/ticket.rb', line 157 def count( = {}) perform_request("/tickets/filtersCounts", :post, ) end |
#find_by_number(ticket_number) ⇒ WixAnswers::Models::Ticket
Get a ticket by its ticket reference number (issue ID). This requires agent privileges; to get one of your own tickets (with user privileges), see Get One of Your Tickets by ID.
109 110 111 |
# File 'lib/wixanswers/rest/ticket.rb', line 109 def find_by_number(ticket_number) WixAnswers::Models::Ticket.new(perform_request("/tickets/byNumber/#{ticket_number}/admin")) end |
#mark_not_spam(ticket_id) ⇒ WixAnswers::Models::Ticket
Mark a ticket as not spam
233 234 235 |
# File 'lib/wixanswers/rest/ticket.rb', line 233 def mark_not_spam(ticket_id) perform_request("/tickets/#{ticket_id}/markHam", :post) end |
#mark_not_spam_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Mark one or more tickets as not spam
257 258 259 |
# File 'lib/wixanswers/rest/ticket.rb', line 257 def mark_not_spam_many(={}) perform_request("/tickets/markHam", :post, ) end |
#mark_spam(ticket_id) ⇒ WixAnswers::Models::Ticket
Mark a ticket as spam
222 223 224 |
# File 'lib/wixanswers/rest/ticket.rb', line 222 def mark_spam(ticket_id) perform_request("/tickets/#{ticket_id}/markSpam", :post) end |
#mark_spam_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Mark one or more tickets as spam
245 246 247 |
# File 'lib/wixanswers/rest/ticket.rb', line 245 def mark_spam_many(={}) perform_request("/tickets/markSpam", :post, ) end |
#my_ticket(ticket_id) ⇒ WixAnswers::Models::Ticket
Get one of your tickets by its ID. The main use-case for this API is from the Help Center. If you have agent privileges, you can get any ticket by its reference number or id; see Get a Ticket by Ticket Reference Number.
122 123 124 |
# File 'lib/wixanswers/rest/ticket.rb', line 122 def my_ticket(ticket_id) WixAnswers::Models::Ticket.new(perform_request("/tickets/byNumber/#{ticket_id}/my")) end |
#search(options = {}) ⇒ Array<WixAnswers::Models::Ticket>
Get list of tickets that match the search/filtering criteria.
133 134 135 |
# File 'lib/wixanswers/rest/ticket.rb', line 133 def search( = {}) perform_request("/tickets/search/admin", :post, ).map {|ticket| WixAnswers::Models::Ticket.new(ticket) } end |
#search_mine(options = {}) ⇒ Array<WixAnswers::Models::Ticket>
Get list of your tickets that match the search/filtering criteria. The main use-case for this API is from the Help Center.
145 146 147 |
# File 'lib/wixanswers/rest/ticket.rb', line 145 def search_mine( = {}) perform_request("/tickets/my", :post, ).map {|ticket| WixAnswers::Models::Ticket.new(ticket) } end |
#ticket(ticket_id) ⇒ WixAnswers::Models::Ticket Also known as: find_by_id
Get a ticket by its ID. This requires agent privileges; to get one of your own tickets (with user privileges), see Get One of Your Tickets by ID.
96 97 98 |
# File 'lib/wixanswers/rest/ticket.rb', line 96 def ticket(ticket_id) WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/admin")) end |
#transfer(ticket_id, options = {}) ⇒ WixAnswers::Models::Ticket
Transfer a ticket; this changes the user associated with a ticket. Use when an existing ticket is found to be relevant for the user, such as one opened initially for an unauthenticated user. For example, when a) an unauthenticated user is created from an email and then b) an agent moves the ticket to an existing authenticated user.
284 285 286 |
# File 'lib/wixanswers/rest/ticket.rb', line 284 def transfer(ticket_id, ={}) WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/transfer", :post, )) end |
#unassign(ticket_id) ⇒ WixAnswers::Models::Ticket
Remove the agent or group assignment from a ticket.
195 196 197 |
# File 'lib/wixanswers/rest/ticket.rb', line 195 def unassign(ticket_id) WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/unassign", :post)) end |
#unassign_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Remove the agent or group assignment from one or more tickets.
211 212 213 |
# File 'lib/wixanswers/rest/ticket.rb', line 211 def unassign_many(={}) perform_request("/tickets/unassign", :post, ).map {|ticket| WixAnswers::Models::Ticket.new(ticket)} end |
#update_priority(ticket_id, options = {}) ⇒ WixAnswers::Models::Ticket
Update a ticket’s priority
323 324 325 |
# File 'lib/wixanswers/rest/ticket.rb', line 323 def update_priority(ticket_id, ={}) WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/priority", :put, )) end |
#update_priority_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Update one or more tickets’ priorities
336 337 338 |
# File 'lib/wixanswers/rest/ticket.rb', line 336 def update_priority_many(={}) perform_request("/tickets/setPriority", :post, ).map {|ticket| WixAnswers::Models::Ticket.new(ticket)} end |
#update_status(ticket_id, options = {}) ⇒ WixAnswers::Models::Ticket
Update a ticket’s status
297 298 299 |
# File 'lib/wixanswers/rest/ticket.rb', line 297 def update_status(ticket_id, ={}) WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/status", :put, )) end |
#update_status_many(options = {}) ⇒ Array[WixAnswers::Models::Ticket]
Update one or more tickets’ statuses
310 311 312 |
# File 'lib/wixanswers/rest/ticket.rb', line 310 def update_status_many(={}) perform_request("/tickets/setStatus", :post, ).map {|ticket| WixAnswers::Models::Ticket.new(ticket)} end |