Skip to content

Create tickets using Zendesk API through a ready to use moutable controller

License

Notifications You must be signed in to change notification settings

catarse/zendesk_engine

Repository files navigation

ZendeskEngine Codeship Status for catarse/zendesk_engine Code Climate

Install and configure

Just add to your Gemfile:

gem 'zendesk_engine'

And create an initializer in config/initializers/zendesk_engine.rb with your Zendesk credentials:

ZendeskEngine.configure do |config|
  config.url   = 'https://foocompany.zendesk.com/api/v2'
  config.user  = '[email protected]'
  config.token = 'my zendesk token found in API config'
end

Mount the routes

Add to your config/routes.rb:

MyApplication::Application.routes.draw do
  mount ZendeskEngine::Engine => "/"
end

This will add the /tickets resources route to the path you've chosen as mouting point ("/" in the example above).

Make requests

After this you can post tickets to /tickets and they will be relayed to the Zendesk API via the zendesk_api gem ;) The parameters to ticket creation should be:

{
  user: {
    email: '[email protected]',
    name: 'Foo Bar'
  },
  ticket: {
    subject: 'Awesome ticket',
    comment: {value: 'This is a ticket just to show a cool example'},
    priority: 'urgent'
  }
}

The response will be a json with the created ticket.

This project rocks and uses MIT-LICENSE.

About

Create tickets using Zendesk API through a ready to use moutable controller

Resources

License

Stars

Watchers

Forks

Packages

No packages published