FreshService API Client
Ruby toolkit for the Fresh Service API V2.
Table of Contents
- Installation
- API Documentation
- Making requests
- Initialization
- Ticket
- Group
- Service Request
- License
Installation
Add this line to your application's Gemfile:
gem 'fresh_service_api_v2_client', '~> 1.0.2'
And then execute:
bundle install
Or install it yourself as:
gem install fresh_service_api_v2_client
Access the library in Ruby:
require 'fresh_service_api_v2_client'
API Documentation
Making requests
Initialization
# client initialization
ENV["FRESH_SERVICE_API_KEY"] = ''
ENV["FRESH_SERVICE_ORG"] = ''
client = FreshService::Client.new
OR
client = FreshService::Client.new(organisation: 'abc', api_key: 'api_key')
OR
client = FreshService::Client.configure do |c|
c.organisation = 'abc'
c.api_key = 'api_key'
end
Ticket
# Create a ticket
# @see https://api.freshservice.com/#create_ticket
client.create_ticket(options = {})
# Update a ticket
# @see https://api.freshservice.com/#update_ticket_priority
client.update_ticket(ticket_id, options = {})
# View a ticket
# @see https://api.freshservice.com/#view_a_ticket
client.view_ticket(ticket_id, options = {})
Group
# Create a group
# @see https://api.freshservice.com/#create_a_group
client.create_group(options = {})
# View a group
# @see https://api.freshservice.com/#view_a_group
client.view_group(group_id, options = {})
Service Request
# Create a Service Request
# @see https://api.freshservice.com/#create_service_request
client.create_service_request(display_id, options = {})
# Update a Service Request
# @see https://api.freshservice.com/#update_req_items_of_sr
client.update_service_request(ticket_id, item_id, options = {})
License
MIT