API (for developers)

Use our API to submit Hush Secure Forms from within your software applications. You can use the API by sending HTTP POST requests to the web address of your form (for example, https://forms.hush.com/timmy).

Requests

All requests must be sent by HTTP POST to the web address of your form. You can see your web address by signing in to the control panel.

Request parameters

All requests must have at least one parameter, format=json. This tells Hush Secure Forms to send its response in JSON format after handling your form.

In addition to the format parameter, include the form data you would like included in the encrypted email you receive in your Hushmail Inbox, as well as the optional parameters described below:

Parameter Description
hush_subject Specify the subject of the email
hush_sender Specify the sender of the email, and who will receive the automatic response if one is configured

Sample request

URL: https://forms.hush.com/timmy
Request method: HTTP POST
Request parameters:format=json&hush_sender=wendy@example.com&hush_subject=Hello%20World!&FirstName=Wendy&LastName=Smith&PhoneNumber=604-555-2219


Responses

All responses will be returned with a Content-type of application/json. An appropriate HTTP response code will be returned with each response, and the body of the response will contain a JSON-formatted string containing more information about the result of your request.

All JSON responses contain a field named result. A result of OK indicates success, anything else indicates a failed request.

Success responses

If your request was successful, the response will be sent with the HTTP response code 200.

HTTP response code JSON result field Description Additional JSON fields Sample response
200 OK The request was successful next: The "thank-you" page the user would have been taken to had this not been an API request {"result":"OK",
"next":"http://google.ca/"}

Error responses

If your request resulted in an error, the response will be sent with the HTTP response code 400, 403, 405 or 500.

HTTP response code JSON result field Description Additional JSON fields Sample response
400 NO_SUCH_FORM The requested Hush Secure Form URL doesn't exist message: A message with more information. {"message":"No such form: timmy",
"result":"NO_SUCH_FORM"}
400 NO_SUBSCRIPTION The requested Hush Secure Form URL doesn't belong to a user with an active account message: A message with more information. {"message":"No subscription for one or more of: timmy",
"result":"NO_SUBSCRIPTION"}
403 HTTPS_REQUIRED You did not submit your request using HTTPS
405 HTTP_METHOD_NOT_ALLOWED You did not submit your request using HTTP POST
500 UNKNOWN_ERROR An error occurred on our end message: A message with more information.
Note: May contain other fields containing debug information.
{"message":"Unexpected error"}