Add this line to your application's Gemfile:
gem 'limdesk_api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install limdesk_api
This gem will allow you to interact with Limdesk API. Limdesk.com is a lightweight, multichannel customer support solution.
API is available to free and premium users. You can generate your APIKEY in Settings/Integration/API section.
This gem wrappes Limdesk API into OpenStruct (RecursiveOpenStruct) objects. For more information about API check the official docs. Current API covers basic, most common actions. More advanced version is currenty under development.
LimdeskApi.configuredo |lim|
lim.key='<YOUR API KEY>'lim.version=1endtickets=LimdeskApi::Ticket.alltickets.count63closed_tickets=LimdeskApi::Ticket.all(:closed)new_tickets=LimdeskApi::Ticket.all(:new)tickets_with_new_messages=LimdeskApi::Ticket.all(:new_messages)open_ticktes=LimdeskApi::Ticket.all(:open)tickets.first.title"Hello World"ticket=LimdeskApi::Ticket.get(44)ticket.title"Hello"ticket.client.name"John Smith"ticket.answercontent: 'this is a private comment',answer_type: :privticket.answercontent: 'dear customer, it is solved',answer_type: :pubticket.closecontent: 'its solved',type: :resolvedticket.reopenticket.closecontent: 'spam',type: :rejectedticket2=LimdeskApi::Ticket.create:title=>"problem",:content=>"clients probem",:reported_by=>:mail,:client_id=> -1# reported_by can be :mail, :phone, :other, :chat# client_id => -1 means "new anonymous clinet"ticket2.title"sample ticket 2"acts=LimdeskApi::Activity.allact=LimdeskApi::Activity.createcontent: "client has logged into website",client_id: 55cls=LimdeskApi::Client.allcls.first.name"John Smith"client=LimdeskApi::Client.createname: "John Smith",nippesel: "15012406496",phone: "223111789",email: "email@example.com",address: "Plain Street 149 85-058 Warsaw"client.delete!trueclient2=LimdeskApi::Client.get(55)client2.contacts.firstclient2.updatename: "John Smith 2",nippesel: "123",phone: "11111",email: "emailnew@example.com",address: "Plain Street 149 85-058 Warsaw"trueclient3=LimdeskApi::Client.get_by_email('adam@example.com')client4=LimdeskApi::Client.get_by_phone('+48897228989')client4=LimdeskApi::Client.get_by_outside_client_id('1234')client5=LimdeskApi::Client.get_by_nippesel('7393792360')sales=LimdeskApi::Sale.allsale=sales.firstsale.name"Hosting service 1yr"sale.delete!truesale2=LimdeskApi::Sale.createclient_id: 65464,name: "Shoes",price: 99.99,amount: 1,sold: "2014-10-20 20:00:00"create_ticket: truesale2.client.name"John Smith"cp=LimdeskApi::Contactperson.createclient_id: 338425,name: "Mr Smith",email: "ms@example.com",phone: "123456789"cp.updateemail: "ms1@example.com"cp.refresh!cp.delete!- tests
- lazy loading
- Fork it ( https://github.com/limtel/limdesk/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request