Freshdesk Api V2

Freshdesk api v2 is a gem developed to connect freshdesk to your application.

Installation

Add this line to your application's Gemfile:

gem 'freshdesk-api-v2-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install freshdesk-api-v2-rails

Usage

Create a service connection with a desired category:

tickets_conn = Freshdesk::Tickets.new({:apikey => YOUR_FRESHDESK_API_KEY,:domain => YOUR_DOMAIN_PREFIX})

Note: Use only your domain prefix, if your freshdesk domain is test.freshdesk.com the :domain must be test

Use the method you want:

Method Description Return
tickets_conn.all Will get all tickets, the default settings will start on page 1 and per_page 100 Array of ticket objects
tickets_conn.create creates a new ticket Ticket object
tickets_conn.find(id) finds one ticket by id Ticket object
tickets_conn.update(id,options) updates the ticket by id Ticket object
tickets_conn.delete(id) deletes the ticket by id true or false
tickets_conn.delete_all deletes all tickets true or false
tickets.connected? check if connection is valid true or false

The categories available today:

Category Class
Tickets Freshdesk::Tickets
Contacts Freshdesk::Contacts
Groups Freshdesk::Groups
Satisfaction Ratings Freshdesk::Surveys::Satisfaction_Ratings

TODO

  • Add more categories
  • Add specific methods for tickets - and other categories
  • Create really good specs - sorry :(

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/vilelaml/freshdesk-api-v2-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Freshdesk::Api::V2::Rails project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.