Request information from ZenDesk and output it in several forms like JSON, Markdown, or TaskPaper. Some of this is simply easier than using curl
; some of it would require more post processing than I want to do.
I pipe the JSON output to jq
often. I use the TaskPaper to send to OmniFocus, and I document tickets with a certain format that corresponds to a Ulysses filter.
Create a file named .zdapi.json in your home folder. Put the API URL, your agent email, and a valid API key in it like this:
{
"url": "https://»site«.zendesk.com/api/v2",
"username": "»agent email«",
"token": "»API token«"
}
Copy over the file zdapi.json.template to /.zdapi.json to get started.
There are 5 commands:
search
— Return JSON results for a generic search, for tickets, users, using tags, etc. It doesn’t seem to work with “id:»id number«” though.user
— Return JSON describing a userorg
— Return JSON describing an organizationticketproject
— Generate a TaskPaper format initial project for the ticketticketnotes
— Generate the Markdown ticket notes headline I use
As far as I know, this just happens occasionally with ZenDesk’s API. Retry with the same arguments and it will probably work.