using freshdesk api for ruby on rails
i contacted freshdesk customer support and they sent me a link to this github
https://github.com/johnpaulh/mysamples
all i want to do is be able to create a ticket from my companies site via
a form and have it be viewable from my freshdesk dashboard.
so according to the github docs there is this piece of code
require "rubygems"
require "rest_client"
require "json"
site =
RestClient::Resource.new("http://yourcompany.domain.com/helpdesk/tickets.json","sample@freshdesk.com","test")
response = site.post({:helpdesk_ticket=>{:description=>"Test ticket
creation with attachments",:subject=>"new ticket
sample",:email=>"test@abc.com",:custom_field=>{:license_1=>"ABCDEF"}},:cc_emails=>"myemail@gmail.com,test@gmail.com"},:content_type=>"application/json")
puts "response: #{response.code} \n #{response.body}"
however i am still new to rails and need help understanding how to use
this code in my application
where do i put this code?
how do i call it from my form?
how can i use basic access authentication with rails?
If anyone can answer these questions foe me i would be very greatful......
again i know a little bit about ruby on rails but not a whole bunch so if
you can be specific as possible that would be extermley helpful
No comments:
Post a Comment