Skip to main content
getForm and submitForm do not require API credentials. The form management methods require an API key with the forms scope (see Manage forms). Forms are identified by a UUID that you obtain from the Paubox dashboard.

Instantiation

Get a form

Retrieve a form’s metadata, field schema, and rendered HTML/CSS:
The response is a raw JSON string. Decode it to access fields:
Key fields in the response: getForm dies if the form UUID is invalid or the form is not found.

Submit a form

submitForm dies if the form ID or form data is invalid, or if the response has an errors key. Other API errors are returned rather than thrown: $result holds the error body, such as {"message":"Attachment content is not valid base64"}. Treat any non-empty $result as a failed submission.

Submitting with file attachments

The maximum total request size is 250 MB.
Each attachment in the arrayref is a hashref with two keys: Pass '' as the second argument to encode_base64. By default it adds a line break every 76 characters, and the API rejects base64 that contains line breaks.

Manage forms

These methods need a forms-scoped API key, sent as Authorization: Bearer YOUR_API_KEY. Create the client with Paubox_Forms_SDK->new('apiKey' => 'YOUR_API_KEY'), or set FORMS_API_KEY in config.cfg. Without a key they die. Call them as methods on the object.

Error handling

Wrap calls in eval to catch the errors that die, and check submitForm’s return value for the ones it returns: