clicksign-api 1.1.0.alpha6 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12d78c1e1512951c7213b73440679297f738376895698654fd8580a8a0290cf7
4
- data.tar.gz: d899a9ac359212534f3e75a2d77bbe0f0c6e9e01f534a668ce8161e3b7d52d71
3
+ metadata.gz: 061bb74814df58a57be2fe91efc07adf51bced436abcc52c66d0845fa8a0d5c4
4
+ data.tar.gz: f57a4fd5de30e9ab39ee4d6eb00226fe892c079a22e9536ffa0b7162ade253d9
5
5
  SHA512:
6
- metadata.gz: af14c66c6e4a1a5cb8471c0dcc32072e889381aaa815ad65c89b63e6fb830ab48514338f0465d96cd8f6bed8f804cd0ae997abc5056702a4946a9bc67abac6b8
7
- data.tar.gz: e66b3372d2204d83917c65974e6eef811ab4c049cd242b2858dc15a2a8f1a16a2e4571cdbedd31502309be4a654f8e3d2e82add6617c31d929b1f803dc9424c1
6
+ metadata.gz: b63752187adf661d6b62f09a6f7988385bb1e364677d1125f21cce5d8ff24e8ede765931a3ef8102e9be6b82ab0fd8556b38a45cadc8893baf4da5769784b856
7
+ data.tar.gz: 562c3b925acee7c369ff5c3aadc961065c6c38cdbddc7c4add58805b3d72e0df6f720e12ea4ed659a35548ed8c616d7980efdb1c19c4e0565203fa376b06e2c1
data/CHANGELOG.md CHANGED
@@ -1,25 +1,15 @@
1
1
  # Clicksign::API 1.1.0 (Octuber 29, 2021)
2
2
 
3
3
  Add support to multiple credentials.
4
- This is useful to work with different environments, providing flexibility.
4
+ This is useful to work with different accounts and environments, providing flexibility.
5
5
  For example, applications have different tokens for each environment.
6
6
  Other useful case, occurs working with multiple companies.
7
7
 
8
- The credentials should be a hash.
9
- It is possible use a `.yml` file to configure the authentication tokens.
10
- The `.yml` file can get the tokens using environment variables.
11
- Now all requests receive token parameter, that represents the key associated with the token.
12
-
13
- ## Examples:
14
-
15
- YML file
16
- ```ruby
17
- => key.production: ENV['CLICKSIGN_ACCESS_TOKEN_PRODUCTION']
18
- => key.sandbox: ENV['CLICKSIGN_ACCESS_TOKEN_SANDBOX']
19
- ```
8
+ The credentials should be a hash.
20
9
 
21
10
  Request:
22
11
  ```ruby
23
- => file = File.open('/path/to/file/local/file.pdf', 'r')
24
- => response = Clicksign::API::Document.create( params: { path: '/path/to/file/on/clicksign.pdf', file: file }, token: 'key.production')
25
- ```
12
+ file = File.open('/path/to/file/local/file.pdf', 'r')
13
+ response = Clicksign::API::Document.create(params: { path: '/path/to/file/on/clicksign.pdf', file: file }, token: 'key.production')
14
+ # =>
15
+ ```
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clicksign-api (1.1.0.alpha6)
4
+ clicksign-api (1.1.0)
5
5
  faraday
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -55,100 +55,93 @@ To see all available parameters, please, check the [API docs](https://developers
55
55
  ```ruby
56
56
  file = File.open('/path/to/file/local/file.pdf', 'r')
57
57
  document = Clicksign::API::Document.create( params: { path: '/path/to/file/on/clicksign.pdf', file: file }, token: 'valid_token')
58
- => #<Faraday::Response ...>
58
+ # => #<Faraday::Response ...>
59
59
 
60
60
  document.success?
61
- => true # false
61
+ # => true # false
62
62
 
63
63
  response_document = JSON.parse(document.body)
64
- => {:document=> {:key=> '...', :path=> '...', :status => '...', ... }
65
- => # key: '123abcd' as example!
64
+ # => {:document=> {:key=> '...', :path=> '...', :status => '...', ... }
66
65
  ```
67
66
 
68
67
  #### View documents
69
68
 
70
69
  ```ruby
71
70
  find_document = Clicksign::API::Document.find(params: { key: response_document['document']['key'] }, token: 'valid_token')
72
- => #<Faraday::Response ...>
71
+ # => #<Faraday::Response ...>
73
72
 
74
73
  find_document.success?
75
- => true # false
74
+ # => true # false
76
75
 
77
76
  JSON.parse(find_document.body)
78
- => {:document=> {:key=> '...', :path=> '...', :status => '...', ... }
77
+ # => {:document=> {:key=> '...', :path=> '...', :status => '...', ... }
79
78
  ```
80
79
 
81
80
  #### Create Signers
82
81
 
83
82
  ```ruby
84
83
  signer = Clicksign::API::Signer.create(params: { email: 'mail@email.com', auths: ['email'], delivery: 'email' }, token: 'valid_token')
85
- => #<Faraday::Response ...>
84
+ # => #<Faraday::Response ...>
86
85
 
87
86
  signer.success?
88
- => true # false
87
+ # => true # false
89
88
 
90
89
  response_signer = JSON.parse(signer.body)
91
- => {:document=> {:key=> '...', :path=> '...', :status => '...', ... }
92
- => # signer_key: '999poo' as example!
90
+ # => {:signer=> {:key=> '...', :email=> '...', ... }
93
91
  ```
94
92
  #### Add Signers to Document
95
93
 
96
94
  ```ruby
97
-
98
95
  signer_document = Clicksign::API::DocumentsSigners.create(params: { document_key: response_document['document']['key'], signer_key: response_signer['key'], sign_as: 'sign_as' }, token: 'valid_token')
99
- => #<Faraday::Response ...>
96
+ # => #<Faraday::Response ...>
100
97
 
101
98
  signer_document.success?
102
- => true # false
99
+ # => true # false
103
100
 
104
101
  response_signer_document = JSON.parse(signer_document.body)
105
- => {:document=> {:key=> '...', :path=> '...', :status => '...', ... }
102
+ # => {:list=> {:key=> '...', ... }
106
103
  ```
107
104
 
108
105
  ##### Creating Documents in Batches
109
106
 
110
107
  ```ruby
111
-
112
- batch = Clicksign::API::Batch.create(params: { document_keys: [response_document['document']['key'], 'other_document_key'], signer_key: response_signer['key'], summary: true}, token: 'valid_token')
113
- => #<Faraday::Response ...>
108
+ batch = Clicksign::API::Batch.create(
109
+ params: {
110
+ document_keys: [response_document['document']['key'], 'other_document_key'],
111
+ signer_key: response_signer['key'],
112
+ summary: true
113
+ },
114
+ token: 'valid_token'
115
+ )
116
+ # => #<Faraday::Response ...>
114
117
 
115
118
  batch.success?
116
- => true # false
119
+ # => true # false
117
120
 
118
121
  rseponse_batch = JSON.parse(batch.body)
119
- => #{"batch"=> {"key"=>"3dd7fa89-15f7-48b6-81e8-7d14a273bbb8"
120
-
122
+ # => #{"batch"=> {"key"=>"..."
121
123
  ```
122
124
  #### Notifying Signer by e-mail
123
125
 
124
126
  ```ruby
125
- request_signature_key = JSON.parse(response_document_above.body)['document']['signers'].first['request_signature_key']
126
- notify = Clicksign::API::Notifier.notify(params: { request_signature_key: request_signature_key }, token: 'valid_token')
127
- => #<Faraday::Response ...>
127
+ notify = Clicksign::API::Notifier.notify(params: { request_signature_key: 'request_signature_key' }, token: 'valid_token')
128
+ # => #<Faraday::Response ...>
128
129
 
129
130
  notify.success?
130
- => true # false
131
+ # => true # false
131
132
 
132
133
  JSON.parse(notify.body)
133
- => ##<struct Faraday::Env, method=:post request_body="{\"request_signature_key\":
134
-
134
+ # => ##<struct Faraday::Env, method=:post request_body="{\"request_signature_key\":
135
135
  ```
136
136
 
137
137
  #### Notifying Signer by whatsapp
138
138
 
139
139
  ```ruby
140
- => # To deliver this content, its necessary add `phone_number` on Signer
141
-
142
- request_signature_key = JSON.parse(response_document_above.body)['document']['signers'].first['request_signature_key']
143
- notify = Clicksign::API::Notifier.notify(params: { request_signature_key: request_signature_key }, token: 'valid_token')
144
- => #<Faraday::Response ...>
140
+ notify = Clicksign::API::Notifier.notify(params: { request_signature_key: 'request_signature_key' }, token: 'valid_token')
141
+ # => #<Faraday::Response ...>
145
142
 
146
143
  notify.success?
147
- => true # false
148
-
149
- JSON.parse(notify.body)
150
- => ##<struct Faraday::Env, method=:post request_body="{\"request_signature_key\":
151
-
144
+ # => true # false
152
145
 
153
146
  ## Development
154
147
 
@@ -1,5 +1,5 @@
1
1
  module Clicksign
2
2
  module API
3
- VERSION = "1.1.0.alpha6"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clicksign-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.alpha6
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Martins
@@ -194,9 +194,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
194
194
  version: '0'
195
195
  required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  requirements:
197
- - - ">"
197
+ - - ">="
198
198
  - !ruby/object:Gem::Version
199
- version: 1.3.1
199
+ version: '0'
200
200
  requirements: []
201
201
  rubygems_version: 3.1.6
202
202
  signing_key: