templatefox 1.0.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.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +206 -0
  5. data/Rakefile +10 -0
  6. data/docs/AccountApi.md +152 -0
  7. data/docs/AccountInfoResponse.md +20 -0
  8. data/docs/CreatePdfRequest.md +32 -0
  9. data/docs/CreatePdfResponse.md +24 -0
  10. data/docs/ExportType.md +15 -0
  11. data/docs/HTTPValidationError.md +18 -0
  12. data/docs/IntegrationsApi.md +286 -0
  13. data/docs/LocationInner.md +15 -0
  14. data/docs/PDFApi.md +79 -0
  15. data/docs/S3ConfigRequest.md +26 -0
  16. data/docs/S3ConfigResponse.md +28 -0
  17. data/docs/S3SuccessResponse.md +18 -0
  18. data/docs/S3TestResponse.md +20 -0
  19. data/docs/TemplateField.md +26 -0
  20. data/docs/TemplateListItem.md +24 -0
  21. data/docs/TemplatesApi.md +148 -0
  22. data/docs/TemplatesListResponse.md +18 -0
  23. data/docs/Transaction.md +28 -0
  24. data/docs/TransactionsResponse.md +24 -0
  25. data/docs/ValidationError.md +22 -0
  26. data/git_push.sh +57 -0
  27. data/lib/templatefox/api/account_api.rb +154 -0
  28. data/lib/templatefox/api/integrations_api.rb +261 -0
  29. data/lib/templatefox/api/pdf_api.rb +90 -0
  30. data/lib/templatefox/api/templates_api.rb +142 -0
  31. data/lib/templatefox/api_client.rb +397 -0
  32. data/lib/templatefox/api_error.rb +58 -0
  33. data/lib/templatefox/api_model_base.rb +88 -0
  34. data/lib/templatefox/configuration.rb +308 -0
  35. data/lib/templatefox/models/account_info_response.rb +176 -0
  36. data/lib/templatefox/models/create_pdf_request.rb +414 -0
  37. data/lib/templatefox/models/create_pdf_response.rb +247 -0
  38. data/lib/templatefox/models/export_type.rb +40 -0
  39. data/lib/templatefox/models/http_validation_error.rb +149 -0
  40. data/lib/templatefox/models/location_inner.rb +103 -0
  41. data/lib/templatefox/models/s3_config_request.rb +372 -0
  42. data/lib/templatefox/models/s3_config_response.rb +301 -0
  43. data/lib/templatefox/models/s3_success_response.rb +166 -0
  44. data/lib/templatefox/models/s3_test_response.rb +193 -0
  45. data/lib/templatefox/models/template_field.rb +227 -0
  46. data/lib/templatefox/models/template_list_item.rb +247 -0
  47. data/lib/templatefox/models/templates_list_response.rb +167 -0
  48. data/lib/templatefox/models/transaction.rb +267 -0
  49. data/lib/templatefox/models/transactions_response.rb +248 -0
  50. data/lib/templatefox/models/validation_error.rb +218 -0
  51. data/lib/templatefox/version.rb +15 -0
  52. data/lib/templatefox.rb +60 -0
  53. data/spec/api/account_api_spec.rb +59 -0
  54. data/spec/api/integrations_api_spec.rb +80 -0
  55. data/spec/api/pdf_api_spec.rb +47 -0
  56. data/spec/api/templates_api_spec.rb +58 -0
  57. data/spec/models/account_info_response_spec.rb +42 -0
  58. data/spec/models/create_pdf_request_spec.rb +78 -0
  59. data/spec/models/create_pdf_response_spec.rb +54 -0
  60. data/spec/models/export_type_spec.rb +30 -0
  61. data/spec/models/http_validation_error_spec.rb +36 -0
  62. data/spec/models/location_inner_spec.rb +21 -0
  63. data/spec/models/s3_config_request_spec.rb +60 -0
  64. data/spec/models/s3_config_response_spec.rb +66 -0
  65. data/spec/models/s3_success_response_spec.rb +36 -0
  66. data/spec/models/s3_test_response_spec.rb +42 -0
  67. data/spec/models/template_field_spec.rb +60 -0
  68. data/spec/models/template_list_item_spec.rb +54 -0
  69. data/spec/models/templates_list_response_spec.rb +36 -0
  70. data/spec/models/transaction_spec.rb +66 -0
  71. data/spec/models/transactions_response_spec.rb +54 -0
  72. data/spec/models/validation_error_spec.rb +48 -0
  73. data/spec/spec_helper.rb +111 -0
  74. data/templatefox.gemspec +39 -0
  75. metadata +177 -0
@@ -0,0 +1,286 @@
1
+ # TemplateFox::IntegrationsApi
2
+
3
+ All URIs are relative to *https://api.pdftemplateapi.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**delete_s3_config**](IntegrationsApi.md#delete_s3_config) | **DELETE** /v1/integrations/s3 | Delete S3 configuration |
8
+ | [**get_s3_config**](IntegrationsApi.md#get_s3_config) | **GET** /v1/integrations/s3 | Get S3 configuration |
9
+ | [**save_s3_config**](IntegrationsApi.md#save_s3_config) | **POST** /v1/integrations/s3 | Save S3 configuration |
10
+ | [**test_s3_connection**](IntegrationsApi.md#test_s3_connection) | **POST** /v1/integrations/s3/test | Test S3 connection |
11
+
12
+
13
+ ## delete_s3_config
14
+
15
+ > <S3SuccessResponse> delete_s3_config
16
+
17
+ Delete S3 configuration
18
+
19
+ Delete S3 storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Remove your S3 integration. Generated PDFs will use the default CDN storage after deletion. **Warning:** This action is irreversible. You'll need to reconfigure S3 to use it again. **No credits consumed:** This is a configuration endpoint.
20
+
21
+ ### Examples
22
+
23
+ ```ruby
24
+ require 'time'
25
+ require 'templatefox'
26
+ # setup authorization
27
+ TemplateFox.configure do |config|
28
+ # Configure API key authorization: ApiKeyAuth
29
+ config.api_key['x-api-key'] = 'YOUR API KEY'
30
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
31
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
32
+ end
33
+
34
+ api_instance = TemplateFox::IntegrationsApi.new
35
+
36
+ begin
37
+ # Delete S3 configuration
38
+ result = api_instance.delete_s3_config
39
+ p result
40
+ rescue TemplateFox::ApiError => e
41
+ puts "Error when calling IntegrationsApi->delete_s3_config: #{e}"
42
+ end
43
+ ```
44
+
45
+ #### Using the delete_s3_config_with_http_info variant
46
+
47
+ This returns an Array which contains the response data, status code and headers.
48
+
49
+ > <Array(<S3SuccessResponse>, Integer, Hash)> delete_s3_config_with_http_info
50
+
51
+ ```ruby
52
+ begin
53
+ # Delete S3 configuration
54
+ data, status_code, headers = api_instance.delete_s3_config_with_http_info
55
+ p status_code # => 2xx
56
+ p headers # => { ... }
57
+ p data # => <S3SuccessResponse>
58
+ rescue TemplateFox::ApiError => e
59
+ puts "Error when calling IntegrationsApi->delete_s3_config_with_http_info: #{e}"
60
+ end
61
+ ```
62
+
63
+ ### Parameters
64
+
65
+ This endpoint does not need any parameter.
66
+
67
+ ### Return type
68
+
69
+ [**S3SuccessResponse**](S3SuccessResponse.md)
70
+
71
+ ### Authorization
72
+
73
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
74
+
75
+ ### HTTP request headers
76
+
77
+ - **Content-Type**: Not defined
78
+ - **Accept**: application/json
79
+
80
+
81
+ ## get_s3_config
82
+
83
+ > <S3ConfigResponse> get_s3_config
84
+
85
+ Get S3 configuration
86
+
87
+ Get current S3 storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Retrieve your S3 integration settings. Secret access key is masked for security. **Returns 404** if S3 is not configured. **No credits consumed:** This is a read-only endpoint.
88
+
89
+ ### Examples
90
+
91
+ ```ruby
92
+ require 'time'
93
+ require 'templatefox'
94
+ # setup authorization
95
+ TemplateFox.configure do |config|
96
+ # Configure API key authorization: ApiKeyAuth
97
+ config.api_key['x-api-key'] = 'YOUR API KEY'
98
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
99
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
100
+ end
101
+
102
+ api_instance = TemplateFox::IntegrationsApi.new
103
+
104
+ begin
105
+ # Get S3 configuration
106
+ result = api_instance.get_s3_config
107
+ p result
108
+ rescue TemplateFox::ApiError => e
109
+ puts "Error when calling IntegrationsApi->get_s3_config: #{e}"
110
+ end
111
+ ```
112
+
113
+ #### Using the get_s3_config_with_http_info variant
114
+
115
+ This returns an Array which contains the response data, status code and headers.
116
+
117
+ > <Array(<S3ConfigResponse>, Integer, Hash)> get_s3_config_with_http_info
118
+
119
+ ```ruby
120
+ begin
121
+ # Get S3 configuration
122
+ data, status_code, headers = api_instance.get_s3_config_with_http_info
123
+ p status_code # => 2xx
124
+ p headers # => { ... }
125
+ p data # => <S3ConfigResponse>
126
+ rescue TemplateFox::ApiError => e
127
+ puts "Error when calling IntegrationsApi->get_s3_config_with_http_info: #{e}"
128
+ end
129
+ ```
130
+
131
+ ### Parameters
132
+
133
+ This endpoint does not need any parameter.
134
+
135
+ ### Return type
136
+
137
+ [**S3ConfigResponse**](S3ConfigResponse.md)
138
+
139
+ ### Authorization
140
+
141
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
142
+
143
+ ### HTTP request headers
144
+
145
+ - **Content-Type**: Not defined
146
+ - **Accept**: application/json
147
+
148
+
149
+ ## save_s3_config
150
+
151
+ > <S3SuccessResponse> save_s3_config(s3_config_request)
152
+
153
+ Save S3 configuration
154
+
155
+ Save or update S3-compatible storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Configure your S3-compatible storage to receive generated PDFs directly in your own bucket instead of the default CDN. **Supported providers:** - Amazon S3 - DigitalOcean Spaces - Cloudflare R2 - MinIO - Any S3-compatible storage **Secret key behavior:** - For new configuration: `secret_access_key` is required - For updates: Omit `secret_access_key` to keep existing value **No credits consumed:** This is a configuration endpoint.
156
+
157
+ ### Examples
158
+
159
+ ```ruby
160
+ require 'time'
161
+ require 'templatefox'
162
+ # setup authorization
163
+ TemplateFox.configure do |config|
164
+ # Configure API key authorization: ApiKeyAuth
165
+ config.api_key['x-api-key'] = 'YOUR API KEY'
166
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
167
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
168
+ end
169
+
170
+ api_instance = TemplateFox::IntegrationsApi.new
171
+ s3_config_request = TemplateFox::S3ConfigRequest.new({endpoint_url: 'endpoint_url_example', access_key_id: 'access_key_id_example', bucket_name: 'bucket_name_example'}) # S3ConfigRequest |
172
+
173
+ begin
174
+ # Save S3 configuration
175
+ result = api_instance.save_s3_config(s3_config_request)
176
+ p result
177
+ rescue TemplateFox::ApiError => e
178
+ puts "Error when calling IntegrationsApi->save_s3_config: #{e}"
179
+ end
180
+ ```
181
+
182
+ #### Using the save_s3_config_with_http_info variant
183
+
184
+ This returns an Array which contains the response data, status code and headers.
185
+
186
+ > <Array(<S3SuccessResponse>, Integer, Hash)> save_s3_config_with_http_info(s3_config_request)
187
+
188
+ ```ruby
189
+ begin
190
+ # Save S3 configuration
191
+ data, status_code, headers = api_instance.save_s3_config_with_http_info(s3_config_request)
192
+ p status_code # => 2xx
193
+ p headers # => { ... }
194
+ p data # => <S3SuccessResponse>
195
+ rescue TemplateFox::ApiError => e
196
+ puts "Error when calling IntegrationsApi->save_s3_config_with_http_info: #{e}"
197
+ end
198
+ ```
199
+
200
+ ### Parameters
201
+
202
+ | Name | Type | Description | Notes |
203
+ | ---- | ---- | ----------- | ----- |
204
+ | **s3_config_request** | [**S3ConfigRequest**](S3ConfigRequest.md) | | |
205
+
206
+ ### Return type
207
+
208
+ [**S3SuccessResponse**](S3SuccessResponse.md)
209
+
210
+ ### Authorization
211
+
212
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
213
+
214
+ ### HTTP request headers
215
+
216
+ - **Content-Type**: application/json
217
+ - **Accept**: application/json
218
+
219
+
220
+ ## test_s3_connection
221
+
222
+ > <S3TestResponse> test_s3_connection
223
+
224
+ Test S3 connection
225
+
226
+ Test S3 connection with stored credentials. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Verify your S3 configuration is working correctly. The test will: 1. Connect to the endpoint 2. Verify bucket access 3. Check write permissions by uploading a small test file **Prerequisite:** S3 must be configured first using `POST /v1/integrations/s3` **No credits consumed:** This is a diagnostic endpoint.
227
+
228
+ ### Examples
229
+
230
+ ```ruby
231
+ require 'time'
232
+ require 'templatefox'
233
+ # setup authorization
234
+ TemplateFox.configure do |config|
235
+ # Configure API key authorization: ApiKeyAuth
236
+ config.api_key['x-api-key'] = 'YOUR API KEY'
237
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
238
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
239
+ end
240
+
241
+ api_instance = TemplateFox::IntegrationsApi.new
242
+
243
+ begin
244
+ # Test S3 connection
245
+ result = api_instance.test_s3_connection
246
+ p result
247
+ rescue TemplateFox::ApiError => e
248
+ puts "Error when calling IntegrationsApi->test_s3_connection: #{e}"
249
+ end
250
+ ```
251
+
252
+ #### Using the test_s3_connection_with_http_info variant
253
+
254
+ This returns an Array which contains the response data, status code and headers.
255
+
256
+ > <Array(<S3TestResponse>, Integer, Hash)> test_s3_connection_with_http_info
257
+
258
+ ```ruby
259
+ begin
260
+ # Test S3 connection
261
+ data, status_code, headers = api_instance.test_s3_connection_with_http_info
262
+ p status_code # => 2xx
263
+ p headers # => { ... }
264
+ p data # => <S3TestResponse>
265
+ rescue TemplateFox::ApiError => e
266
+ puts "Error when calling IntegrationsApi->test_s3_connection_with_http_info: #{e}"
267
+ end
268
+ ```
269
+
270
+ ### Parameters
271
+
272
+ This endpoint does not need any parameter.
273
+
274
+ ### Return type
275
+
276
+ [**S3TestResponse**](S3TestResponse.md)
277
+
278
+ ### Authorization
279
+
280
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
281
+
282
+ ### HTTP request headers
283
+
284
+ - **Content-Type**: Not defined
285
+ - **Accept**: application/json
286
+
@@ -0,0 +1,15 @@
1
+ # TemplateFox::LocationInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'templatefox'
12
+
13
+ instance = TemplateFox::LocationInner.new()
14
+ ```
15
+
data/docs/PDFApi.md ADDED
@@ -0,0 +1,79 @@
1
+ # TemplateFox::PDFApi
2
+
3
+ All URIs are relative to *https://api.pdftemplateapi.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**create_pdf**](PDFApi.md#create_pdf) | **POST** /v1/pdf/create | Generate PDF from template |
8
+
9
+
10
+ ## create_pdf
11
+
12
+ > <CreatePdfResponse> create_pdf(create_pdf_request)
13
+
14
+ Generate PDF from template
15
+
16
+ Generate a PDF from a saved template with dynamic data. **Authentication:** API Key required (`x-api-key` header) ## Request Body | Field | Type | Required | Description | |-------|------|----------|-------------| | `template_id` | string | ✅ Yes | Template short ID (12 characters) | | `data` | object | ✅ Yes | Key-value data to render in template | | `export_type` | string | No | `url` (default) or `binary` | | `expiration` | integer | No | URL expiration in seconds (60-604800, default: 86400) | ## Export Types - `url` (default): PDF is uploaded to CDN, returns JSON with URL - `binary`: Returns raw PDF bytes directly **Credits:** 1 credit deducted per successful generation.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'templatefox'
23
+ # setup authorization
24
+ TemplateFox.configure do |config|
25
+ # Configure API key authorization: ApiKeyAuth
26
+ config.api_key['x-api-key'] = 'YOUR API KEY'
27
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
28
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
29
+ end
30
+
31
+ api_instance = TemplateFox::PDFApi.new
32
+ create_pdf_request = TemplateFox::CreatePdfRequest.new({template_id: 'template_id_example', data: { key: 3.56}}) # CreatePdfRequest |
33
+
34
+ begin
35
+ # Generate PDF from template
36
+ result = api_instance.create_pdf(create_pdf_request)
37
+ p result
38
+ rescue TemplateFox::ApiError => e
39
+ puts "Error when calling PDFApi->create_pdf: #{e}"
40
+ end
41
+ ```
42
+
43
+ #### Using the create_pdf_with_http_info variant
44
+
45
+ This returns an Array which contains the response data, status code and headers.
46
+
47
+ > <Array(<CreatePdfResponse>, Integer, Hash)> create_pdf_with_http_info(create_pdf_request)
48
+
49
+ ```ruby
50
+ begin
51
+ # Generate PDF from template
52
+ data, status_code, headers = api_instance.create_pdf_with_http_info(create_pdf_request)
53
+ p status_code # => 2xx
54
+ p headers # => { ... }
55
+ p data # => <CreatePdfResponse>
56
+ rescue TemplateFox::ApiError => e
57
+ puts "Error when calling PDFApi->create_pdf_with_http_info: #{e}"
58
+ end
59
+ ```
60
+
61
+ ### Parameters
62
+
63
+ | Name | Type | Description | Notes |
64
+ | ---- | ---- | ----------- | ----- |
65
+ | **create_pdf_request** | [**CreatePdfRequest**](CreatePdfRequest.md) | | |
66
+
67
+ ### Return type
68
+
69
+ [**CreatePdfResponse**](CreatePdfResponse.md)
70
+
71
+ ### Authorization
72
+
73
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
74
+
75
+ ### HTTP request headers
76
+
77
+ - **Content-Type**: application/json
78
+ - **Accept**: application/json, application/pdf
79
+
@@ -0,0 +1,26 @@
1
+ # TemplateFox::S3ConfigRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **endpoint_url** | **String** | S3-compatible endpoint URL. Must start with https:// | |
8
+ | **access_key_id** | **String** | Access key ID for S3 authentication | |
9
+ | **secret_access_key** | **String** | | [optional] |
10
+ | **bucket_name** | **String** | S3 bucket name. Must follow S3 naming conventions (lowercase, no underscores) | |
11
+ | **default_prefix** | **String** | Default path prefix for uploaded files. Can include slashes for folder structure | [optional][default to &#39;&#39;] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'templatefox'
17
+
18
+ instance = TemplateFox::S3ConfigRequest.new(
19
+ endpoint_url: null,
20
+ access_key_id: null,
21
+ secret_access_key: null,
22
+ bucket_name: null,
23
+ default_prefix: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,28 @@
1
+ # TemplateFox::S3ConfigResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **configured** | **Boolean** | Whether S3 is configured | |
8
+ | **endpoint_url** | **String** | S3-compatible endpoint URL | |
9
+ | **access_key_id** | **String** | Access key ID | |
10
+ | **secret_access_key_masked** | **String** | Masked secret access key (shows first 4 and last 4 characters) | |
11
+ | **bucket_name** | **String** | S3 bucket name | |
12
+ | **default_prefix** | **String** | Default path prefix for uploads | |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'templatefox'
18
+
19
+ instance = TemplateFox::S3ConfigResponse.new(
20
+ configured: null,
21
+ endpoint_url: null,
22
+ access_key_id: null,
23
+ secret_access_key_masked: null,
24
+ bucket_name: null,
25
+ default_prefix: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,18 @@
1
+ # TemplateFox::S3SuccessResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **success** | **Boolean** | Whether the operation succeeded | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'templatefox'
13
+
14
+ instance = TemplateFox::S3SuccessResponse.new(
15
+ success: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,20 @@
1
+ # TemplateFox::S3TestResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **success** | **Boolean** | Whether the connection test succeeded | |
8
+ | **message** | **String** | Test result message | |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'templatefox'
14
+
15
+ instance = TemplateFox::S3TestResponse.new(
16
+ success: null,
17
+ message: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,26 @@
1
+ # TemplateFox::TemplateField
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **key** | **String** | Field key/identifier | |
8
+ | **label** | **String** | Human-readable label | |
9
+ | **type** | **String** | Field type: string, integer, number, boolean | [optional][default to &#39;string&#39;] |
10
+ | **required** | **Boolean** | Whether the field is required | [optional][default to false] |
11
+ | **help_text** | **String** | | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'templatefox'
17
+
18
+ instance = TemplateFox::TemplateField.new(
19
+ key: null,
20
+ label: null,
21
+ type: null,
22
+ required: null,
23
+ help_text: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,24 @@
1
+ # TemplateFox::TemplateListItem
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | Template short ID (12 characters) | |
8
+ | **name** | **String** | Template name | |
9
+ | **created_at** | **String** | ISO 8601 timestamp | |
10
+ | **updated_at** | **String** | ISO 8601 timestamp | |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'templatefox'
16
+
17
+ instance = TemplateFox::TemplateListItem.new(
18
+ id: null,
19
+ name: null,
20
+ created_at: null,
21
+ updated_at: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,148 @@
1
+ # TemplateFox::TemplatesApi
2
+
3
+ All URIs are relative to *https://api.pdftemplateapi.com*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**get_template_fields**](TemplatesApi.md#get_template_fields) | **GET** /v1/templates/{template_id}/fields | Get template fields |
8
+ | [**list_templates**](TemplatesApi.md#list_templates) | **GET** /v1/templates | List templates |
9
+
10
+
11
+ ## get_template_fields
12
+
13
+ > <Array<TemplateField>> get_template_fields(template_id)
14
+
15
+ Get template fields
16
+
17
+ Get the dynamic fields for a template. **Authentication:** API Key required (`x-api-key` header) or JWT token **Usage:** This endpoint is designed for Zapier Dynamic Fields integration. It returns an array of field definitions that Zapier uses to dynamically generate input forms. **Response format:** Array of objects compatible with Zapier InputFieldsSchema. Each field has: `key`, `label`, `type`, `required`, and optional `helpText`. **Field types:** - `string`: Text input (also used for JSON arrays/objects) - `integer`: Integer number - `number`: Decimal number - `boolean`: True/False checkbox **Arrays and objects:** Complex types are returned as `string` type with a `helpText` showing the expected JSON format. **No credits consumed:** This is a read-only endpoint.
18
+
19
+ ### Examples
20
+
21
+ ```ruby
22
+ require 'time'
23
+ require 'templatefox'
24
+ # setup authorization
25
+ TemplateFox.configure do |config|
26
+ # Configure API key authorization: ApiKeyAuth
27
+ config.api_key['x-api-key'] = 'YOUR API KEY'
28
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
29
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
30
+ end
31
+
32
+ api_instance = TemplateFox::TemplatesApi.new
33
+ template_id = 'template_id_example' # String |
34
+
35
+ begin
36
+ # Get template fields
37
+ result = api_instance.get_template_fields(template_id)
38
+ p result
39
+ rescue TemplateFox::ApiError => e
40
+ puts "Error when calling TemplatesApi->get_template_fields: #{e}"
41
+ end
42
+ ```
43
+
44
+ #### Using the get_template_fields_with_http_info variant
45
+
46
+ This returns an Array which contains the response data, status code and headers.
47
+
48
+ > <Array(<Array<TemplateField>>, Integer, Hash)> get_template_fields_with_http_info(template_id)
49
+
50
+ ```ruby
51
+ begin
52
+ # Get template fields
53
+ data, status_code, headers = api_instance.get_template_fields_with_http_info(template_id)
54
+ p status_code # => 2xx
55
+ p headers # => { ... }
56
+ p data # => <Array<TemplateField>>
57
+ rescue TemplateFox::ApiError => e
58
+ puts "Error when calling TemplatesApi->get_template_fields_with_http_info: #{e}"
59
+ end
60
+ ```
61
+
62
+ ### Parameters
63
+
64
+ | Name | Type | Description | Notes |
65
+ | ---- | ---- | ----------- | ----- |
66
+ | **template_id** | **String** | | |
67
+
68
+ ### Return type
69
+
70
+ [**Array&lt;TemplateField&gt;**](TemplateField.md)
71
+
72
+ ### Authorization
73
+
74
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
75
+
76
+ ### HTTP request headers
77
+
78
+ - **Content-Type**: Not defined
79
+ - **Accept**: application/json
80
+
81
+
82
+ ## list_templates
83
+
84
+ > <TemplatesListResponse> list_templates
85
+
86
+ List templates
87
+
88
+ List all templates for the authenticated user. **Authentication:** API Key required (`x-api-key` header) or JWT token **Usage:** This endpoint is designed for no-code tools (Zapier, Make, n8n) to populate template selection dropdowns. **No credits consumed:** This is a read-only endpoint.
89
+
90
+ ### Examples
91
+
92
+ ```ruby
93
+ require 'time'
94
+ require 'templatefox'
95
+ # setup authorization
96
+ TemplateFox.configure do |config|
97
+ # Configure API key authorization: ApiKeyAuth
98
+ config.api_key['x-api-key'] = 'YOUR API KEY'
99
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
100
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
101
+ end
102
+
103
+ api_instance = TemplateFox::TemplatesApi.new
104
+
105
+ begin
106
+ # List templates
107
+ result = api_instance.list_templates
108
+ p result
109
+ rescue TemplateFox::ApiError => e
110
+ puts "Error when calling TemplatesApi->list_templates: #{e}"
111
+ end
112
+ ```
113
+
114
+ #### Using the list_templates_with_http_info variant
115
+
116
+ This returns an Array which contains the response data, status code and headers.
117
+
118
+ > <Array(<TemplatesListResponse>, Integer, Hash)> list_templates_with_http_info
119
+
120
+ ```ruby
121
+ begin
122
+ # List templates
123
+ data, status_code, headers = api_instance.list_templates_with_http_info
124
+ p status_code # => 2xx
125
+ p headers # => { ... }
126
+ p data # => <TemplatesListResponse>
127
+ rescue TemplateFox::ApiError => e
128
+ puts "Error when calling TemplatesApi->list_templates_with_http_info: #{e}"
129
+ end
130
+ ```
131
+
132
+ ### Parameters
133
+
134
+ This endpoint does not need any parameter.
135
+
136
+ ### Return type
137
+
138
+ [**TemplatesListResponse**](TemplatesListResponse.md)
139
+
140
+ ### Authorization
141
+
142
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
143
+
144
+ ### HTTP request headers
145
+
146
+ - **Content-Type**: Not defined
147
+ - **Accept**: application/json
148
+
@@ -0,0 +1,18 @@
1
+ # TemplateFox::TemplatesListResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **templates** | [**Array&lt;TemplateListItem&gt;**](TemplateListItem.md) | | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'templatefox'
13
+
14
+ instance = TemplateFox::TemplatesListResponse.new(
15
+ templates: null
16
+ )
17
+ ```
18
+