Instantiation
Get a form
Retrieve a form’s metadata, field schema, and rendered HTML/CSS:Paubox::Form object exposes:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Retrieve Paubox Form schemas and submit form responses using the Ruby SDK.
require 'paubox'
forms_client = Paubox::FormsClient.new
form = forms_client.get_form('your-form-uuid')
puts form.title
puts form.form_html
Paubox::Form object exposes:
| Method / Attribute | Description |
|---|---|
#title | Display name of the form |
#form_json | Parsed field schema |
#form_html | Rendered HTML for embedding |
#form_css | Associated stylesheet |
#active? | Whether the form is accepting submissions |
#submission_count | Number of submissions received |
#signable? | Whether the form supports e-signatures |
#deleted? / #archived? | Form state flags |
form_data = {
first_name: 'Jane',
last_name: 'Smith',
email: 'jane@example.com'
}
response = forms_client.submit_form('your-form-uuid', form_data: form_data)
# response is 201 Created on success
require 'base64'
encoded = Base64.strict_encode64(File.read('consent.pdf'))
attachments = [
{ name: 'consent.pdf', content: encoded }
]
response = forms_client.submit_form(
'your-form-uuid',
form_data: form_data,
attachments: attachments
)
require 'rest-client'
begin
form = forms_client.get_form('your-form-uuid')
response = forms_client.submit_form('your-form-uuid', form_data: form_data)
rescue RestClient::ExceptionWithResponse => e
puts "HTTP #{e.response.code}: #{e.response.body}"
end