Skip to content

Instantly share code, notes, and snippets.

@crobrock
crobrock / zdviewcount.py
Created Oct 10, 2020
Return Count of Zendesk Ticket View
View zdviewcount.py
import requests
from base64 import b64encode
ZENDESK_SUBDOMAIN = 'YOUR_SUBDOMAIN'
ZENDESK_VIEW_ID = 'YOUR_ZENDESK_VIEW_ID'
ZENDESK_EMAIL = 'YOUR_ZENDESK_EMAIL'
ZENDESK_API_TOKEN = 'YOUR_ZENDESK_API_TOKEN'
url = f'https://{ZENDESK_SUBDOMAIN}.zendesk.com/api/v2/views/{ZENDESK_VIEW_ID}/count.json'
auth = f'{ZENDESK_EMAIL}/token:{ZENDESK_API_TOKEN}'