Project

girlscout

0.01
No release in over 3 years
Low commit activity in last 3 years
Provides integration with HelpScout REST API v2
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 2.14
~> 5.11
~> 0.46
~> 0.11
~> 12.3
~> 0.58
~> 5.0

Runtime

>= 1.8
~> 0.85
 Project Readme

GirlScout

Ruby

BETA GirlScout is half-finished beta-quality software. Until 1.0 is released, use at your own risk!

This is a gem for talking to the HelpScout Mailbox API v2.

Requirements

To use this gem, you will need a valid HelpScout account setup for the API key. This gem has been developed and tested on Ruby 2.5.1.

Installation

Using bundler:

gem 'girlscout'

Or manually via rubygems:

$ gem install girlscout

Usage

Configuration

Before starting out, obtain your HelpScout API Key from the HelpScout dashboard and configure your client_id and client_secret in the application:

require 'girlscout'

GirlScout::Config.client_id = 'your helpscout application id'
GirlScout::Config.client_secret = 'your helpscout application secret here'

Accesses

GirlScout provides AR-style accessor methods for model classes; use them to retrieve data from HelpScout:

Mailbox

mailboxes = GirlScout::Mailbox.list
puts mailboxes.first.name
# => "Support"

mailbox = GirlScout::Mailbox.find(6789)
puts mailbox.name
# => "Support"

Customer

customer = GirlScout::Customer.find(2468)
puts customer.name
# => "Chakrit"

customers = GirlScout::Customer.list
puts customers.first.name
# => "Chakrit"

customers = GirlScout::Customer.list(mailbox_id: 6789)
puts customers.first.name
# => "Chakrit"

User

me = GirlScout::User.me
puts me.first_name
# => "Phureewat"

user = GirlScout::User.find(12345)
puts user.first.first_name
# => "Phureewat"

users = GirlScout::User.list
puts users.first.first_name
# => "Phureewat"

users = GirlScout::User.list(email: 'abc@omise.co')
puts users.first.first_name
# => "Phureewat"

Conversation

conversation = GirlScout::Conversation.find(12345)
puts conversation.id
# => 12345

conversations = GirlScout::Conversation.list
puts conversations.first.id
# => 12345

conversations = GirlScout::Conversation.list(status: :active)
puts conversations.first.id
# => 12345

conversations = GirlScout::Conversation.list(mailbox_id: 6789)
puts conversations.first.id
# => 12345

To create a new conversation, build the models and use the create method on the model class:

mailbox = GirlScout::Mailbox.new(id: 123)
customer = GirlScout::Customer.new(email: "customer@example.com")

thread = GirlScout::Thread.new({
  type: "customer",
  customer: customer,
  text: "You may reply to this email directly for support!"
})

conversation = GirlScout::Conversation.new(
  type: :email,
  subject: "Thanks for registering at Awesome SaaS company XYZ!",
  status: :active,
  mailbox_id: mailbox.id,
  customer: customer,
  threads: [thread]
)

id = GirlScout::Conversation.create(conversation)
conversation = GirlScout::Conversation.find(id)

License

MIT