Class: GrooveHQ::Client

Inherits:
Object
  • Object
show all
Includes:
Agents, Attachments, Connection, Customers, Folders, Groups, Mailboxes, Messages, Tickets, Webhooks, HTTParty
Defined in:
lib/groovehq/client.rb,
lib/groovehq/client/agents.rb,
lib/groovehq/client/groups.rb,
lib/groovehq/client/folders.rb,
lib/groovehq/client/tickets.rb,
lib/groovehq/client/messages.rb,
lib/groovehq/client/webhooks.rb,
lib/groovehq/client/customers.rb,
lib/groovehq/client/mailboxes.rb,
lib/groovehq/client/connection.rb,
lib/groovehq/client/attachments.rb

Defined Under Namespace

Modules: Agents, Attachments, Connection, Customers, Folders, Groups, Mailboxes, Messages, Tickets, Webhooks

Instance Method Summary collapse

Methods included from Webhooks

#create_webhook, #delete_webhook

Methods included from Tickets

#create_ticket, #ticket, #ticket_assignee, #ticket_state, #tickets, #tickets_count, #update_ticket_assigned_group, #update_ticket_assignee, #update_ticket_priority, #update_ticket_state

Methods included from Messages

#create_message, #message, #messages

Methods included from Attachments

#attachments

Methods included from Mailboxes

#mailboxes

Methods included from Groups

#groups

Methods included from Folders

#folders

Methods included from Customers

#customer, #customers, #update_customer

Methods included from Agents

#agent, #agents

Methods included from Connection

#delete, #get, #post, #put

Constructor Details

#initialize(access_token = nil) ⇒ Client

Returns a new instance of Client.



30
31
32
33
# File 'lib/groovehq/client.rb', line 30

def initialize(access_token = nil)
  access_token ||= ENV["GROOVEHQ_ACCESS_TOKEN"]
  self.class.default_options.merge!(headers: { 'Authorization' => "Bearer #{access_token}" })
end