Resources

Medium One Documentation

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:
    • url: string url to Zendesk account.
    • username: string Zendesk account email.
    • token: string 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_id: int 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:
    • keyword: string 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:
    • subject: string The subject of the ticket.
    • comment: string Required. A comment object that describes the problem, incident, question, or task.
    • requesterID: string 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_id: int The number automatically assigned to a ticket when created.
    • comment: string 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>')

Getting Started
User Roles & Permissions
Streams, Tags, & Data Types
Dashboard Widgets
API
Workflow Studio
Workflow Libraries
Metering
Special Characters
Third Party Integration
Mobile
API Explorer

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:
    • url: string url to Zendesk account.
    • username: string Zendesk account email.
    • token: string 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_id: int 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:
    • keyword: string 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:
    • subject: string The subject of the ticket.
    • comment: string Required. A comment object that describes the problem, incident, question, or task.
    • requesterID: string 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_id: int The number automatically assigned to a ticket when created.
    • comment: string 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>')