Created
July 9, 2012 12:26
-
-
Save gorenje/3076191 to your computer and use it in GitHub Desktop.
how to use Zendesk API Gem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'zendesk_api' | |
# retrieve login details from yml file. | |
z = get_login_details(:zendesk) | |
client = ZendeskAPI::Client.new do |config| | |
config.url = "https://#{z.first}.zendesk.com/api/v2" | |
config.username = z[1] | |
config.password = z.last | |
require 'logger' | |
config.logger = Logger.new(STDOUT) | |
end | |
fields = { | |
"21127457" => 12345, | |
"21037343" => "loading_problem", | |
"21362847" => "diamond_dash", | |
} | |
client.tickets.create(:subject => "Test Ticket using API", | |
:description => "This is a test", | |
:submitter_id => client.current_user.id, | |
:priority => "urgent", | |
:fields => fields, | |
:requester => '[email protected]') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment