docuseal 0.1.2 → 1.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 +4 -4
- data/README.md +263 -145
- data/lib/docuseal/api.rb +93 -0
- data/lib/docuseal/http.rb +63 -37
- data/lib/docuseal/version.rb +1 -1
- data/lib/docuseal.rb +55 -32
- metadata +17 -44
- data/.rspec +0 -3
- data/.ruby-version +0 -1
- data/.standard.yml +0 -3
- data/.vscode/settings.json +0 -11
- data/CHANGELOG.md +0 -5
- data/CODE_OF_CONDUCT.md +0 -84
- data/CONTRIBUTING.md +0 -3
- data/Gemfile +0 -26
- data/Gemfile.lock +0 -153
- data/LICENSE.txt +0 -21
- data/Rakefile +0 -10
- data/lib/docuseal/client.rb +0 -25
- data/lib/docuseal/model.rb +0 -87
- data/lib/docuseal/submission.rb +0 -18
- data/lib/docuseal/submitter.rb +0 -9
- data/lib/docuseal/template.rb +0 -29
- data/sig/docuseal.rbs +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df6cd59df11dcce0c5c2197072bbe147fd5547452f9cd8f4843adc70acfd3ab2
|
|
4
|
+
data.tar.gz: 23fe9247d7d9b90c170fdcdd6305cd66c990644674d22cf54cbf437c8444777d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b3ac3d6203f31ec7c954aee6eef92d0d07bbf6c2c4b56dfee31cb93f365c4c17289484d2efd832868051b099eeae0124ca343057da2ba95fc226437a36eec290
|
|
7
|
+
data.tar.gz: d0444f297d866a07be0c104058eda775f05af1c0eb80159b8759390240c33efe1cf4b22d4b815b6f68d1f2dd478390b8512c68efc3a51e98fc025496901f671e
|
data/README.md
CHANGED
|
@@ -1,255 +1,373 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DocuSeal Ruby
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
<img src="https://codecov.io/github/moraki-finance/docuseal/graph/badge.svg?token=SKTT14JJGV"/>
|
|
5
|
-
</a>
|
|
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.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
## Documentation
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
:warning: The extracted API objects don't do input parameters validations. It's a simple faraday wrapper that allows you to send as many inputs as you want. The docuseal API might fail when passing a wrong set of parameters.
|
|
7
|
+
Detailed documentation is available at [DocuSeal API Docs](https://www.docuseal.com/docs/api).
|
|
12
8
|
|
|
13
9
|
## Installation
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
To install the library, run:
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
```sh
|
|
14
|
+
gem install docuseal
|
|
15
|
+
```
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
### Bundler
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
Add the library to your Gemfile for projects using Bundler:
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
gem 'docuseal'
|
|
23
|
+
```
|
|
22
24
|
|
|
23
25
|
## Usage
|
|
24
26
|
|
|
25
|
-
###
|
|
27
|
+
### Configuration
|
|
28
|
+
|
|
29
|
+
Set up the library with your DocuSeal API key based on your deployment. Retrieve your API key from the appropriate location:
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
#### Global Cloud
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
API keys for the global cloud can be obtained from your [Global DocuSeal Console](https://console.docuseal.com/api).
|
|
34
|
+
|
|
35
|
+
```ruby
|
|
36
|
+
require 'docuseal'
|
|
37
|
+
|
|
38
|
+
Docuseal.key = 'your_api_key_here'
|
|
33
39
|
```
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
#### EU Cloud
|
|
42
|
+
|
|
43
|
+
API keys for the EU cloud can be obtained from your [EU DocuSeal Console](https://console.docuseal.eu/api).
|
|
44
|
+
|
|
45
|
+
```ruby
|
|
46
|
+
require 'docuseal'
|
|
36
47
|
|
|
37
|
-
|
|
38
|
-
Docuseal.
|
|
39
|
-
|
|
48
|
+
Docuseal.key = 'your_api_key_here'
|
|
49
|
+
Docuseal.url = 'https://api.docuseal.eu'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### On-Premise
|
|
40
53
|
|
|
41
|
-
|
|
42
|
-
config.request_timeout = 20
|
|
54
|
+
For on-premise installations, API keys can be retrieved from the API settings page of your deployed application, e.g., https://yourdocusealapp.com/settings/api.
|
|
43
55
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
config.global_headers = {
|
|
47
|
-
"Helicone-Auth": "Bearer HELICONE_API_KEY"
|
|
48
|
-
"helicone-stream-force-format" => "true",
|
|
49
|
-
}
|
|
56
|
+
```ruby
|
|
57
|
+
require 'docuseal'
|
|
50
58
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
config.base_uri = "https://api.docuseal.eu/"
|
|
54
|
-
end
|
|
59
|
+
Docuseal.key = 'your_api_key_here'
|
|
60
|
+
Docuseal.url = 'https://yourdocusealapp.com/api'
|
|
55
61
|
```
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
## API Methods
|
|
64
|
+
|
|
65
|
+
### list_submissions(params)
|
|
58
66
|
|
|
59
|
-
|
|
67
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#list-all-submissions)
|
|
60
68
|
|
|
61
|
-
|
|
69
|
+
Provides the ability to retrieve a list of available submissions.
|
|
62
70
|
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
|
|
72
|
+
```ruby
|
|
73
|
+
Docuseal.list_submissions(limit: 10)
|
|
65
74
|
```
|
|
66
75
|
|
|
67
|
-
|
|
76
|
+
### get_submission(id)
|
|
77
|
+
|
|
78
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#get-a-submission)
|
|
68
79
|
|
|
69
|
-
|
|
80
|
+
Provides the functionality to retrieve information about a submission.
|
|
70
81
|
|
|
71
|
-
|
|
72
|
-
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
Docuseal.get_submission(1001)
|
|
73
85
|
```
|
|
74
86
|
|
|
75
|
-
|
|
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
|
-
Reference: https://www.docuseal.co/docs/api#create-a-submission
|
|
78
97
|
|
|
79
|
-
```
|
|
80
|
-
|
|
98
|
+
```ruby
|
|
99
|
+
Docuseal.create_submission({
|
|
81
100
|
template_id: 1000001,
|
|
82
101
|
send_email: true,
|
|
83
|
-
submitters: [
|
|
84
|
-
|
|
102
|
+
submitters: [
|
|
103
|
+
{
|
|
104
|
+
role: "First Party",
|
|
105
|
+
email: "john.doe@example.com"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
})
|
|
85
109
|
```
|
|
86
110
|
|
|
87
|
-
|
|
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.
|
|
88
116
|
|
|
89
|
-
Reference: https://www.docuseal.co/docs/api#create-submissions-from-emails
|
|
90
117
|
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
from: :emails,
|
|
118
|
+
```ruby
|
|
119
|
+
Docuseal.create_submission_from_emails({
|
|
94
120
|
template_id: 1000001,
|
|
95
|
-
emails:
|
|
96
|
-
)
|
|
121
|
+
emails: "hi@docuseal.com, example@docuseal.com"
|
|
122
|
+
})
|
|
97
123
|
```
|
|
98
124
|
|
|
99
|
-
|
|
125
|
+
### archive_submission(id)
|
|
100
126
|
|
|
101
|
-
|
|
127
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#archive-a-submission)
|
|
102
128
|
|
|
103
|
-
|
|
104
|
-
|
|
129
|
+
Allows you to archive a submission.
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
```ruby
|
|
133
|
+
Docuseal.archive_submission(1001)
|
|
105
134
|
```
|
|
106
135
|
|
|
107
|
-
###
|
|
136
|
+
### list_submitters(params)
|
|
108
137
|
|
|
109
|
-
|
|
138
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#list-all-submitters)
|
|
110
139
|
|
|
111
|
-
|
|
140
|
+
Provides the ability to retrieve a list of submitters.
|
|
112
141
|
|
|
113
|
-
|
|
114
|
-
|
|
142
|
+
|
|
143
|
+
```ruby
|
|
144
|
+
Docuseal.list_submitters(limit: 10)
|
|
115
145
|
```
|
|
116
146
|
|
|
117
|
-
|
|
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
|
+
Provides 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)
|
|
118
166
|
|
|
119
|
-
Reference: https://www.docuseal.co/docs/api#get-a-submitter
|
|
120
167
|
|
|
121
|
-
```
|
|
122
|
-
|
|
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
|
+
})
|
|
123
178
|
```
|
|
124
179
|
|
|
125
|
-
|
|
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.
|
|
126
185
|
|
|
127
|
-
Reference: https://www.docuseal.co/docs/api#update-a-submitter
|
|
128
186
|
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
email: 'john.doe@example.com',
|
|
132
|
-
fields: [{name: 'First Name', default_value: 'Acme'}]
|
|
133
|
-
)
|
|
187
|
+
```ruby
|
|
188
|
+
Docuseal.list_templates(limit: 10)
|
|
134
189
|
```
|
|
135
190
|
|
|
136
|
-
###
|
|
191
|
+
### get_template(id)
|
|
137
192
|
|
|
138
|
-
|
|
193
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#get-a-template)
|
|
139
194
|
|
|
140
|
-
|
|
195
|
+
Provides the functionality to retrieve information about a document template.
|
|
141
196
|
|
|
142
|
-
|
|
143
|
-
|
|
197
|
+
|
|
198
|
+
```ruby
|
|
199
|
+
Docuseal.get_template(1000001)
|
|
144
200
|
```
|
|
145
201
|
|
|
146
|
-
|
|
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)
|
|
147
210
|
|
|
148
|
-
Reference: https://www.docuseal.co/docs/api#get-a-template
|
|
149
211
|
|
|
150
|
-
```
|
|
151
|
-
|
|
212
|
+
```ruby
|
|
213
|
+
Docuseal.create_template_from_docx({
|
|
214
|
+
name: "Test DOCX",
|
|
215
|
+
documents: [
|
|
216
|
+
{
|
|
217
|
+
name: "string",
|
|
218
|
+
file: "base64"
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
})
|
|
152
222
|
```
|
|
153
223
|
|
|
154
|
-
|
|
224
|
+
### create_template_from_html(data)
|
|
225
|
+
|
|
226
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#create-a-template-from-html)
|
|
155
227
|
|
|
156
|
-
|
|
228
|
+
Provides the functionality to seamlessly generate a PDF document template by utilizing the provided HTML content while incorporating pre-defined fields.
|
|
157
229
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
+
})
|
|
164
247
|
```
|
|
165
248
|
|
|
166
|
-
|
|
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.
|
|
167
254
|
|
|
168
|
-
Reference: https://www.docuseal.co/docs/api#create-a-template-from-html
|
|
169
255
|
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
256
|
+
```ruby
|
|
257
|
+
Docuseal.merge_templates({
|
|
258
|
+
template_ids: [
|
|
259
|
+
321,
|
|
260
|
+
432
|
|
261
|
+
],
|
|
262
|
+
name: "Merged Template"
|
|
263
|
+
})
|
|
176
264
|
```
|
|
177
265
|
|
|
178
|
-
|
|
266
|
+
### create_template_from_pdf(data)
|
|
179
267
|
|
|
180
|
-
|
|
268
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#create-a-template-from-existing-pdf)
|
|
181
269
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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",
|
|
186
279
|
documents: [
|
|
187
280
|
{
|
|
188
|
-
name:
|
|
189
|
-
file:
|
|
190
|
-
fields: [
|
|
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
|
+
]
|
|
191
297
|
}
|
|
192
298
|
]
|
|
193
|
-
)
|
|
299
|
+
})
|
|
194
300
|
```
|
|
195
301
|
|
|
196
|
-
|
|
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.
|
|
197
307
|
|
|
198
|
-
Reference: https://www.docuseal.co/docs/api#clone-a-template
|
|
199
308
|
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
name:
|
|
203
|
-
)
|
|
309
|
+
```ruby
|
|
310
|
+
Docuseal.clone_template(1000001, {
|
|
311
|
+
name: "Cloned Template"
|
|
312
|
+
})
|
|
204
313
|
```
|
|
205
314
|
|
|
206
|
-
|
|
315
|
+
### update_template(id, data)
|
|
207
316
|
|
|
208
|
-
|
|
317
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#update-a-template)
|
|
209
318
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
+
})
|
|
215
327
|
```
|
|
216
328
|
|
|
217
|
-
|
|
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.
|
|
218
334
|
|
|
219
|
-
Reference: https://www.docuseal.co/docs/api#update-template-documents
|
|
220
335
|
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
documents: [
|
|
224
|
-
|
|
336
|
+
```ruby
|
|
337
|
+
Docuseal.update_template_documents(1000001, {
|
|
338
|
+
documents: [
|
|
339
|
+
{
|
|
340
|
+
file: "string"
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
})
|
|
225
344
|
```
|
|
226
345
|
|
|
227
|
-
|
|
346
|
+
### archive_template(id)
|
|
228
347
|
|
|
229
|
-
|
|
348
|
+
[Documentation](https://www.docuseal.com/docs/api?lang=ruby#archive-a-template)
|
|
230
349
|
|
|
231
|
-
|
|
232
|
-
|
|
350
|
+
Allows you to archive a document template.
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
```ruby
|
|
354
|
+
Docuseal.archive_template(1000001)
|
|
233
355
|
```
|
|
234
356
|
|
|
235
|
-
|
|
357
|
+
### Configuring Timeouts
|
|
236
358
|
|
|
237
|
-
|
|
359
|
+
Set timeouts to avoid hanging requests:
|
|
238
360
|
|
|
239
|
-
```
|
|
240
|
-
|
|
361
|
+
```ruby
|
|
362
|
+
Docuseal.open_timeout = 70
|
|
363
|
+
Docuseal.read_timeout = 90
|
|
241
364
|
```
|
|
242
365
|
|
|
243
|
-
|
|
366
|
+
## Support
|
|
244
367
|
|
|
245
|
-
|
|
368
|
+
For feature requests or bug reports, visit our [GitHub Issues page](https://github.com/docusealco/docuseal-ruby/issues).
|
|
246
369
|
|
|
247
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/moraki-finance/docuseal. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/moraki-finance/docuseal/blob/main/CODE_OF_CONDUCT.md).
|
|
248
370
|
|
|
249
371
|
## License
|
|
250
372
|
|
|
251
373
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
252
|
-
|
|
253
|
-
## Code of Conduct
|
|
254
|
-
|
|
255
|
-
Everyone interacting in the Docuseal project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/docuseal/blob/main/CODE_OF_CONDUCT.md).
|
data/lib/docuseal/api.rb
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Docuseal
|
|
4
|
+
class Api
|
|
5
|
+
Error = Class.new(StandardError)
|
|
6
|
+
|
|
7
|
+
attr_reader :http
|
|
8
|
+
|
|
9
|
+
def initialize(config)
|
|
10
|
+
@http = Http.new(config)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def list_templates(params = {})
|
|
14
|
+
http.get('/templates', params)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def get_template(id, params = {})
|
|
18
|
+
http.get("/templates/#{id}", params)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def create_template_from_docx(data)
|
|
22
|
+
http.post('/templates/docx', data)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def create_template_from_html(data)
|
|
26
|
+
http.post('/templates/html', data)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def create_template_from_pdf(data)
|
|
30
|
+
http.post('/templates/pdf', data)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def merge_templates(data)
|
|
34
|
+
http.post('/templates/merge', data)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def clone_template(id, data)
|
|
38
|
+
http.post("/templates/#{id}/clone", data)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def update_template(id, data)
|
|
42
|
+
http.put("/templates/#{id}", data)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def update_template_documents(id, data)
|
|
46
|
+
http.put("/templates/#{id}/documents", data)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def archive_template(id)
|
|
50
|
+
http.delete("/templates/#{id}")
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def permanently_delete_template(id)
|
|
54
|
+
http.delete("/templates/#{id}", { permanently: true })
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def list_submissions(params = {})
|
|
58
|
+
http.get('/submissions', params)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def get_submission(id, params = {})
|
|
62
|
+
http.get("/submissions/#{id}", params)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def create_submission(data)
|
|
66
|
+
http.post('/submissions/init', data)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def create_submission_from_emails(data)
|
|
70
|
+
http.post('/submissions/emails', data)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def archive_submission(id)
|
|
74
|
+
http.delete("/submissions/#{id}")
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def permanently_delete_submission(id)
|
|
78
|
+
http.delete("/submissions/#{id}", { permanently: true })
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def list_submitters(params = {})
|
|
82
|
+
http.get('/submitters', params)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def get_submitter(id, params = {})
|
|
86
|
+
http.get("/submitters/#{id}", params)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def update_submitter(id, data)
|
|
90
|
+
http.put("/submitters/#{id}", data)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|