How to load data from Zendesk to Google BigQuery

Blendo Team

How may I load data from Zendesk to Google BigQuery for further analysis? The purpose of this post is to help you define a process or pipeline, for getting your subscription related data from Zendesk and load it into Google BigQuery for further analysis. We will see how to access and extract data from Zendesk through its API and how to load it into Google BigQuery. This process requires from you to write the code to get the data and make sure that this process will run every time new data are generated. Alternatively you can use products like Blendo that can handle this kind of problems automatically for you.

Extract your data from Zendesk

Zendesk APIs are not specific to pulling data, Zendesk provides more than a hundred different APIs for you to integrate with. So you can easily manage your users, enhance your team’s productivity and create seamless integrations. You can create integrations or even enrich Zendesk with data from external sources. Zendesk API is a RESTful API that can be access through HTTP. As a RESTful API, interacting with it an be achieved by using tools like CURL or Postman or by using http clients for your favourite language or framework.

A few suggestions:

Additionally, Zendesk offers a number of SDKs and libraries so you can access the API from your framework of choice without having to deal with the technicalities of HTTP. API clients are available for the following languages:

You will need more time to read this post than integrating Zendesk to BigQuery.

Effortlessly Sync All Your Zendesk Data to BigQuery

Zendesk API Authentication

Zendesk’s API is an SSL-only API, regardless of how your account is configured. You must be a verified user to make API requests. You can authorize against the API using either basic authentication with your email address and password, with your email address and an API token, or with an OAuth access token.

Zendesk rate limiting

The API is rate limited. It only allows a certain number of requests per minute depending on your plan and the endpoint. Zendesk reserves the right to adjust the rate limit for given endpoints to provide a high quality of service for all clients. The current limits are the following:

Plan Requests per minute
Essential 10
Team 200
Professional 400
Enterprise 700
High Volume API Add-On (Professional or Enterprise) 2500

 

Pagination

By default, most list endpoints return a maximum of 100 records per page. You can change the number of records on a per-request basis by passing a per_page parameter in the request URL parameters. Example: per_page=50. However, you can’t exceed 100 records per page on most endpoints.

When the response exceeds the per-page maximum, you can paginate through the records by incrementing the page parameter. Example: page=3. List results include next_page and previous_page URLs in the response body for easier navigation:

{
  "users": [ ... ],
  "count": 1234,
  "next_page": "https://account.zendesk.com/api/v2/users.json?page=2",
  "previous_page": null
}

Endpoints and available resources

The Zendesk REST API exposes a large number of resources and endpoints that allows the user to interact with the platform in every possible way. Thus it is possible to create new applications on top of the Zendesk platform, integrate external systems with it and of course pull data out of the platform. The most important resources are the following:

  • The tickets that your customers create through Zendesk.
  • Ticket events. Changes that have occurred to the tickets.
  • Organizations.
  • Users.
  • Ticket metrics. These are metrics related to your tickets.
  • Data related to the Net Promoter Score.
  • Articles

Let’s assume that we want to pull all the tickets we have on Zendesk. To do that we need to perform a GET request to the appropriate end-point, like this: GET /api/v2/incremental/tickets.json?start_time=1332034771

curl https://{subdomain}.zendesk.com/api/v2/incremental/tickets.json?start_time=1332034771 \
  -v -u {email_address}:{password}

And a sample response:

Status: 200 OK

{
  "end_time": 1383685952,
  "next_page": "https://{subdomain}.zendesk.com/api/v2/incremental/tickets.json?start_time=1383685952",
  "count": 1,
  "tickets": [
    {
      "url": "https://{subdomain}.zendesk.com/api/v2/tickets/1.json",
      "id": 2,
      "created_at": "2012-02-02T04:31:29Z",
      "generated_timestamp": 1390362285
      ...
     },
     ...
  ]
}

A complete ticket object might contain the following fields:

ame Type Read-only Mandatory Comment
id integer yes no Automatically assigned when creating tickets
url string yes no The API url of this ticket
external_id string no no An id you can use to link Zendesk tickets to local records
type string no no The type of this ticket, i.e. “problem”, “incident”, “question” or “task”
subject string no no The value of the subject field for this ticket
raw_subject string no no The dynamic content placeholder, if present, or the “subject” value, if not. See Dynamic Content
description string yes no The first comment on the ticket
priority string no no Priority, defines the urgency with which the ticket should be addressed: “urgent”, “high”, “normal”, “low”
status string no no The state of the ticket, “new”, “open”, “pending”, “hold”, “solved”, “closed”
recipient string no no The original recipient e-mail address of the ticket
requester_id integer no yes The user who requested this ticket
submitter_id integer no no The user who submitted the ticket; The submitter always becomes the author of the first comment on the ticket.
assignee_id integer no no What agent is currently assigned to the ticket
organization_id integer yes no The organization of the requester
group_id integer no no The group this ticket is assigned to
collaborator_ids array no no Who are currently CC’ed on the ticket
forum_topic_id integer no no The topic this ticket originated from, if any
problem_id integer no no The problem this incident is linked to, if any
has_incidents boolean yes no Is true of this ticket has been marked as a problem, false otherwise
due_at date no no If this is a ticket of type “task” it has a due date. Due date format uses ISO 8601 format.
tags array no no The array of tags applied to this ticket
via Via yes no This object explains how the ticket was created
custom_fields array no no The custom fields of the ticket
satisfaction_rating object yes no The satisfaction rating of the ticket, if it exists, or the state of satisfaction, ‘offered’ or ‘unoffered’
sharing_agreement_ids array yes no The ids of the sharing agreements used for this ticket
followup_ids array yes no The ids of the followups created from this ticket – only applicable for closed tickets
ticket_form_id integer no no The id of the ticket form to render for this ticket – only applicable for enterprise accounts
brand_id integer no no The id of the brand this ticket is associated with – only applicable for enterprise accounts
created_at date yes no When this record was created
updated_at date yes no When this record last got updated

The results of the Zendesk API is always in JSON format. The API offers you the opportunity to get very granular data about your accounting activities and use it for analytic and reporting purposes.

About Zendesk

Import your Zendesk data into your data warehouse - Blendo.co

Load data from Zendesk

Zendesk provides a cloud-based customer service platform, that includes ticketing, self-service options, and customer support features. Zendesk focuses on improving the communication between your customers and your company. It brings all your customer communication into one place. The supported communication channels are:

  • Mail. Zendesk helps to organise all the emails you receive from your customers.
  • Social. You can connect your Facebook and Twitter accounts with Zendesk.
  • Voice. Take customer calls from within Zendesk.
  • Chat. Zopim Chat allows you to communicate with your customers from within your product.

Zendesk’s help desk software helps streamline customer support with time-saving tools like triggers and automations. And it’s intuitive, built with the experience of customer service and support desk agents in mind. Some important features of the ticketing system that Zendesk offers, are:

  • It helps to Solve tickets better with teammates through a collaborative environment where information can be shared.
  • Get access to relevant information across teams. Zendesk comes with an internal Knowledge Base that allows agents to quickly refer to information and processes without losing their place.
  • Make everyone inside your company a support agent. With light agents, everyone inside your company can view tickets and make private comments.

Additionally, Zendesk offers a suite of analytics tools that will help you to get closer to your user through data. With these tools you can:

  • Gain visibility into customers interactions
  • Measure your team’s performance
  • See the business impacts of great service

It is possible to track a large number of metrics related to your customers, support teams and your business.

But in case that you would like to run some more engaged analysis with your Zendesk data, or fuse the customer support related data with data from other sources like your transactional database and logs, Zendesk exposes a rich ecosystem of APIs and tools that you can use to access and pull your data among other functionalities.

Prepare your data to be sent from Zendesk to Google BigQuery

Before you load your data into BigQuery, you should make sure that it is presented in a format supported by it, so for example if the API you pull data from returns XML you have to first transform it into a serialisation that BigQuery understands. Currently two data formats are supported:

You also need to make sure that the data types you are using are the ones supported by BigQuery, which are the following:

  • STRING
  • INTEGER
  • FLOAT
  • BOOLEAN
  • RECORD
  • TIMESTAMP

for more information please check the Preparing Data for BigQuery page on the documentation.

About Google BigQuery

 

BigQuery is the data warehousing solution of Google. It’s part of the Google Cloud Platform and it also speaks SQL like Redshift does. Queries are executed against append-only tables using the processing power of Google’s infrastructure. It is also fully managed and is offered as a service over the cloud. You can interact with it through its web UI, using a command line tool while a variety of client libraries exist so you can interact with it through your application.

Load Data from Zendesk to Google BigQuery

If you want to load data from Zendesk to Google BigQuery, you have to use one of the following supported data sources.

  1. Google Cloud Storage
  2. Sent data directly to BigQuery with a POST request
  3. Google Cloud Datastore Backup
  4. Streaming insert
  5. App Engine log files
  6. Cloud Storage logs

From the above list of sources, 5 and 6 are not applicable in our case.

For Google Cloud Storage, you first have to load your data into it, there are a few options on how to do this, for example you can use the console directly as it is described here and do not forget to follow the best practices. Another option is to post your data through the JSON API, as we see again APIs play an important role in both the extraction but also the loading of data into our data warehouse.. In it’s simplest case it’s just a matter of one HTTP POST request using a tool like CURL or Postman. It should look like the following example.

POST /upload/storage/v1/b/myBucket/o?uploadType=media&name=myObject HTTP/1.1
Host: www.googleapis.com
Content-Type: application/text
Content-Length:
number_of_bytes_in_file
Authorization: Bearer
your_auth_token your Zendesk data

and if everything went ok, you should get something like the following as a response from the server:

HTTP/1.1 200
Content-Type: application/json
{
"name": "myObject"
}

Working with Curl or Postman, is good only for testing, if you would like to automate the process of loading your data into Google Bigquery, you should write some code to send your data to Google Cloud Storage. In case you are developing on the Google App Engine you can use the library that is available for the languages that are supported by it:

  1. Python
  2. Java
  3. PHP
  4. Go

If you are using one of the above languages and you are not coding for the Google App Engine, you can use it to access the Cloud Storage from your environment. Interacting such a feature rich product like Google Cloud Storage can become quite complicated depending on your use case, for more details on the different options that exist you can check Google Cloud Storage documentation. If you are looking for a less engaged and more neutral way of using Cloud Storage, you can consider a solution like Blendo.

After you have loaded your data into Google Cloud Storage, you have to create a Load Job for BigQuery to actually load the data into it, this Job should point to the source data in Cloud Storage that have to be imported, this happens by providing source URIs that point to the appropriate objects.

The previous method described, used a POST request to the Google Cloud Storage API for storing the data there and then load it into BigQuery. Another way to go is to do a direct HTTP POST request to BigQuery with the data you would like to query. This approach is similar to how we loaded the data to Google Cloud Storage through the JSON API, but it uses the appropriate end-points of BigQuery to load the data there directly. The way to interact with it is quite similar, for more information can be found on the Google BigQuery API Reference and on the page that describes how to load data into BigQuery using POST. You can interact with it using the HTTP client library of the language or framework of your choice, a few options are:

The best way to load data from Zendesk to Google BigQuery and possible alternatives

So far we just scraped the surface of what can be done with Google BigQuery and how to load data into it. The way to proceed relies heavily on the data you want to load, from which service they are coming from and the requirements of your use case. Things can get even more complicated if you want to integrate data coming from different sources. A possible alternative, instead of writing, hosting and maintaining a flexible data infrastructure, is to use a product like Blendo that can handle this kind of problems automatically for you.

Blendo integrates with multiple sources or services like databases, CRM, email campaigns, analytics and more. Quickly and safely move all your data from Zendesk to Google BigQuery and start generating insights from your data.

Help your customer support and executive team take ownership of the insights that live in your Zendesk customer support platform.

Blendo is the easiest way to automate powerful data integrations.

Try Blendo free for 14 days. No credit card required.