Zendesk Library

The following functions provide Zendesk customer support integration. View the Zendesk API for more details.

 

Functions

 

Zendesk.authenticate

Usage: authenticate(url, username, token)

Login to your Zendesk account

  • Credit cost: 1
  • Parameters:
    • urlstring url to Zendesk account.
    • usernamestring Zendesk account email.
    • tokenstring token provided here.
  • Returns:
    • None



Zendesk.get_tickets

Usage: get_tickets()

Return all the tickets.

  • Credit cost: 1
  • Parameters:
    • None
  • Returns:
    • All tickets on the authenticated Zendesk account



Zendesk.get_ticket

Usage: get_ticket(ticket_id)

Returns a specific ticket.

  • Credit cost: 1
  • Parameters:
    • ticket_idint The number automatically assigned to a ticket when created.
  • Returns:
    • Info of the specified ticket



Zendesk.get_tickets_search

Usage: get_tickets_search(keyword)

Returns a list of all the tickets containing the search keyword.

  • Credit cost: 1
  • Parameters:
    • keywordstring The word to be searched for within all the tickets
  • Returns:
    • List of all tickets containing the search keyword



Zendesk.create_ticket

Usage: create_ticket(subject, comment, requesterID=None, filename=None, contenttype=None, content=None, external=False)

Create a new ticket.

  • Credit cost: 1
  • Parameters:
    • subjectstring The subject of the ticket.
    • commentstring Required. A comment object that describes the problem, incident, question, or task.
    • requesterIDstring The numeric ID of the user asking for support through the ticket.
    • filename:
    • contenttype:
    • content:
    • external:
  • Returns:
    • None



Zendesk.update_ticket

update_ticket(ticket_id, comment, filename=None, contenttype=None, content=None, external=False)

Update an existing ticket.

  • Credit cost: 1
  • Parameters:
    • ticket_idint The number automatically assigned to a ticket when created.
    • commentstring Required. A comment object that describes the problem, incident, question, or task.
    • filename:
    • contenttype:
    • content:
    • external:
  • Returns:
    • None

 

Sample Code

 

import Zendesk

Zendesk.authenticate("https://medium1.zendesk.com", "david@mediumone.com", "QndHWjjsmEk4a6WuXl94TFZ2pvAdmz4xQkH7s0Lv")
tickets = Zendesk.get_tickets()
new_ticket = Zendesk.create_ticket('lakshans subject', 'lakshans comment')
Zendesk.update_ticket(new_ticket['ticket_id'], 'lakshans comment with attachment', 'lakshans_attachment.html', 'text/plain', '<html><body>hello</body></html>')