Skip to content

Zendesk target

Sends events to Zendesk, to either create tickets or tag existing tickets.

With tmctl:

tmctl create target zendesk --subdomain <subdomain> --email <email>

On Kubernetes:

Secret

apiVersion: v1
kind: Secret
metadata:
  name: zendesk
type: Opaque
stringData:
   token: <Zendesk token>

Target

apiVersion: targets.triggermesh.io/v1alpha1
kind: ZendeskTarget
metadata:
  name: triggermesh-zendesk
spec:
  #subject provides a default Subject for new Zendesk tickets. Optional
  subject: '' #Example: tmTickets0
  subdomain: '' #Example: tmdev1
  email: '' #Example: jeff@triggermesh.com
  token:
     secretKeyRef:
       name: zendesktargetsecret
       key: token
  • Default Ticket Subject: An optional ticket subject fallback if one is not provided in an incoming event.
  • Zendesk Subdomain: Name of the Zendesk Subdomain, without the zendesk.com domain or https:// scheme.
  • Zendesk Email: Email address associated with the Zendesk account.
  • Zendesk API Token: Contains a token to communicate with the Zendesk API, as discussed in the prerequisites.

A Zendesk Target will ONLY accept CloudEvents with a "Ce-Type" of either com.zendesk.ticket.create OR com.zendesk.tag.create

  • Event's of type com.zendesk.ticket.create Expect both a subject and body to be preset.

  • Example of type : com.zendesk.ticket.create

    curl -v https://zendesktarget-triggermesh-zendesk.jnlasersolutions.dev.munu.io  \
    -H "Content-Type: application/json" \
    -H "Ce-Specversion: 1.0" \
    -H "Ce-Type: com.zendesk.ticket.create" \
    -H "Ce-Source: some.origin/intance" \
    -H "Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f79" \
    -d '{"subject": "Hello", "body" : "World"}'
    

    An example response from the Zendesk Target after consuming an event of this type:

    {
     "id":165,
     "url":"https://triggermesh.zendesk.com/api/v2/tickets/165.json",
     "subject":"Hello",
     "raw_subject":"Hello",
     "description":"World",
     "status":"open",
     "requester_id":412584624334,
     "submitter_id":412584624334,
     "assignee_id":412584624334,
     "group_id":360010761434,
     "due_at":"0001-01-01T00:00:00Z",
     "via":
       {
         "channel":"api",
         "source":{"from":{},"to":{},"rel":""},
         "satisfaction_rating":{"id":0,"score":"","comment":""},
         "brand_id":360004879834,
         "allow_attachments":true,
         "is_public":true,
         "created_at":"2020-08-05T20:00:11Z",
         "updated_at":"2020-08-05T20:00:11Z",
         "collaborators":{},
         "comment":{"created_at":"0001-01-01T00:00:00Z"}
       }
    }
    
  • Event's of type com.zendesk.tag.create Expect both a id and tag to be preset.

  • Example of type : com.zendesk.tag.create
    curl -v https://zendesktarget-triggermesh-zendesk.jnlasersolutions.dev.munu.io  \
    -H "Content-Type: application/json" \
    -H "Ce-Specversion: 1.0" \
    -H "Ce-Type: com.zendesk.tag.create" \
    -H "Ce-Source: some.origin/intance" \
    -H "Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f79" \
    -d '{"id":81 , "tag":"triggermesh"}'
    

See the Kubernetes object reference for more details.

Prerequisite(s)

  • Zendesk API token

You can find the steps to obtain an API token in the Zendesk API Docs.

For more information about using Zendesk, please refer to the Zendesk documentation.