tomba 1.0.0 → 1.1.0
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 +4 -4
- data/lib/tomba/client.rb +127 -113
- data/lib/tomba/exception.rb +20 -11
- data/lib/tomba/service.rb +15 -11
- data/lib/tomba/services/account.rb +24 -16
- data/lib/tomba/services/bulk.rb +235 -0
- data/lib/tomba/services/count.rb +30 -26
- data/lib/tomba/services/domain.rb +41 -35
- data/lib/tomba/services/enrichment.rb +72 -0
- data/lib/tomba/services/finder.rb +97 -28
- data/lib/tomba/services/flag.rb +53 -0
- data/lib/tomba/services/format.rb +30 -0
- data/lib/tomba/services/keys.rb +99 -58
- data/lib/tomba/services/leads-attributes.rb +83 -58
- data/lib/tomba/services/leads-lists.rb +83 -58
- data/lib/tomba/services/leads.rb +108 -0
- data/lib/tomba/services/location.rb +30 -0
- data/lib/tomba/services/logs.rb +28 -16
- data/lib/tomba/services/phone.rb +53 -0
- data/lib/tomba/services/reveal.rb +28 -0
- data/lib/tomba/services/similar.rb +30 -0
- data/lib/tomba/services/sources.rb +27 -20
- data/lib/tomba/services/status.rb +51 -44
- data/lib/tomba/services/technology.rb +30 -0
- data/lib/tomba/services/usage.rb +24 -16
- data/lib/tomba/services/verifier.rb +29 -20
- data/lib/tomba/version.rb +2 -1
- data/lib/tomba.rb +17 -0
- metadata +18 -7
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
class Domain < Service
|
|
3
|
-
|
|
4
|
-
def domain_search(domain:, page: nil, limit: nil, department: nil)
|
|
5
|
-
if domain.nil?
|
|
6
|
-
raise Tomba::Exception.new('Missing required parameter: "domain"')
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
path = '/domain-search/{domain}'
|
|
10
|
-
.gsub('{domain}', domain)
|
|
11
|
-
|
|
12
|
-
params = {}
|
|
13
|
-
|
|
14
|
-
if !page.nil?
|
|
15
|
-
params[:page] = page
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
if !limit.nil?
|
|
19
|
-
params[:limit] = limit
|
|
20
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
21
2
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
3
|
+
module Tomba
|
|
4
|
+
# Domain Search service.
|
|
5
|
+
#
|
|
6
|
+
# Search emails associated with a domain.
|
|
7
|
+
#
|
|
8
|
+
# @see https://docs.tomba.io/api/finder#domain-search
|
|
9
|
+
class Domain < Service
|
|
10
|
+
# Domain Search
|
|
11
|
+
#
|
|
12
|
+
# Returns all email addresses found for a given domain.
|
|
13
|
+
#
|
|
14
|
+
# @see https://docs.tomba.io/api/finder#domain-search#domain-search
|
|
15
|
+
# @param domain [String] the domain name to search
|
|
16
|
+
# @param page [Integer, nil] the page number for pagination
|
|
17
|
+
# @param limit [Integer, nil] the number of results per page
|
|
18
|
+
# @param department [String, nil] filter by department
|
|
19
|
+
# @param enrich_mobile [Boolean, nil] whether to enrich mobile phone data
|
|
20
|
+
# @param webhook_url [String, nil] webhook URL for async notifications
|
|
21
|
+
# @return [Hash] API response containing the list of emails
|
|
22
|
+
# @raise [Tomba::Exception]
|
|
23
|
+
def domain_search(domain:, page: nil, limit: nil, department: nil, enrich_mobile: nil, webhook_url: nil)
|
|
24
|
+
raise Tomba::Exception, 'Missing required parameter: "domain"' if domain.nil?
|
|
25
|
+
|
|
26
|
+
path = '/domain-search/'
|
|
27
|
+
|
|
28
|
+
params = {}
|
|
29
|
+
|
|
30
|
+
params[:domain] = domain unless domain.nil?
|
|
31
|
+
params[:page] = page unless page.nil?
|
|
32
|
+
params[:limit] = limit unless limit.nil?
|
|
33
|
+
params[:department] = department unless department.nil?
|
|
34
|
+
params[:enrich_mobile] = enrich_mobile unless enrich_mobile.nil?
|
|
35
|
+
params[:webhook_url] = webhook_url unless webhook_url.nil?
|
|
36
|
+
|
|
37
|
+
@client.call('get', path, {
|
|
38
|
+
'content-type' => 'application/json'
|
|
39
|
+
}, params)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Tomba
|
|
4
|
+
# Enrichment service for data enrichment.
|
|
5
|
+
#
|
|
6
|
+
# Provides methods to enrich person and company data.
|
|
7
|
+
#
|
|
8
|
+
# @see https://docs.tomba.io/api/enrichment
|
|
9
|
+
class Enrichment < Service
|
|
10
|
+
# Person Enrichment
|
|
11
|
+
#
|
|
12
|
+
# Enriches data about a person using their email address.
|
|
13
|
+
#
|
|
14
|
+
# @see https://docs.tomba.io/api/enrichment#person-enrichment
|
|
15
|
+
# @param email [String] the email address of the person
|
|
16
|
+
# @param webhook_url [String, nil] webhook URL for async notifications
|
|
17
|
+
# @return [Hash] API response containing enriched person data
|
|
18
|
+
# @raise [Tomba::Exception]
|
|
19
|
+
def person(email, webhook_url: nil)
|
|
20
|
+
raise Tomba::Exception, 'Missing required parameter: "email"' if email.nil?
|
|
21
|
+
|
|
22
|
+
path = '/enrichment/person'
|
|
23
|
+
|
|
24
|
+
params = { email: email }
|
|
25
|
+
params[:webhook_url] = webhook_url unless webhook_url.nil?
|
|
26
|
+
|
|
27
|
+
@client.call('get', path, {
|
|
28
|
+
'content-type' => 'application/json'
|
|
29
|
+
}, params)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Company Enrichment
|
|
33
|
+
#
|
|
34
|
+
# Enriches data about a company using its domain name.
|
|
35
|
+
#
|
|
36
|
+
# @see https://docs.tomba.io/api/enrichment#company-enrichment
|
|
37
|
+
# @param domain [String] the domain name of the company
|
|
38
|
+
# @return [Hash] API response containing enriched company data
|
|
39
|
+
# @raise [Tomba::Exception]
|
|
40
|
+
def company(domain)
|
|
41
|
+
raise Tomba::Exception, 'Missing required parameter: "domain"' if domain.nil?
|
|
42
|
+
|
|
43
|
+
path = '/enrichment/company'
|
|
44
|
+
|
|
45
|
+
params = { domain: domain }
|
|
46
|
+
|
|
47
|
+
@client.call('get', path, {
|
|
48
|
+
'content-type' => 'application/json'
|
|
49
|
+
}, params)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Combined Enrichment
|
|
53
|
+
#
|
|
54
|
+
# Returns combined person and company enrichment data for an email.
|
|
55
|
+
#
|
|
56
|
+
# @see https://docs.tomba.io/api/enrichment#combined-enrichment
|
|
57
|
+
# @param email [String] the email address to enrich
|
|
58
|
+
# @return [Hash] API response containing combined enrichment data
|
|
59
|
+
# @raise [Tomba::Exception]
|
|
60
|
+
def combined(email)
|
|
61
|
+
raise Tomba::Exception, 'Missing required parameter: "email"' if email.nil?
|
|
62
|
+
|
|
63
|
+
path = '/enrichment/combined'
|
|
64
|
+
|
|
65
|
+
params = { email: email }
|
|
66
|
+
|
|
67
|
+
@client.call('get', path, {
|
|
68
|
+
'content-type' => 'application/json'
|
|
69
|
+
}, params)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -1,40 +1,109 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Tomba
|
|
2
|
-
|
|
4
|
+
# Finder service for email, author, LinkedIn, and phone lookups.
|
|
5
|
+
#
|
|
6
|
+
# Provides methods to find email addresses, authors, LinkedIn profiles,
|
|
7
|
+
# and phone numbers.
|
|
8
|
+
#
|
|
9
|
+
# @see https://docs.tomba.io/api/finder
|
|
10
|
+
class Finder < Service
|
|
11
|
+
# Email Finder
|
|
12
|
+
#
|
|
13
|
+
# Generates or retrieves the most likely email address from a domain and name.
|
|
14
|
+
#
|
|
15
|
+
# @see https://docs.tomba.io/api/finder#email-finder
|
|
16
|
+
# @param domain [String] the domain name
|
|
17
|
+
# @param first_name [String] the first name of the person
|
|
18
|
+
# @param last_name [String] the last name of the person
|
|
19
|
+
# @param webhook_url [String, nil] webhook URL for async notifications
|
|
20
|
+
# @return [Hash] API response
|
|
21
|
+
# @raise [Tomba::Exception]
|
|
22
|
+
def email_finder(domain:, first_name:, last_name:, webhook_url: nil)
|
|
23
|
+
raise Tomba::Exception, 'Missing required parameter: "domain"' if domain.nil?
|
|
24
|
+
raise Tomba::Exception, 'Missing required parameter: "first_name"' if first_name.nil?
|
|
25
|
+
raise Tomba::Exception, 'Missing required parameter: "last_name"' if last_name.nil?
|
|
26
|
+
|
|
27
|
+
path = '/email-finder'
|
|
28
|
+
|
|
29
|
+
params = {}
|
|
30
|
+
params[:domain] = domain unless domain.nil?
|
|
31
|
+
params[:first_name] = first_name unless first_name.nil?
|
|
32
|
+
params[:last_name] = last_name unless last_name.nil?
|
|
33
|
+
params[:webhook_url] = webhook_url unless webhook_url.nil?
|
|
34
|
+
|
|
35
|
+
@client.call('get', path, {
|
|
36
|
+
'content-type' => 'application/json'
|
|
37
|
+
}, params)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Author Finder
|
|
41
|
+
#
|
|
42
|
+
# Retrieves the email address of the author of a given article URL.
|
|
43
|
+
#
|
|
44
|
+
# @see https://docs.tomba.io/api/finder#author-finder
|
|
45
|
+
# @param url [String] the URL of the article
|
|
46
|
+
# @param webhook_url [String, nil] webhook URL for async notifications
|
|
47
|
+
# @return [Hash] API response
|
|
48
|
+
# @raise [Tomba::Exception]
|
|
49
|
+
def author_finder(url:, webhook_url: nil)
|
|
50
|
+
raise Tomba::Exception, 'Missing required parameter: "url"' if url.nil?
|
|
3
51
|
|
|
4
|
-
|
|
5
|
-
if domain.nil?
|
|
6
|
-
raise Tomba::Exception.new('Missing required parameter: "domain"')
|
|
7
|
-
end
|
|
52
|
+
path = '/author-finder'
|
|
8
53
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
54
|
+
params = {}
|
|
55
|
+
params[:url] = url unless url.nil?
|
|
56
|
+
params[:webhook_url] = webhook_url unless webhook_url.nil?
|
|
12
57
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
58
|
+
@client.call('get', path, {
|
|
59
|
+
'content-type' => 'application/json'
|
|
60
|
+
}, params)
|
|
61
|
+
end
|
|
16
62
|
|
|
17
|
-
|
|
18
|
-
|
|
63
|
+
# LinkedIn Finder
|
|
64
|
+
#
|
|
65
|
+
# Retrieves the email address of a person from their LinkedIn URL.
|
|
66
|
+
#
|
|
67
|
+
# @see https://docs.tomba.io/api/finder#linkedin-finder
|
|
68
|
+
# @param url [String] the LinkedIn profile URL
|
|
69
|
+
# @param webhook_url [String, nil] webhook URL for async notifications
|
|
70
|
+
# @return [Hash] API response
|
|
71
|
+
# @raise [Tomba::Exception]
|
|
72
|
+
def linkedin_finder(url:, webhook_url: nil)
|
|
73
|
+
raise Tomba::Exception, 'Missing required parameter: "url"' if url.nil?
|
|
19
74
|
|
|
20
|
-
|
|
75
|
+
path = '/linkedin-finder'
|
|
21
76
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
77
|
+
params = {}
|
|
78
|
+
params[:url] = url unless url.nil?
|
|
79
|
+
params[:webhook_url] = webhook_url unless webhook_url.nil?
|
|
25
80
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
81
|
+
@client.call('get', path, {
|
|
82
|
+
'content-type' => 'application/json'
|
|
83
|
+
}, params)
|
|
84
|
+
end
|
|
29
85
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
86
|
+
# Phone Finder
|
|
87
|
+
#
|
|
88
|
+
# Retrieves the phone number associated with an email address.
|
|
89
|
+
#
|
|
90
|
+
# @see https://docs.tomba.io/api/finder#phone-finder
|
|
91
|
+
# @param email [String] the email address to look up
|
|
92
|
+
# @param webhook_url [String, nil] webhook URL for async notifications
|
|
93
|
+
# @return [Hash] API response
|
|
94
|
+
# @raise [Tomba::Exception]
|
|
95
|
+
def phone_finder(email:, webhook_url: nil)
|
|
96
|
+
raise Tomba::Exception, 'Missing required parameter: "email"' if email.nil?
|
|
34
97
|
|
|
98
|
+
path = '/phone-finder'
|
|
35
99
|
|
|
36
|
-
|
|
100
|
+
params = {}
|
|
101
|
+
params[:email] = email unless email.nil?
|
|
102
|
+
params[:webhook_url] = webhook_url unless webhook_url.nil?
|
|
37
103
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
104
|
+
@client.call('get', path, {
|
|
105
|
+
'content-type' => 'application/json'
|
|
106
|
+
}, params)
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Tomba
|
|
4
|
+
# Flag service for managing email flags.
|
|
5
|
+
#
|
|
6
|
+
# Provides methods to list and create flags for email addresses.
|
|
7
|
+
#
|
|
8
|
+
# @see https://docs.tomba.io/api/flag
|
|
9
|
+
class Flag < Service
|
|
10
|
+
# List Flags
|
|
11
|
+
#
|
|
12
|
+
# Returns all flags associated with the account.
|
|
13
|
+
#
|
|
14
|
+
# @see https://docs.tomba.io/api/flag#list-flags
|
|
15
|
+
# @param page [Integer, nil] the page number for pagination
|
|
16
|
+
# @param limit [Integer, nil] the number of results per page
|
|
17
|
+
# @return [Hash] API response containing the list of flags
|
|
18
|
+
# @raise [Tomba::Exception]
|
|
19
|
+
def list_flags(page: nil, limit: nil)
|
|
20
|
+
path = '/flags'
|
|
21
|
+
|
|
22
|
+
params = {}
|
|
23
|
+
params[:page] = page unless page.nil?
|
|
24
|
+
params[:limit] = limit unless limit.nil?
|
|
25
|
+
|
|
26
|
+
@client.call('get', path, {
|
|
27
|
+
'content-type' => 'application/json'
|
|
28
|
+
}, params)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Create Flag
|
|
32
|
+
#
|
|
33
|
+
# Creates a new flag for an email address.
|
|
34
|
+
#
|
|
35
|
+
# @see https://docs.tomba.io/api/flag#create-flag
|
|
36
|
+
# @param email [String] the email address to flag
|
|
37
|
+
# @param reason [String, nil] optional reason for the flag
|
|
38
|
+
# @return [Hash] API response containing the created flag
|
|
39
|
+
# @raise [Tomba::Exception]
|
|
40
|
+
def create_flag(email:, reason: nil)
|
|
41
|
+
raise Tomba::Exception, 'Missing required parameter: "email"' if email.nil?
|
|
42
|
+
|
|
43
|
+
path = '/flags'
|
|
44
|
+
|
|
45
|
+
params = { email: email }
|
|
46
|
+
params[:reason] = reason unless reason.nil?
|
|
47
|
+
|
|
48
|
+
@client.call('post', path, {
|
|
49
|
+
'content-type' => 'application/json'
|
|
50
|
+
}, params)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Tomba
|
|
4
|
+
# Format service for discovering email formats.
|
|
5
|
+
#
|
|
6
|
+
# Provides methods to find the email format used by a domain.
|
|
7
|
+
#
|
|
8
|
+
# @see https://docs.tomba.io/api/format
|
|
9
|
+
class Format < Service
|
|
10
|
+
# Email Format
|
|
11
|
+
#
|
|
12
|
+
# Returns the email format used by a given domain (e.g., first.last, first_last).
|
|
13
|
+
#
|
|
14
|
+
# @see https://docs.tomba.io/api/format#email-format
|
|
15
|
+
# @param domain [String] the domain name to look up the email format for
|
|
16
|
+
# @return [Hash] API response containing the email format
|
|
17
|
+
# @raise [Tomba::Exception]
|
|
18
|
+
def email_format(domain)
|
|
19
|
+
raise Tomba::Exception, 'Missing required parameter: "domain"' if domain.nil?
|
|
20
|
+
|
|
21
|
+
path = '/email-format'
|
|
22
|
+
|
|
23
|
+
params = { domain: domain }
|
|
24
|
+
|
|
25
|
+
@client.call('get', path, {
|
|
26
|
+
'content-type' => 'application/json'
|
|
27
|
+
}, params)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
data/lib/tomba/services/keys.rb
CHANGED
|
@@ -1,59 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
class Keys < Service
|
|
3
|
-
|
|
4
|
-
def get_keys()
|
|
5
|
-
path = '/keys/{id}'
|
|
6
|
-
|
|
7
|
-
params = {}
|
|
8
|
-
|
|
9
|
-
return @client.call('get', path, {
|
|
10
|
-
'content-type' => 'application/json',
|
|
11
|
-
}, params);
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def delete_key(id:)
|
|
15
|
-
if id.nil?
|
|
16
|
-
raise Tomba::Exception.new('Missing required parameter: "id"')
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
path = '/keys/{id}'
|
|
20
|
-
.gsub('{id}', id)
|
|
21
|
-
|
|
22
|
-
params = {}
|
|
23
|
-
|
|
24
|
-
return @client.call('delete', path, {
|
|
25
|
-
'content-type' => 'application/json',
|
|
26
|
-
}, params);
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def create_key()
|
|
30
|
-
path = '/keys/{id}'
|
|
1
|
+
# frozen_string_literal: true
|
|
31
2
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
3
|
+
module Tomba
|
|
4
|
+
# Keys service for managing API keys.
|
|
5
|
+
#
|
|
6
|
+
# Provides methods to list, create, reset, and delete API keys.
|
|
7
|
+
#
|
|
8
|
+
# @see https://docs.tomba.io/api/keys
|
|
9
|
+
class Keys < Service
|
|
10
|
+
# List all API keys.
|
|
11
|
+
#
|
|
12
|
+
# Returns all API keys associated with the account.
|
|
13
|
+
#
|
|
14
|
+
# @see https://docs.tomba.io/api/keys
|
|
15
|
+
# @return [Hash] API response containing the list of keys
|
|
16
|
+
# @raise [Tomba::Exception]
|
|
17
|
+
def get_keys
|
|
18
|
+
path = '/keys'
|
|
19
|
+
|
|
20
|
+
params = {}
|
|
21
|
+
|
|
22
|
+
@client.call('get', path, {
|
|
23
|
+
'content-type' => 'application/json'
|
|
24
|
+
}, params)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Get a specific API key by ID.
|
|
28
|
+
#
|
|
29
|
+
# @see https://docs.tomba.io/api/keys#get-key
|
|
30
|
+
# @param id [String] the key ID
|
|
31
|
+
# @return [Hash] API response
|
|
32
|
+
# @raise [Tomba::Exception]
|
|
33
|
+
def get_key(id:)
|
|
34
|
+
raise Tomba::Exception, 'Missing required parameter: "id"' if id.nil?
|
|
35
|
+
|
|
36
|
+
path = "/keys/#{id}"
|
|
37
|
+
|
|
38
|
+
@client.call('get', path, {
|
|
39
|
+
'content-type' => 'application/json'
|
|
40
|
+
}, {})
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Delete an API key.
|
|
44
|
+
#
|
|
45
|
+
# Removes a specific API key by its ID.
|
|
46
|
+
#
|
|
47
|
+
# @see https://docs.tomba.io/api/keys#delete-an-api-key
|
|
48
|
+
# @param id [String] the key ID to delete
|
|
49
|
+
# @return [Hash] API response
|
|
50
|
+
# @raise [Tomba::Exception]
|
|
51
|
+
def delete_key(id:)
|
|
52
|
+
raise Tomba::Exception, 'Missing required parameter: "id"' if id.nil?
|
|
53
|
+
|
|
54
|
+
path = "/keys/#{id}"
|
|
55
|
+
|
|
56
|
+
params = {}
|
|
57
|
+
|
|
58
|
+
@client.call('delete', path, {
|
|
59
|
+
'content-type' => 'application/json'
|
|
60
|
+
}, params)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Create a new API key.
|
|
64
|
+
#
|
|
65
|
+
# Generates a new API key for the account.
|
|
66
|
+
#
|
|
67
|
+
# @see https://docs.tomba.io/api/keys#create-an-api-key
|
|
68
|
+
# @return [Hash] API response containing the new key
|
|
69
|
+
# @raise [Tomba::Exception]
|
|
70
|
+
def create_key
|
|
71
|
+
path = '/keys'
|
|
72
|
+
|
|
73
|
+
params = {}
|
|
74
|
+
|
|
75
|
+
@client.call('post', path, {
|
|
76
|
+
'content-type' => 'application/json'
|
|
77
|
+
}, params)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Reset an API key.
|
|
81
|
+
#
|
|
82
|
+
# Regenerates a specific API key by its ID.
|
|
83
|
+
#
|
|
84
|
+
# @see https://docs.tomba.io/api/keys#reset-an-api-key
|
|
85
|
+
# @param id [String] the key ID to reset
|
|
86
|
+
# @return [Hash] API response containing the reset key
|
|
87
|
+
# @raise [Tomba::Exception]
|
|
88
|
+
def reset_key(id:)
|
|
89
|
+
raise Tomba::Exception, 'Missing required parameter: "id"' if id.nil?
|
|
90
|
+
|
|
91
|
+
path = "/keys/#{id}"
|
|
92
|
+
|
|
93
|
+
params = {}
|
|
94
|
+
|
|
95
|
+
@client.call('put', path, {
|
|
96
|
+
'content-type' => 'application/json'
|
|
97
|
+
}, params)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
@@ -1,59 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
class LeadsAttributes < Service
|
|
3
|
-
|
|
4
|
-
def get_lead_attributes()
|
|
5
|
-
path = '/leads/attributes/{id}'
|
|
6
|
-
|
|
7
|
-
params = {}
|
|
8
|
-
|
|
9
|
-
return @client.call('get', path, {
|
|
10
|
-
'content-type' => 'application/json',
|
|
11
|
-
}, params);
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def delete_lead_attribute(id:)
|
|
15
|
-
if id.nil?
|
|
16
|
-
raise Tomba::Exception.new('Missing required parameter: "id"')
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
path = '/leads/attributes/{id}'
|
|
20
|
-
.gsub('{id}', id)
|
|
21
|
-
|
|
22
|
-
params = {}
|
|
23
|
-
|
|
24
|
-
return @client.call('delete', path, {
|
|
25
|
-
'content-type' => 'application/json',
|
|
26
|
-
}, params);
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def create_lead_attribute()
|
|
30
|
-
path = '/leads/attributes/{id}'
|
|
1
|
+
# frozen_string_literal: true
|
|
31
2
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
3
|
+
module Tomba
|
|
4
|
+
# Leads Attributes service for managing lead attributes.
|
|
5
|
+
#
|
|
6
|
+
# Provides methods to list, create, update, and delete lead attributes.
|
|
7
|
+
#
|
|
8
|
+
# @see https://docs.tomba.io/api/leads-attributes
|
|
9
|
+
class LeadsAttributes < Service
|
|
10
|
+
# List all lead attributes.
|
|
11
|
+
#
|
|
12
|
+
# Returns all lead attributes associated with the account.
|
|
13
|
+
#
|
|
14
|
+
# @see https://docs.tomba.io/api/leads-attributes#list-lead-attributes
|
|
15
|
+
# @return [Hash] API response containing the attributes
|
|
16
|
+
# @raise [Tomba::Exception]
|
|
17
|
+
def get_lead_attributes
|
|
18
|
+
path = '/leads/attributes'
|
|
19
|
+
|
|
20
|
+
params = {}
|
|
21
|
+
|
|
22
|
+
@client.call('get', path, {
|
|
23
|
+
'content-type' => 'application/json'
|
|
24
|
+
}, params)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Delete a lead attribute.
|
|
28
|
+
#
|
|
29
|
+
# Removes a specific lead attribute by its ID.
|
|
30
|
+
#
|
|
31
|
+
# @see https://docs.tomba.io/api/leads-attributes#delete-lead-attribute
|
|
32
|
+
# @param id [String] the attribute ID to delete
|
|
33
|
+
# @return [Hash] API response
|
|
34
|
+
# @raise [Tomba::Exception]
|
|
35
|
+
def delete_lead_attribute(id:)
|
|
36
|
+
raise Tomba::Exception, 'Missing required parameter: "id"' if id.nil?
|
|
37
|
+
|
|
38
|
+
path = "/leads/attributes/#{id}"
|
|
39
|
+
|
|
40
|
+
params = {}
|
|
41
|
+
|
|
42
|
+
@client.call('delete', path, {
|
|
43
|
+
'content-type' => 'application/json'
|
|
44
|
+
}, params)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Create a new lead attribute.
|
|
48
|
+
#
|
|
49
|
+
# Creates a new lead attribute for organizing lead data.
|
|
50
|
+
#
|
|
51
|
+
# @see https://docs.tomba.io/api/leads-attributes#create-lead-attribute
|
|
52
|
+
# @return [Hash] API response containing the new attribute
|
|
53
|
+
# @raise [Tomba::Exception]
|
|
54
|
+
def create_lead_attribute
|
|
55
|
+
path = '/leads/attributes'
|
|
56
|
+
|
|
57
|
+
params = {}
|
|
58
|
+
|
|
59
|
+
@client.call('post', path, {
|
|
60
|
+
'content-type' => 'application/json'
|
|
61
|
+
}, params)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Update a lead attribute.
|
|
65
|
+
#
|
|
66
|
+
# Updates a specific lead attribute by its ID.
|
|
67
|
+
#
|
|
68
|
+
# @see https://docs.tomba.io/api/leads-attributes#update-lead-attribute
|
|
69
|
+
# @param id [String] the attribute ID to update
|
|
70
|
+
# @return [Hash] API response
|
|
71
|
+
# @raise [Tomba::Exception]
|
|
72
|
+
def update_lead_attribute(id:)
|
|
73
|
+
raise Tomba::Exception, 'Missing required parameter: "id"' if id.nil?
|
|
74
|
+
|
|
75
|
+
path = "/leads/attributes/#{id}"
|
|
76
|
+
|
|
77
|
+
params = {}
|
|
78
|
+
|
|
79
|
+
@client.call('put', path, {
|
|
80
|
+
'content-type' => 'application/json'
|
|
81
|
+
}, params)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|