get_accept 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +198 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/get_accept.gemspec +34 -0
- data/lib/get_accept.rb +16 -0
- data/lib/get_accept/api.rb +50 -0
- data/lib/get_accept/errors/get_accept_error.rb +15 -0
- data/lib/get_accept/errors/request_error.rb +4 -0
- data/lib/get_accept/errors/server_error.rb +4 -0
- data/lib/get_accept/resource.rb +40 -0
- data/lib/get_accept/resources/document.rb +35 -0
- data/lib/get_accept/resources/file.rb +7 -0
- data/lib/get_accept/resources/subscription.rb +15 -0
- data/lib/get_accept/resources/template.rb +11 -0
- data/lib/get_accept/resources/user.rb +23 -0
- data/lib/get_accept/version.rb +3 -0
- metadata +193 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6eb2957d1ad4aa0640802c2a6ac613b58f1cc1c7
|
4
|
+
data.tar.gz: ee01aa5c97b1d6132794b86a5319adbda0f73ffd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6cbbcc51828dea366f66ac2ef711e007b95e35cb49f6e3ff87c55da30ebbc6dcd2ca34c2e0007783c5bad8b535e30ba6c694ea991d36df0837071ce315c35007
|
7
|
+
data.tar.gz: be4825ba2ddecc6d4913f639625f526a475eea145f38287779e7708ed07047e476c9d4c5b92a0f31a67de147e4f5ad23a681b30bd51794e5e21bf7f27e8b8c68
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at davidicus21@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 soolaimon
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,198 @@
|
|
1
|
+
# GetAccept
|
2
|
+
|
3
|
+
GetAccept is Ruby wrapper around the API for the GetAccept eSignature service. Documentation for request and response data can be found at https://app.getaccept.com/api/
|
4
|
+
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'get_accept'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install get_accept
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Get an API token
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
token = GetAccept::Api.get_token({
|
28
|
+
email: 'getaccept_user@mailinator.com',
|
29
|
+
password: 'password',
|
30
|
+
client_id: 'a8j23', # Optional
|
31
|
+
entity_id: 'asjklf' # Optional. Your GetAccept customer id. Useful if ou belong to multiple organizations using GetAccept.
|
32
|
+
})
|
33
|
+
|
34
|
+
#=> {
|
35
|
+
"access_token": "ACCESS_TOKEN", # JWT
|
36
|
+
"expires_in": 1209600 # 2 weeks in seconds
|
37
|
+
}
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
Insantiate your client
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
api = GetAccept::Api.new({
|
45
|
+
token: 'ACCESS_TOKEN',
|
46
|
+
})
|
47
|
+
```
|
48
|
+
|
49
|
+
Now you can call endpoints with methods matching the resource names:
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
api.document.all
|
53
|
+
|
54
|
+
# =>
|
55
|
+
[
|
56
|
+
{
|
57
|
+
"id": "qnerhxyp"
|
58
|
+
"name": "The big proposal",
|
59
|
+
"status": "sent",
|
60
|
+
"value": 90000,
|
61
|
+
"company_name": "Customer A",
|
62
|
+
"sender_name": "Elon Musk",
|
63
|
+
"created_at": "2015-10-21T14:42",
|
64
|
+
"recipients": [
|
65
|
+
{
|
66
|
+
"first_name": "Dave",
|
67
|
+
"last_name": "Nelson",
|
68
|
+
"email": "dave@crowdengine.com",
|
69
|
+
"thumb_url": "https://media.getaccept.com/contact/b3221e55cd0d1c7e6bdf45fa4aa0a259.png",
|
70
|
+
"company_name": "Customer A"
|
71
|
+
}
|
72
|
+
]
|
73
|
+
},
|
74
|
+
...
|
75
|
+
]
|
76
|
+
```
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
api.document.create({
|
80
|
+
"name": "Test Document name",
|
81
|
+
"file_ids": "562480bb1c86d.pdf,562120db1d23e.pdf",
|
82
|
+
"file_content": "",
|
83
|
+
"file_url": "",
|
84
|
+
"type": "sales",
|
85
|
+
"value": 9400,
|
86
|
+
"external_id": "doc_19953",
|
87
|
+
"company_name": "Tesla Motors Inc.",
|
88
|
+
"company_number": "54-114492",
|
89
|
+
|
90
|
+
"recipients": [{
|
91
|
+
"email": "samir.smajic@getaccept.com",
|
92
|
+
"first_name": "Samir",
|
93
|
+
"last_name": "Smajic",
|
94
|
+
"mobile": "+467012345678",
|
95
|
+
"role": "signer",
|
96
|
+
"order_num": 0,
|
97
|
+
"verify_qna": true,
|
98
|
+
"verify_qna_open": true,
|
99
|
+
"verify_qna_sign": false,
|
100
|
+
"verify_qna_question": "Enter personal ID-number",
|
101
|
+
"verify_qna_answer": "720102-3456",
|
102
|
+
"verify_sms": true,
|
103
|
+
"verify_sms_open": false,
|
104
|
+
"verify_sms_sign": true
|
105
|
+
}],
|
106
|
+
"is_signing_biometric": false,
|
107
|
+
"is_signing_initials": true,
|
108
|
+
"expiration_date": "2015-12-01",
|
109
|
+
"is_reminder_sending": true,
|
110
|
+
"is_signing_forward": true,
|
111
|
+
"is_sms_sending": false,
|
112
|
+
"is_automatic_sending": false,
|
113
|
+
"custom_fields": [
|
114
|
+
{ "id": "x129dba", "value": "Freemont"},
|
115
|
+
{ "name": "Delivery state", "value": "CA"}
|
116
|
+
]
|
117
|
+
})
|
118
|
+
|
119
|
+
# =>
|
120
|
+
{
|
121
|
+
"id": "xy45za9",
|
122
|
+
"name": "The big proposal",
|
123
|
+
"external_id": "p_1552",
|
124
|
+
"value": 8400,
|
125
|
+
"type": "sales",
|
126
|
+
"tags": "",
|
127
|
+
"company_name": "Justin Productions",
|
128
|
+
"company_id": "8nj6hvkn",
|
129
|
+
"company_logo_url": "",
|
130
|
+
"is_selfsign": false,
|
131
|
+
"is_signing_biometric": false,
|
132
|
+
"is_signing_initials": false,
|
133
|
+
"is_private": false,
|
134
|
+
"status": "viewed",
|
135
|
+
"send_date": "2015-10-21T14:42",
|
136
|
+
"sign_date": null,
|
137
|
+
"user_id": "jxpv735n",
|
138
|
+
"email_send_template_id": "d18nabcx",
|
139
|
+
"email_send_subject": "Sending you the proposal",
|
140
|
+
"email_send_message": "",
|
141
|
+
"is_signing": true,
|
142
|
+
"is_signing_order": false,
|
143
|
+
"is_video": false,
|
144
|
+
"expiration_date": "2015-12-29",
|
145
|
+
"is_scheduled_sending": false,
|
146
|
+
"scheduled_sending_time": "",
|
147
|
+
"is_reminder_sending": true,
|
148
|
+
"video_id": 0,
|
149
|
+
"thumb_url": "https://media.getaccept.com/preview/aw8nkenx/n24uxxwn.png",
|
150
|
+
"preview_url": "https://app.getaccept.com/v/a64uqvwn/x8gea49p/a/12f87050ec8f3d8a2e12b4569",
|
151
|
+
"recipients": [
|
152
|
+
{
|
153
|
+
"fullname": "Sam Tester",
|
154
|
+
"first_name": "Sam",
|
155
|
+
"last_name": "Tester",
|
156
|
+
"email": "sam.tester@getaccept.com",
|
157
|
+
"mobile": "+467012345678",
|
158
|
+
"thumb_url": "",
|
159
|
+
"role": "signer",
|
160
|
+
"order_num": "1"
|
161
|
+
}
|
162
|
+
]
|
163
|
+
}
|
164
|
+
```
|
165
|
+
|
166
|
+
Browse the code in the lib/resources folder to get an idea of what methods are available.
|
167
|
+
|
168
|
+
## Error handling
|
169
|
+
|
170
|
+
## Error Handling
|
171
|
+
API response codes in the 400 range will raise a GetAccept::RequestError, while 500+ will raise a GetAccept::ServerError.
|
172
|
+
|
173
|
+
Errors the following attributes, populated based on what the API returns:
|
174
|
+
|
175
|
+
```ruby
|
176
|
+
@response_code = data[:response_code]
|
177
|
+
@response_body = data[:response_body]
|
178
|
+
@message = data[:message]
|
179
|
+
@type = data[:type]
|
180
|
+
@errors = data[:errors]
|
181
|
+
```
|
182
|
+
|
183
|
+
## Development
|
184
|
+
|
185
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
186
|
+
|
187
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
188
|
+
|
189
|
+
## Contributing
|
190
|
+
|
191
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/crowdengine/get_accept. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
192
|
+
|
193
|
+
Please include tests with your pull requests.
|
194
|
+
|
195
|
+
|
196
|
+
## License
|
197
|
+
|
198
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "get_accept"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/get_accept.gemspec
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'get_accept/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "get_accept"
|
8
|
+
spec.version = GetAccept::VERSION
|
9
|
+
spec.authors = ["Dave Nelson"]
|
10
|
+
spec.email = ["davidicus21@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Wrapper for GetAccept API: https://www.getaccept.com}
|
13
|
+
spec.description = %q{Request and response details can be found in the GetAccept API documentation at https://app.getaccept.com/api}
|
14
|
+
spec.homepage = 'https://github.com/CrowdEngine/get_accept'
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
27
|
+
spec.add_development_dependency 'vcr'
|
28
|
+
spec.add_development_dependency 'webmock'
|
29
|
+
spec.add_development_dependency 'pry'
|
30
|
+
spec.add_development_dependency 'dotenv'
|
31
|
+
spec.add_development_dependency 'faker'
|
32
|
+
|
33
|
+
spec.add_dependency 'http'
|
34
|
+
end
|
data/lib/get_accept.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'get_accept/version'
|
2
|
+
|
3
|
+
require 'get_accept/api'
|
4
|
+
require 'get_accept/resource'
|
5
|
+
require 'get_accept/resources/user'
|
6
|
+
require 'get_accept/resources/document'
|
7
|
+
require 'get_accept/resources/file'
|
8
|
+
require 'get_accept/resources/template'
|
9
|
+
require 'get_accept/resources/subscription'
|
10
|
+
require 'get_accept/errors/get_accept_error'
|
11
|
+
require 'get_accept/errors/request_error'
|
12
|
+
require 'get_accept/errors/server_error'
|
13
|
+
|
14
|
+
module GetAccept
|
15
|
+
API_BASE = 'https://api.getaccept.com/v1'
|
16
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'http'
|
2
|
+
|
3
|
+
module GetAccept
|
4
|
+
class Api
|
5
|
+
attr_reader :client
|
6
|
+
|
7
|
+
def self.get_token(options = {})
|
8
|
+
payload = {
|
9
|
+
email: options[:email],
|
10
|
+
password: options[:password],
|
11
|
+
client: options[:client],
|
12
|
+
entity_id: options[:entity_id],
|
13
|
+
}
|
14
|
+
HTTP.post("#{API_BASE}/auth", json: payload)
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
def initialize(options = {})
|
19
|
+
@token = options[:token]
|
20
|
+
@client = HTTP.auth("Bearer #{@token}").headers('Content-Type' => 'application/json')
|
21
|
+
end
|
22
|
+
|
23
|
+
def refresh_token
|
24
|
+
client.get("#{API_BASE}/refresh",)
|
25
|
+
end
|
26
|
+
|
27
|
+
def revoke_token
|
28
|
+
client.get("#{API_BASE}/revoke")
|
29
|
+
end
|
30
|
+
|
31
|
+
def open_url url
|
32
|
+
url = URI.encode("https://app.getaccept.com/auth/sso/login?token=#{@token}&go=#{url}")
|
33
|
+
end
|
34
|
+
|
35
|
+
def method_missing(method, *args)
|
36
|
+
klass = method.to_s.split('_').collect(&:capitalize).join
|
37
|
+
Object.const_get("GetAccept::#{klass}").new(@client)
|
38
|
+
rescue NameError
|
39
|
+
super
|
40
|
+
end
|
41
|
+
|
42
|
+
def respond_to_missing?(method, include_private = false)
|
43
|
+
klass = method.to_s.capitalize
|
44
|
+
Object.const_get("GetAccept::#{klass}")
|
45
|
+
true
|
46
|
+
rescue NameError
|
47
|
+
super
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module GetAccept
|
2
|
+
class GetAcceptError < StandardError
|
3
|
+
attr_accessor :response_code, :response_body, :message, :type, :errors
|
4
|
+
|
5
|
+
def initialize(data = {message: nil, type: nil, response_code: nil, reponse_body: nil, errors: nil})
|
6
|
+
@response_code = data[:response_code]
|
7
|
+
@response_body = data[:response_body]
|
8
|
+
@message = data[:message]
|
9
|
+
@type = data[:type]
|
10
|
+
@errors = data[:errors]
|
11
|
+
|
12
|
+
super(message)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module GetAccept
|
2
|
+
class Resource
|
3
|
+
attr_reader :client
|
4
|
+
|
5
|
+
def initialize client
|
6
|
+
@client = client
|
7
|
+
end
|
8
|
+
|
9
|
+
protected
|
10
|
+
def get(path)
|
11
|
+
response = client.get("#{API_BASE}#{path}")
|
12
|
+
handle_response(response)
|
13
|
+
end
|
14
|
+
|
15
|
+
def post(path, data = nil)
|
16
|
+
response = client.post("#{API_BASE}#{path}", json: data)
|
17
|
+
handle_response(response)
|
18
|
+
end
|
19
|
+
|
20
|
+
def delete (path)
|
21
|
+
client.delete("#{API_BASE}#{path}")
|
22
|
+
end
|
23
|
+
|
24
|
+
def handle_response(response)
|
25
|
+
parsed_response = response.parse
|
26
|
+
if response.code < 400
|
27
|
+
parsed_response
|
28
|
+
else
|
29
|
+
error_klass = response.code >= 500 ? ServerError : RequestError
|
30
|
+
raise error_klass.new({
|
31
|
+
response_code: response.code,
|
32
|
+
response_body: parsed_response,
|
33
|
+
type: parsed_response['error'],
|
34
|
+
message: parsed_response['description'],
|
35
|
+
errors: parsed_response['errors'],
|
36
|
+
})
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module GetAccept
|
2
|
+
class Document < Resource
|
3
|
+
def all
|
4
|
+
get('/documents')
|
5
|
+
end
|
6
|
+
|
7
|
+
def find id
|
8
|
+
get("/documents/#{id}")
|
9
|
+
end
|
10
|
+
|
11
|
+
def find_by_external_id external_id
|
12
|
+
get("/documents/external/#{external_id}")
|
13
|
+
end
|
14
|
+
|
15
|
+
def create data
|
16
|
+
post('/documents', data)
|
17
|
+
end
|
18
|
+
|
19
|
+
def send id
|
20
|
+
post("/documents/#{id}/send")
|
21
|
+
end
|
22
|
+
|
23
|
+
def recipients id
|
24
|
+
get("/documents/#{id}/recipients")
|
25
|
+
end
|
26
|
+
|
27
|
+
def view_url id
|
28
|
+
"https://app.getaccept.com/document/view/#{id}"
|
29
|
+
end
|
30
|
+
|
31
|
+
def destroy id
|
32
|
+
delete("/documents/#{id}")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module GetAccept
|
2
|
+
class User < Resource
|
3
|
+
def me
|
4
|
+
get('/users/me')
|
5
|
+
end
|
6
|
+
|
7
|
+
def all
|
8
|
+
get('/users')
|
9
|
+
end
|
10
|
+
|
11
|
+
def find id
|
12
|
+
get("/users/#{id}")
|
13
|
+
end
|
14
|
+
|
15
|
+
def statistics_for id
|
16
|
+
get("/users/#{id}/statistics")
|
17
|
+
end
|
18
|
+
|
19
|
+
def create data
|
20
|
+
post('/users', data)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: get_accept
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dave Nelson
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-03-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: vcr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: dotenv
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: faker
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: http
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
description: Request and response details can be found in the GetAccept API documentation
|
140
|
+
at https://app.getaccept.com/api
|
141
|
+
email:
|
142
|
+
- davidicus21@gmail.com
|
143
|
+
executables: []
|
144
|
+
extensions: []
|
145
|
+
extra_rdoc_files: []
|
146
|
+
files:
|
147
|
+
- ".gitignore"
|
148
|
+
- ".travis.yml"
|
149
|
+
- CODE_OF_CONDUCT.md
|
150
|
+
- Gemfile
|
151
|
+
- LICENSE.txt
|
152
|
+
- README.md
|
153
|
+
- Rakefile
|
154
|
+
- bin/console
|
155
|
+
- bin/setup
|
156
|
+
- get_accept.gemspec
|
157
|
+
- lib/get_accept.rb
|
158
|
+
- lib/get_accept/api.rb
|
159
|
+
- lib/get_accept/errors/get_accept_error.rb
|
160
|
+
- lib/get_accept/errors/request_error.rb
|
161
|
+
- lib/get_accept/errors/server_error.rb
|
162
|
+
- lib/get_accept/resource.rb
|
163
|
+
- lib/get_accept/resources/document.rb
|
164
|
+
- lib/get_accept/resources/file.rb
|
165
|
+
- lib/get_accept/resources/subscription.rb
|
166
|
+
- lib/get_accept/resources/template.rb
|
167
|
+
- lib/get_accept/resources/user.rb
|
168
|
+
- lib/get_accept/version.rb
|
169
|
+
homepage: https://github.com/CrowdEngine/get_accept
|
170
|
+
licenses:
|
171
|
+
- MIT
|
172
|
+
metadata: {}
|
173
|
+
post_install_message:
|
174
|
+
rdoc_options: []
|
175
|
+
require_paths:
|
176
|
+
- lib
|
177
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
187
|
+
requirements: []
|
188
|
+
rubyforge_project:
|
189
|
+
rubygems_version: 2.4.8
|
190
|
+
signing_key:
|
191
|
+
specification_version: 4
|
192
|
+
summary: 'Wrapper for GetAccept API: https://www.getaccept.com'
|
193
|
+
test_files: []
|