docuseal 1.0.0 → 1.0.2
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/README.md +292 -22
- data/lib/docuseal/api.rb +6 -6
- data/lib/docuseal/http.rb +4 -1
- data/lib/docuseal/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 975f08418bdd57eb2f63777bb6f293254e26c9347e6b267854299d13f75eed05
|
|
4
|
+
data.tar.gz: 375137878087b2c284c63f180ab7283ed665c394eaf33553a58195901e73d7d9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd5d3c2e3abec3fb5bb145dda6e02c4752ea8983a67b530bee684698f589c1ee51b6b4851088c4c70e8eae2e11e4935211c7492c0be240824f24829b19a7322a
|
|
7
|
+
data.tar.gz: 9a8b631e6af94e54caed11cfb064e8791f77d89b9830ca521a50b01338ff20b87cba16d680506fb04bddb4ce56b781df9ae8a48fc1aacc28ab3574c463bafddc
|
data/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# DocuSeal Ruby
|
|
1
|
+
# DocuSeal Ruby
|
|
2
2
|
|
|
3
3
|
The DocuSeal Ruby library provides seamless integration with the DocuSeal API, allowing developers to interact with DocuSeal's electronic signature and document management features directly within Ruby applications. This library is designed to simplify API interactions and provide tools for efficient implementation.
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
7
|
-
Detailed documentation is available at [DocuSeal API Docs](https://www.docuseal.com/docs/api).
|
|
7
|
+
Detailed documentation is available at [DocuSeal API Docs](https://www.docuseal.com/docs/api?lang=ruby).
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -14,23 +14,11 @@ To install the library, run:
|
|
|
14
14
|
gem install docuseal
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
If you want to build the gem from source:
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
gem build docuseal.gemspec
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Requirements
|
|
24
|
-
|
|
25
|
-
- Ruby 2.5+.
|
|
26
|
-
|
|
27
17
|
### Bundler
|
|
28
18
|
|
|
29
19
|
Add the library to your Gemfile for projects using Bundler:
|
|
30
20
|
|
|
31
21
|
```ruby
|
|
32
|
-
source 'https://rubygems.org'
|
|
33
|
-
|
|
34
22
|
gem 'docuseal'
|
|
35
23
|
```
|
|
36
24
|
|
|
@@ -61,9 +49,9 @@ Docuseal.key = 'your_api_key_here'
|
|
|
61
49
|
Docuseal.url = 'https://api.docuseal.eu'
|
|
62
50
|
```
|
|
63
51
|
|
|
64
|
-
#### On-
|
|
52
|
+
#### On-Premises
|
|
65
53
|
|
|
66
|
-
For on-
|
|
54
|
+
For on-premises installations, API keys can be retrieved from the API settings page of your deployed application, e.g., https://yourdocusealapp.com/settings/api.
|
|
67
55
|
|
|
68
56
|
```ruby
|
|
69
57
|
require 'docuseal'
|
|
@@ -72,16 +60,298 @@ Docuseal.key = 'your_api_key_here'
|
|
|
72
60
|
Docuseal.url = 'https://yourdocusealapp.com/api'
|
|
73
61
|
```
|
|
74
62
|
|
|
75
|
-
|
|
63
|
+
## API Methods
|
|
64
|
+
|
|
65
|
+
### list_submissions(params)
|
|
66
|
+
|
|
67
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#list-all-submissions)
|
|
68
|
+
|
|
69
|
+
Provides the ability to retrieve a list of available submissions.
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
```ruby
|
|
73
|
+
Docuseal.list_submissions(limit: 10)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### get_submission(id)
|
|
77
|
+
|
|
78
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#get-a-submission)
|
|
79
|
+
|
|
80
|
+
Provides the functionality to retrieve information about a submission.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
Docuseal.get_submission(1001)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### create_submission(data)
|
|
88
|
+
|
|
89
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#create-a-submission)
|
|
90
|
+
|
|
91
|
+
This API endpoint allows you to create signature requests (submissions) for a document template and send them to the specified submitters (signers).
|
|
92
|
+
|
|
93
|
+
**Related Guides:**<br>
|
|
94
|
+
[Send documents for signature via API](https://www.docuseal.com/guides/send-documents-for-signature-via-api)
|
|
95
|
+
[Pre-fill PDF document form fields with API](https://www.docuseal.com/guides/pre-fill-pdf-document-form-fields-with-api)
|
|
76
96
|
|
|
77
|
-
#### List Templates
|
|
78
97
|
|
|
79
98
|
```ruby
|
|
80
|
-
|
|
81
|
-
|
|
99
|
+
Docuseal.create_submission({
|
|
100
|
+
template_id: 1000001,
|
|
101
|
+
send_email: true,
|
|
102
|
+
submitters: [
|
|
103
|
+
{
|
|
104
|
+
role: "First Party",
|
|
105
|
+
email: "john.doe@example.com"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
})
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### create_submission_from_emails(data)
|
|
112
|
+
|
|
113
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#create-submissions-from-emails)
|
|
114
|
+
|
|
115
|
+
This API endpoint allows you to create submissions for a document template and send them to the specified email addresses. This is a simplified version of the POST /submissions API to be used with Zapier or other automation tools.
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
```ruby
|
|
119
|
+
Docuseal.create_submission_from_emails({
|
|
120
|
+
template_id: 1000001,
|
|
121
|
+
emails: "hi@docuseal.com, example@docuseal.com"
|
|
122
|
+
})
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### archive_submission(id)
|
|
82
126
|
|
|
83
|
-
#
|
|
84
|
-
|
|
127
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#archive-a-submission)
|
|
128
|
+
|
|
129
|
+
Allows you to archive a submission.
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
```ruby
|
|
133
|
+
Docuseal.archive_submission(1001)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### list_submitters(params)
|
|
137
|
+
|
|
138
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#list-all-submitters)
|
|
139
|
+
|
|
140
|
+
Provides the ability to retrieve a list of submitters.
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
```ruby
|
|
144
|
+
Docuseal.list_submitters(limit: 10)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### get_submitter(id)
|
|
148
|
+
|
|
149
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#get-a-submitter)
|
|
150
|
+
|
|
151
|
+
Provides the functionality to retrieve information about a submitter.
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
```ruby
|
|
155
|
+
Docuseal.get_submitter(500001)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### update_submitter(id, data)
|
|
159
|
+
|
|
160
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#update-a-submitter)
|
|
161
|
+
|
|
162
|
+
Allows you to update submitter details, pre-fill or update field values and re-send emails.
|
|
163
|
+
|
|
164
|
+
**Related Guides:**<br>
|
|
165
|
+
[Automatically sign documents via API](https://www.docuseal.com/guides/pre-fill-pdf-document-form-fields-with-api#automatically_sign_documents_via_api)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
```ruby
|
|
169
|
+
Docuseal.update_submitter(500001, {
|
|
170
|
+
email: "john.doe@example.com",
|
|
171
|
+
fields: [
|
|
172
|
+
{
|
|
173
|
+
name: "First Name",
|
|
174
|
+
default_value: "Acme"
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
})
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### list_templates(params)
|
|
181
|
+
|
|
182
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#list-all-templates)
|
|
183
|
+
|
|
184
|
+
Provides the ability to retrieve a list of available document templates.
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
```ruby
|
|
188
|
+
Docuseal.list_templates(limit: 10)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### get_template(id)
|
|
192
|
+
|
|
193
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#get-a-template)
|
|
194
|
+
|
|
195
|
+
Provides the functionality to retrieve information about a document template.
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
```ruby
|
|
199
|
+
Docuseal.get_template(1000001)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### create_template_from_docx(data)
|
|
203
|
+
|
|
204
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#create-a-template-from-word-docx)
|
|
205
|
+
|
|
206
|
+
Provides the functionality to create a fillable document template for existing Microsoft Word document. Use `{{Field Name;role=Signer1;type=date}}` text tags to define fillable fields in the document. See [https://www.docuseal.com/examples/fieldtags.docx](https://www.docuseal.com/examples/fieldtags.docx) for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
|
|
207
|
+
|
|
208
|
+
**Related Guides:**<br>
|
|
209
|
+
[Use embedded text field tags to create a fillable form](https://www.docuseal.com/guides/use-embedded-text-field-tags-in-the-pdf-to-create-a-fillable-form)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
```ruby
|
|
213
|
+
Docuseal.create_template_from_docx({
|
|
214
|
+
name: "Test DOCX",
|
|
215
|
+
documents: [
|
|
216
|
+
{
|
|
217
|
+
name: "string",
|
|
218
|
+
file: "base64"
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
})
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### create_template_from_html(data)
|
|
225
|
+
|
|
226
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#create-a-template-from-html)
|
|
227
|
+
|
|
228
|
+
Provides the functionality to seamlessly generate a PDF document template by utilizing the provided HTML content while incorporating pre-defined fields.
|
|
229
|
+
|
|
230
|
+
**Related Guides:**<br>
|
|
231
|
+
[Create PDF document fillable form with HTML](https://www.docuseal.com/guides/create-pdf-document-fillable-form-with-html-api)
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
```ruby
|
|
235
|
+
Docuseal.create_template_from_html({
|
|
236
|
+
html: "<p>Lorem Ipsum is simply dummy text of the
|
|
237
|
+
<text-field
|
|
238
|
+
name=\"Industry\"
|
|
239
|
+
role=\"First Party\"
|
|
240
|
+
required=\"false\"
|
|
241
|
+
style=\"width: 80px; height: 16px; display: inline-block; margin-bottom: -4px\">
|
|
242
|
+
</text-field>
|
|
243
|
+
and typesetting industry</p>
|
|
244
|
+
",
|
|
245
|
+
name: "Test Template"
|
|
246
|
+
})
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### merge_templates(data)
|
|
250
|
+
|
|
251
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#merge-templates)
|
|
252
|
+
|
|
253
|
+
Allows you to merge multiple templates with documents and fields into a new combined template.
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
```ruby
|
|
257
|
+
Docuseal.merge_templates({
|
|
258
|
+
template_ids: [
|
|
259
|
+
321,
|
|
260
|
+
432
|
|
261
|
+
],
|
|
262
|
+
name: "Merged Template"
|
|
263
|
+
})
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### create_template_from_pdf(data)
|
|
267
|
+
|
|
268
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#create-a-template-from-existing-pdf)
|
|
269
|
+
|
|
270
|
+
Provides the functionality to create a fillable document template for existing PDF file. Use `{{Field Name;role=Signer1;type=date}}` text tags to define fillable fields in the document. See [https://www.docuseal.com/examples/fieldtags.pdf](https://www.docuseal.com/examples/fieldtags.pdf) for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
|
|
271
|
+
|
|
272
|
+
**Related Guides:**<br>
|
|
273
|
+
[Use embedded text field tags to create a fillable form](https://www.docuseal.com/guides/use-embedded-text-field-tags-in-the-pdf-to-create-a-fillable-form)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
```ruby
|
|
277
|
+
Docuseal.create_template_from_pdf({
|
|
278
|
+
name: "Test PDF",
|
|
279
|
+
documents: [
|
|
280
|
+
{
|
|
281
|
+
name: "string",
|
|
282
|
+
file: "base64",
|
|
283
|
+
fields: [
|
|
284
|
+
{
|
|
285
|
+
name: "string",
|
|
286
|
+
areas: [
|
|
287
|
+
{
|
|
288
|
+
x: 0,
|
|
289
|
+
y: 0,
|
|
290
|
+
w: 0,
|
|
291
|
+
h: 0,
|
|
292
|
+
page: 1
|
|
293
|
+
}
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
})
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### clone_template(id, data)
|
|
303
|
+
|
|
304
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#clone-a-template)
|
|
305
|
+
|
|
306
|
+
Allows you to clone existing template into a new template.
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
```ruby
|
|
310
|
+
Docuseal.clone_template(1000001, {
|
|
311
|
+
name: "Cloned Template"
|
|
312
|
+
})
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### update_template(id, data)
|
|
316
|
+
|
|
317
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#update-a-template)
|
|
318
|
+
|
|
319
|
+
Provides the functionality to move a document template to a different folder and update the name of the template.
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
```ruby
|
|
323
|
+
Docuseal.update_template(1000001, {
|
|
324
|
+
name: "New Document Name",
|
|
325
|
+
folder_name: "New Folder"
|
|
326
|
+
})
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### update_template_documents(id, data)
|
|
330
|
+
|
|
331
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#update-template-documents)
|
|
332
|
+
|
|
333
|
+
Allows you to add, remove or replace documents in the template with provided PDF/DOCX file or HTML content.
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
```ruby
|
|
337
|
+
Docuseal.update_template_documents(1000001, {
|
|
338
|
+
documents: [
|
|
339
|
+
{
|
|
340
|
+
file: "string"
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
})
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### archive_template(id)
|
|
347
|
+
|
|
348
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#archive-a-template)
|
|
349
|
+
|
|
350
|
+
Allows you to archive a document template.
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
```ruby
|
|
354
|
+
Docuseal.archive_template(1000001)
|
|
85
355
|
```
|
|
86
356
|
|
|
87
357
|
### Configuring Timeouts
|
data/lib/docuseal/api.rb
CHANGED
|
@@ -14,8 +14,8 @@ module Docuseal
|
|
|
14
14
|
http.get('/templates', params)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
def get_template(id)
|
|
18
|
-
http.get("/templates/#{id}")
|
|
17
|
+
def get_template(id, params = {})
|
|
18
|
+
http.get("/templates/#{id}", params)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def create_template_from_docx(data)
|
|
@@ -58,8 +58,8 @@ module Docuseal
|
|
|
58
58
|
http.get('/submissions', params)
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
def get_submission(id)
|
|
62
|
-
http.get("/submissions/#{id}")
|
|
61
|
+
def get_submission(id, params = {})
|
|
62
|
+
http.get("/submissions/#{id}", params)
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def create_submission(data)
|
|
@@ -82,8 +82,8 @@ module Docuseal
|
|
|
82
82
|
http.get('/submitters', params)
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
-
def get_submitter(id)
|
|
86
|
-
http.get("/submitters/#{id}")
|
|
85
|
+
def get_submitter(id, params = {})
|
|
86
|
+
http.get("/submitters/#{id}", params)
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
def update_submitter(id, data)
|
data/lib/docuseal/http.rb
CHANGED
|
@@ -7,6 +7,8 @@ require 'net/http'
|
|
|
7
7
|
|
|
8
8
|
module Docuseal
|
|
9
9
|
class Http
|
|
10
|
+
USER_AGENT = "DocuSeal Ruby v#{VERSION}"
|
|
11
|
+
|
|
10
12
|
BODY_METHODS = %i[post put].freeze
|
|
11
13
|
|
|
12
14
|
attr_reader :config
|
|
@@ -51,7 +53,8 @@ module Docuseal
|
|
|
51
53
|
def headers
|
|
52
54
|
{
|
|
53
55
|
'X-Auth-Token' => config[:key],
|
|
54
|
-
'Content-Type' => 'application/json'
|
|
56
|
+
'Content-Type' => 'application/json',
|
|
57
|
+
'User-Agent' => USER_AGENT
|
|
55
58
|
}
|
|
56
59
|
end
|
|
57
60
|
|
data/lib/docuseal/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: docuseal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- DocuSeal
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-12-
|
|
11
|
+
date: 2024-12-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: DocuSeal is a document signing platform. This gem provides a Ruby interface
|
|
14
14
|
to the DocuSeal API.
|
|
@@ -30,9 +30,9 @@ metadata:
|
|
|
30
30
|
bug_tracker_uri: https://github.com/docusealco/docuseal-ruby/issues
|
|
31
31
|
homepage_uri: https://www.docuseal.com
|
|
32
32
|
source_code_uri: https://github.com/docusealco/docuseal-ruby
|
|
33
|
-
documentation_uri: https://www.docuseal.com/docs/api
|
|
33
|
+
documentation_uri: https://www.docuseal.com/docs/api?lang=ruby
|
|
34
34
|
rubygems_mfa_required: 'true'
|
|
35
|
-
post_install_message:
|
|
35
|
+
post_install_message:
|
|
36
36
|
rdoc_options: []
|
|
37
37
|
require_paths:
|
|
38
38
|
- lib
|
|
@@ -47,8 +47,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
47
47
|
- !ruby/object:Gem::Version
|
|
48
48
|
version: '0'
|
|
49
49
|
requirements: []
|
|
50
|
-
rubygems_version: 3.
|
|
51
|
-
signing_key:
|
|
50
|
+
rubygems_version: 3.5.11
|
|
51
|
+
signing_key:
|
|
52
52
|
specification_version: 4
|
|
53
53
|
summary: Ruby bindings for DocuSeal API
|
|
54
54
|
test_files: []
|