Zendesk

class zendesk.Zendesk(subdomain, username=None, password=None, access_token=None)

Create a Zendesk service.

Variables:
  • subdomain (str) – The account-specific part of the Zendesk domain, for instance use mycompany if your Zendesk domain is mycompany.zendesk.com.
  • username (str) – The email of the authenticated agent. Use user@company.com/token for token-based authentication.
  • password (str) – The password of the authenticated agent, or an API token if using token-based authentication.
  • access_token (str) – An OAuth Access token. Username and password are not required if the OAuth Access token is provided.

Activities

Zendesk.activities()

Return the resource corresponding to all activities.

Activities.get(since=None, page=None, per_page=None)

Fetch the list of activities

Variables:since (str) – Timestamp offset in UTC on ISO8601 form %Y-%m-%dT%H:%M:%SZ

Activity

Zendesk.activity(activity_id)

Return the resource corresponding to a single activity.

Activity.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.

Exports

Zendesk.exports()

Return the resource corresponding to exports.

Exports.sample(start_time)

This end point is only to be used for testing the incremental export format. It is more relaxed in terms of rate limiting, but will only return up to 50 records.

Variables:start_time (int) – The time of the oldest ticket you are interested in. Tickets modified on or since this time will be returned. The start time is provided as the number of seconds since epoch UTC.
Exports.tickets(start_time)

Retrieve tickets that changed in Zendesk “since last you asked”

Variables:start_time (int) – The time of the oldest ticket you are interested in. Tickets modified on or since this time will be returned. The start time is provided as the number of seconds since epoch UTC.

Group

Zendesk.group(group_id)

Return the resource corresponding to a single group.

Group.delete()

Delete this resource.

Group.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.
Group.update(obj)

Update this resource.

Variables:obj – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Groups

Zendesk.groups()

Return the resource corresponding to all groups.

Groups.assignable(page=None, per_page=None)

Fetch assignable groups.

Groups.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Groups.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.

SatisfactionRating

Zendesk.satisfaction_rating(rating_id)

Return the resource corresponding to a single satisfaction rating.

SatisfactionRating.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.

SatisfactionRatings

Zendesk.satisfaction_ratings()

Return the resource corresponding to all satisfaction ratings.

SatisfactionRatings.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.
SatisfactionRatings.received(page=None, per_page=None, sort_order=None)

Fetch ratings provided by customers.

Tags

Zendesk.tags()

Return the resource corresponding to tags.

Tags.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.

Ticket

Zendesk.ticket(ticket_id)

Return the resource corresponding to a single ticket.

Tags

Ticket.tags()

Return the resource corresponding to tags.

Tags.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.
Ticket.audits(page=None, per_page=None)

Fetch the audits on a ticket.

Ticket.collaborators(page=None, per_page=None)

Fetch the collaborators on a ticket.

Ticket.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Ticket.delete()

Delete this resource.

Ticket.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.
Ticket.metrics()

Fetch the ticket metrics.

Ticket.update(obj)

Update this resource.

Variables:obj – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Tickets

Zendesk.tickets()

Return the resource corresponding to all the tickets.

Tickets.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Tickets.delete()

Delete this resource.

Tickets.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.
Tickets.recent(page=None, per_page=None)

Fetch all recent tickets. The parameters are the same as for the get method.

Tickets.update(obj)

Update this resource.

Variables:obj – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

User, CurrentUser

Zendesk.user(user_id=None)

Return the resource corresponding to a single user. If user_id is None the returned resource is the currently authenticated user, otherwise it is the user with the given ID number.

User.delete()

Delete this resource.

User.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.
User.tickets_ccd(page=None, per_page=None)

Fetch tickets where this user is CC’d.

User.tickets_requested(page=None, per_page=None)

Fetch tickets requested by this user.

User.update(obj)

Update this resource.

Variables:obj – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.
CurrentUser.get()

Users

Zendesk.users()

Return the resource corresponding to all users.

Users.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Users.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.
Users.search(query, page=None, per_page=None)

Fetch users based on their usernames or email addresses.

Variables:query (str) – A username or an email address.

View

Zendesk.view(view_id)

Return the resource corresponding to a single view.

View.count()

Returns the ticket count for a single view.

View.execute(sort_by=None, sort_order=None)

Get the view output. View output sorting can be controlled by passing the sort_by and sort_order parameters.

Variables:
  • sort_by (str) – The field used for sorting. This will either be a title or a custom field id.
  • sort_order (str) – The direction the tickets are sorted. May be one of ‘asc’ or ‘desc’
View.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.
View.tickets(page=None, per_page=None)

Returns the ticket for a single view.

Views

Zendesk.views()

Return the resource corresponding to all views.

Views.active(page=None, per_page=None)

Fetch active shared and personal Views available to the current user.

Views.count_many(ids)

Calculates the size of the view in terms of number of tickets the view will return. Only returns values for personal and shared views accessible to the user performing the request.

Variables:ids (tuple of int) – List of view ids
Views.get(page=None, per_page=None)

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Variables:
  • page (int) – For collections, where should paging start. If left as None, the first page is returned.
  • per_page (int) – For collections, how many objects sould be returned. The maximum is 100. If left as None, 100 objects are returned.
Views.preview(conditions, columns=None, group_by=None, group_order=None, sort_by=None, sort_order=None)

Views can be previewed by constructing the conditions in the proper format. See http://developer.zendesk.com/documentation/rest_api/views.html#previewing-views.

Variables:
  • conditions (dict) – A representation of the conditions that constitute the view. See http://developer.zendesk.com/documentation/rest_api/views.html#conditions.
  • columns (tuple of int or str) – The ticket fields to display. System fields are looked up by name, custom fields by title or id.
  • group_by (str) – When present, the field by which the tickets are grouped
  • group_order (str) – The direction the tickets are grouped. May be one of ‘asc’ or ‘desc’
  • sort_by (str) – The field used for sorting. This will either be a title or a custom field id.
  • sort_order (str) – The direction the tickets are sorted. May be one of ‘asc’ or ‘desc’
Views.preview_count(conditions)

Views can be previewed by constructing the conditions in the proper format. See http://developer.zendesk.com/documentation/rest_api/views.html#previewing-views.

Variables:
  • conditions (dict) – A representation of the conditions that constitute the view. See http://developer.zendesk.com/documentation/rest_api/views.html#conditions.
  • columns (tuple of int or str) – The ticket fields to display. System fields are looked up by name, custom fields by title or id.
  • group_by (str) – When present, the field by which the tickets are grouped
  • group_order (str) – The direction the tickets are grouped. May be one of ‘asc’ or ‘desc’
  • sort_by (str) – The field used for sorting. This will either be a title or a custom field id.
  • sort_order (str) – The direction the tickets are sorted. May be one of ‘asc’ or ‘desc’

Service methods

Zendesk.search(query, sort_order=None, sort_by=None, page=None, per_page=None)

Fetch the results of a search on your Zendesk account. For details on searching, see http://developer.zendesk.com/documentation/rest_api/search.html

Variables:
  • query (str) – A free-form search term.
  • sort_order – Optional order in which to sort the results.
  • sort_by (str) – Optional term by which to sort the results.