Freshdesk Export

A simple tool that will retrieve all of the tickets from your Freshdesk instance and export it into a JSON format.

Table of Contents

<a id="installation"></a>Installation

You can download the package by adding freshdesk_export to your list of dependencies in mix.exs:

def deps do
  [
    {:freshdesk_export, "~> 0.1.0"}
  ]
end

Then add the freshdesk_domain and the freshdesk_api_key to the :freshdesk_export application's environment variables in the deps/freshdesk_export/mix.exs file:

def application do
  [
    applications: [...],
    extra_applications: [...],
    env: [
      freshdesk_domain: "https://yourorganization.freshdesk.com",
      freshdesk_api_key: ""
    ]
  ]
end

This step will get your code hooked up to the proper Freshdesk instance. Check out this short article if you need help finding your Freshdesk API key.

<a id="quick-start-examples"></a>Quick-Start Examples

The default is to pull back 100 tickets per page. This will be a variable in the future but currently is hard coded.

Get a single ticket

FreshdeskExport.get_ticket(ticket_id)

Get a single page of tickets

FreshdeskExport.request_tickets(page_number)

Get all tickets

FreshdeskExport.get_tickets

Return a JSON object

import Poison, only: [encode!: 1]
FreshdeskExport.request_tickets(page_number) |> encode!
import Poison, only: [encode!: 1]
FreshdeskExport.get_tickets |> encode!

Save to a JSON file

FreshdeskExport.get_tickets |> FreshdeskExport.write_json(file_path)

<a id="documentation"></a>Documentation

Check out the HexDocs page for official documentation.