rsalesloft 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.rspec +3 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/Rakefile +1 -0
- data/lib/rsalesloft.rb +11 -0
- data/lib/rsalesloft/config.rb +17 -0
- data/lib/rsalesloft/connection.rb +44 -0
- data/lib/rsalesloft/resources.rb +32 -0
- data/lib/rsalesloft/resources/accounts.rb +31 -0
- data/lib/rsalesloft/resources/actions.rb +19 -0
- data/lib/rsalesloft/resources/activities.rb +9 -0
- data/lib/rsalesloft/resources/cadence_memberships.rb +31 -0
- data/lib/rsalesloft/resources/cadences.rb +19 -0
- data/lib/rsalesloft/resources/call_data_records.rb +19 -0
- data/lib/rsalesloft/resources/call_dispositions.rb +9 -0
- data/lib/rsalesloft/resources/call_instructions.rb +19 -0
- data/lib/rsalesloft/resources/call_sentiments.rb +9 -0
- data/lib/rsalesloft/resources/caller_ids.rb +9 -0
- data/lib/rsalesloft/resources/calls.rb +23 -0
- data/lib/rsalesloft/resources/crm_activities.rb +19 -0
- data/lib/rsalesloft/resources/crm_activity_fields.rb +9 -0
- data/lib/rsalesloft/resources/custom_fields.rb +31 -0
- data/lib/rsalesloft/resources/email_templates.rb +19 -0
- data/lib/rsalesloft/resources/emails.rb +19 -0
- data/lib/rsalesloft/resources/imports.rb +31 -0
- data/lib/rsalesloft/resources/live_website_tracking_parameters.rb +9 -0
- data/lib/rsalesloft/resources/notes.rb +31 -0
- data/lib/rsalesloft/resources/ongoing_actions.rb +9 -0
- data/lib/rsalesloft/resources/people.rb +31 -0
- data/lib/rsalesloft/resources/person_stages.rb +31 -0
- data/lib/rsalesloft/resources/recording_settings.rb +9 -0
- data/lib/rsalesloft/resources/steps.rb +19 -0
- data/lib/rsalesloft/resources/successes.rb +9 -0
- data/lib/rsalesloft/resources/tags.rb +9 -0
- data/lib/rsalesloft/resources/team_templates.rb +19 -0
- data/lib/rsalesloft/resources/teams.rb +9 -0
- data/lib/rsalesloft/resources/users.rb +23 -0
- data/readme.md +44 -0
- data/rsalesloft.gemspec +27 -0
- data/spec/fixtures/tags/list_tags.json +6 -0
- data/spec/fixtures/team_templates/fetch_team_template.json +25 -0
- data/spec/fixtures/team_templates/list_team_templates.json +27 -0
- data/spec/fixtures/teams/fetch_current_team.json +19 -0
- data/spec/fixtures/users/fetch_current_user.json +40 -0
- data/spec/fixtures/users/fetch_user.json +40 -0
- data/spec/fixtures/users/list_users.json +42 -0
- data/spec/lib/rsalesloft/resources/accounts_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/actions_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/activities_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/cadence_memberships_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/cadences_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/call_data_records_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/call_dispositions_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/call_instructions_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/call_sentiments_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/caller_ids_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/calls_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/crm_activities_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/crm_activity_fields_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/custom_fields_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/email_templates_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/emails_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/imports_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/live_website_tracking_parameters_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/me_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/notes_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/ongoing_actions_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/people_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/person_stages_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/recording_settings_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/steps_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/successes_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/tags_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/team_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/team_templates_spec.rb +0 -0
- data/spec/lib/rsalesloft/resources/users_spec.rb +0 -0
- data/spec/lib/rsalesloft_spec.rb +2 -0
- data/spec/spec_helper.rb +12 -0
- metadata +286 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
module RSalesloft::Resources
|
2
|
+
class EmailTemplates
|
3
|
+
class << self
|
4
|
+
def list(query = {})
|
5
|
+
RSalesloft::Connection.get(email_templates_path, query)
|
6
|
+
end
|
7
|
+
|
8
|
+
def fetch(id)
|
9
|
+
RSalesloft::Connection.get(email_templates_path(id))
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def email_templates_path(id = nil)
|
15
|
+
id ? "email_templates/#{id}/" : "email_templates/"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module RSalesloft::Resources
|
2
|
+
class Emails
|
3
|
+
class << self
|
4
|
+
def list(query = {})
|
5
|
+
RSalesloft::Connection.get(emails_path, query)
|
6
|
+
end
|
7
|
+
|
8
|
+
def fetch(id)
|
9
|
+
RSalesloft::Connection.get(emails_path(id))
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def emails_path(id = nil)
|
15
|
+
id ? "activities/emails/#{id}/" : "activities/emails/"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module RSalesloft::Resources
|
2
|
+
class Imports
|
3
|
+
class << self
|
4
|
+
def list(query = {})
|
5
|
+
RSalesloft::Connection.get(imports_path, query)
|
6
|
+
end
|
7
|
+
|
8
|
+
def create(options)
|
9
|
+
RSalesloft::Connection.post(imports_path, options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def delete(id)
|
13
|
+
RSalesloft::Connection.delete(imports_path(id))
|
14
|
+
end
|
15
|
+
|
16
|
+
def fetch(id)
|
17
|
+
RSalesloft::Connection.get(imports_path(id))
|
18
|
+
end
|
19
|
+
|
20
|
+
def update(id, options = {})
|
21
|
+
RSalesloft::Connection.put(imports_path(id), options)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def imports_path(id = nil)
|
27
|
+
id ? "imports/#{id}" : "imports/"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module RSalesloft::Resources
|
2
|
+
class Notes
|
3
|
+
class << self
|
4
|
+
def list(query = {})
|
5
|
+
RSalesloft::Connection.get(notes_path, query)
|
6
|
+
end
|
7
|
+
|
8
|
+
def create(options)
|
9
|
+
RSalesloft::Connection.post(notes_path, options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def delete(id)
|
13
|
+
RSalesloft::Connection.delete(notes_path(id))
|
14
|
+
end
|
15
|
+
|
16
|
+
def fetch(id)
|
17
|
+
RSalesloft::Connection.get(notes_path(id))
|
18
|
+
end
|
19
|
+
|
20
|
+
def update(id, options = {})
|
21
|
+
RSalesloft::Connection.put(notes_path(id), options)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def notes_path(id = nil)
|
27
|
+
id ? "notes/#{id}/" : "notes/"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module RSalesloft::Resources
|
2
|
+
class People
|
3
|
+
class << self
|
4
|
+
def list(query = {})
|
5
|
+
RSalesloft::Connection.get(people_path, query)
|
6
|
+
end
|
7
|
+
|
8
|
+
def create(options)
|
9
|
+
RSalesloft::Connection.post(people_path, options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def delete(id)
|
13
|
+
RSalesloft::Connection.delete(people_path(id))
|
14
|
+
end
|
15
|
+
|
16
|
+
def fetch(id)
|
17
|
+
RSalesloft::Connection.get(people_path(id))
|
18
|
+
end
|
19
|
+
|
20
|
+
def update(id, options = {})
|
21
|
+
RSalesloft::Connection.put(people_path(id), options)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def people_path(id = nil)
|
27
|
+
id ? "people/#{id}" : "people/"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module RSalesloft::Resources
|
2
|
+
class PersonStages
|
3
|
+
class << self
|
4
|
+
def list(query = {})
|
5
|
+
RSalesloft::Connection.get(person_stages_path, query)
|
6
|
+
end
|
7
|
+
|
8
|
+
def create(options)
|
9
|
+
RSalesloft::Connection.post(person_stages_path, options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def delete(id)
|
13
|
+
RSalesloft::Connection.delete(person_stages_path(id))
|
14
|
+
end
|
15
|
+
|
16
|
+
def fetch(id)
|
17
|
+
RSalesloft::Connection.get(person_stages_path(id))
|
18
|
+
end
|
19
|
+
|
20
|
+
def update(id, options = {})
|
21
|
+
RSalesloft::Connection.put(person_stages_path(id), options)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def person_stages_path(id = nil)
|
27
|
+
id ? "person_stages/#{id}/" : "person_stages/"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module RSalesloft::Resources
|
2
|
+
class Steps
|
3
|
+
class << self
|
4
|
+
def list(query = {})
|
5
|
+
RSalesloft::Connection.get(steps_path, query)
|
6
|
+
end
|
7
|
+
|
8
|
+
def fetch(id)
|
9
|
+
RSalesloft::Connection.get(steps_path(id))
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def steps_path(id = nil)
|
15
|
+
id ? "steps/#{id}/" : "steps/"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module RSalesloft::Resources
|
2
|
+
class TeamTemplates
|
3
|
+
class << self
|
4
|
+
def list(query = {})
|
5
|
+
RSalesloft::Connection.get(team_templates_path, query)
|
6
|
+
end
|
7
|
+
|
8
|
+
def fetch(id)
|
9
|
+
RSalesloft::Connection.get(team_templates_path(id))
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def team_templates_path(id = nil)
|
15
|
+
id ? "team_templates/#{id}/" : "team_templates/"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module RSalesloft::Resources
|
2
|
+
class Users
|
3
|
+
class << self
|
4
|
+
def list(query = {})
|
5
|
+
RSalesloft::Connection.get(users_path, query)
|
6
|
+
end
|
7
|
+
|
8
|
+
def fetch(id = nil)
|
9
|
+
if id.present?
|
10
|
+
RSalesloft::Connection.get(users_path(id))
|
11
|
+
else
|
12
|
+
RSalesloft::Connection.get("me/")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def users_path(id = nil)
|
19
|
+
id ? "users/#{id}/" : "users/"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/readme.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# RSalesloft
|
2
|
+
|
3
|
+
This is a ruby wrapper for the [Salesloft Api](https://developers.salesloft.com).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'rsalesloft'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install rsalesloft
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'rsalesloft'
|
23
|
+
|
24
|
+
RSalesloft.configure(api_key: "YOUR_API_KEY")
|
25
|
+
|
26
|
+
# List accounts example
|
27
|
+
accounts = RSpotify::Resources::Accounts::list(page: 1, per_page: 100)
|
28
|
+
|
29
|
+
# Fetch an account example
|
30
|
+
account = RSpotify::Resources::Account::fetch("accound_id")
|
31
|
+
```
|
32
|
+
|
33
|
+
### Contributing
|
34
|
+
|
35
|
+
Everyone is encouraged to help improve this project. Here are a few ways you can help:
|
36
|
+
|
37
|
+
- [Report bugs](https://github.com/aureeaubert/rsalesloft/issues)
|
38
|
+
- Fix bugs and [submit pull requests](https://github.com/aureeaubert/rsalesloft/pulls)
|
39
|
+
- Write, clarify, or fix documentation
|
40
|
+
- Suggest or add new features
|
41
|
+
|
42
|
+
## Copyright
|
43
|
+
|
44
|
+
Copyright (c) 2018 Auree Aubert. See LICENSE for details.
|
data/rsalesloft.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'rsalesloft'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "rsalesloft"
|
7
|
+
s.version = RSalesloft::VERSION
|
8
|
+
s.authors = ["Auree Aubert"]
|
9
|
+
s.email = "contact@auree.me"
|
10
|
+
s.homepage = 'https://github.com/aureeaubert/rsalesloft'
|
11
|
+
s.summary = 'A Ruby wrapper for the Salesloft API'
|
12
|
+
s.description = 'A Ruby wrapper for the Salesloft API '
|
13
|
+
s.files = `git ls-files -z`.split("\x0")
|
14
|
+
s.test_files = s.files.grep(/^spec\//)
|
15
|
+
s.require_paths = ['lib']
|
16
|
+
|
17
|
+
s.add_runtime_dependency("faraday")
|
18
|
+
s.add_runtime_dependency("faraday_middleware")
|
19
|
+
s.add_runtime_dependency("json")
|
20
|
+
|
21
|
+
s.add_development_dependency("bundler")
|
22
|
+
s.add_development_dependency("webmock")
|
23
|
+
s.add_development_dependency("rake")
|
24
|
+
s.add_development_dependency("rspec")
|
25
|
+
s.add_development_dependency("yard")
|
26
|
+
s.add_development_dependency("vcr", "~> 3.0")
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"id": "51226150-3108-4dea-883b-0c0d7388f456",
|
3
|
+
"title": "VP Breakup Email",
|
4
|
+
"subject": "It’s time to say goodbye",
|
5
|
+
"body": "<div>Do you know about birds?</div><div>You can find them here: <a href=\"https://www.allaboutbirds.org/guide/search/\" target=\"_blank\">https://www.allaboutbirds.org/guide/search/</a></div>",
|
6
|
+
"body_preview": "hello\n\nhey sounds good\n\nok\n\nok\n\nwith an edit\n\nok now i'm comic sans 14",
|
7
|
+
"created_at": "2018-01-01T00:00:00.000000-05:00",
|
8
|
+
"updated_at": "2018-01-01T00:00:00.000000-05:00",
|
9
|
+
"last_used_at": "2018-08-09T09:54:05.160655-04:00",
|
10
|
+
"archived_at": "2018-08-09T09:54:05.160752-04:00",
|
11
|
+
"last_modified_at": "2018-01-01T00:00:00.000000-05:00",
|
12
|
+
"open_tracking_enabled": true,
|
13
|
+
"click_tracking_enabled": true,
|
14
|
+
"counts": {
|
15
|
+
"sent_emails": 59,
|
16
|
+
"views": 3,
|
17
|
+
"clicks": 20,
|
18
|
+
"replies": 1,
|
19
|
+
"bounces": 10
|
20
|
+
},
|
21
|
+
"last_modified_user": {
|
22
|
+
"id": 1,
|
23
|
+
"_href": "https://api.salesloft.com/v2/users/1"
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"id": "51226150-3108-4dea-883b-0c0d7388f456",
|
4
|
+
"title": "VP Breakup Email",
|
5
|
+
"subject": "It’s time to say goodbye",
|
6
|
+
"body": "<div>Do you know about birds?</div><div>You can find them here: <a href=\"https://www.allaboutbirds.org/guide/search/\" target=\"_blank\">https://www.allaboutbirds.org/guide/search/</a></div>",
|
7
|
+
"body_preview": "hello\n\nhey sounds good\n\nok\n\nok\n\nwith an edit\n\nok now i'm comic sans 14",
|
8
|
+
"created_at": "2018-01-01T00:00:00.000000-05:00",
|
9
|
+
"updated_at": "2018-01-01T00:00:00.000000-05:00",
|
10
|
+
"last_used_at": "2018-08-09T09:54:05.160655-04:00",
|
11
|
+
"archived_at": "2018-08-09T09:54:05.160752-04:00",
|
12
|
+
"last_modified_at": "2018-01-01T00:00:00.000000-05:00",
|
13
|
+
"open_tracking_enabled": true,
|
14
|
+
"click_tracking_enabled": true,
|
15
|
+
"counts": {
|
16
|
+
"sent_emails": 59,
|
17
|
+
"views": 3,
|
18
|
+
"clicks": 20,
|
19
|
+
"replies": 1,
|
20
|
+
"bounces": 10
|
21
|
+
},
|
22
|
+
"last_modified_user": {
|
23
|
+
"id": 1,
|
24
|
+
"_href": "https://api.salesloft.com/v2/users/1"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
]
|