# Zendesk Tasks


This module contains a collection of tasks to export data from Zendesk.

# ZendeskTicketsIncrementalExportTask

class

prefect.tasks.zendesk.zendesk_tasks.ZendeskTicketsIncrementalExportTask

(subdomain=None, email_address=None, api_token=None, api_token_env_var=None, start_time=None, cursor=None, exclude_deleted=False, include_entities=None, **kwargs)[source]

This task can be used to perform an incremental export of tickets from Zendesk. More info at https://developer.zendesk.com/api-reference/ticketing/ticket-management/incremental_exports/#incremental-ticket-export.

Args:

  • subdomain (str, optional): The Zendesk subdomain to use to export tickets.
  • email_address (str, optional): The email address to use to authenticate on Zendesk.
  • api_token (str, optional): The API token to use to athenticate on Zendesk If passed, it will take precedence over api_token_env_var.
  • api_token_env_var (str, optional): The name of the env var which contains the API token to use to authenticate on Zendesk.
  • start_time (int, datetime, optional): The start time to use to export tickets. Can be passed as an epoch timestamp or a datetime object.
  • cursor (str, optional): The cursor to use to export tickets. If passed, it will take precedence over start_time.
  • exclude_deleted: (bool, optional): Whether to exclude deleted tickets or not. Default to False.
  • include_entities: (str, list, optional): Optional list of entities to side load. More info at https://developer.zendesk.com/documentation/ticketing/using-the-zendesk-api/side_loading/.
  • **kwargs (dict, optional): Additional keyword arguments to pass to the Task constructor.

methods:                                                                                                                                                       

prefect.tasks.zendesk.zendesk_tasks.ZendeskTicketsIncrementalExportTask.run

(subdomain=None, email_address=None, api_token=None, api_token_env_var=None, start_time=None, cursor=None, exclude_deleted=None, include_entities=None)[source]

Task run method to perform an incremental export of tickets from Zendesk. Args:

  • subdomain (str, optional): The Zendesk subdomain to use to export tickets.
  • email_address (str, optional): The email address to use to authenticate on Zendesk.
  • api_token (str, optional): The API token to use to athenticate on Zendesk If passed, it will take precedence over api_token_env_var.
  • api_token_env_var (str, optional): The name of the env var which contains the API token to use to authenticate on Zendesk.
  • start_time (int, datetime, optional): The start time to use to export tickets. Can be passed as an epoch timestamp or a datetime object.
  • cursor (str, optional): The cursor to use to export tickets. If passed, it will take precedence over start_time.
  • exclude_deleted: (bool, optional): Whether to exclude deleted tickets or not. Default to False.
  • include_entities: (str, list, optional): Optional list of entities to side load. More info at https://developer.zendesk.com/documentation/ticketing/using-the-zendesk-api/side_loading/.
Raises:
  • ValueError if both api_token and api_token_env_var are missing. - ValueError if api_token is missing and api_token_env_var cannot be found. - ValueError if subdomain is missing. - ValueError if email_address is missing. - ValueError if both start_time and cursor are missing. - prefect.engine.signals.FAIL if the Zendesk API call fails.


Returns:
  • A dict containing the list of tickets and, optionally, the included entities.



This documentation was auto-generated from commit e6bd04a
on September 7, 2022 at 21:06 UTC