Use the following API endpoints to configure advanced settings of your online forms via the API Console.

The ID of a form is the alphanumeric string in its FormSmarts.com URL. For example, if a form's URL is https://formsmarts.com/form/xyz, its Form ID is xyz.

Notification Email Subject Line

To retrieve the current email subject line for a from, insert the form's ID into the URL and submit a GET request:

API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/email_subject
HTTP Method
GET

To customize the subject line of the notification email, insert the form's ID into the URL and submit a PUT request:

API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/email_subject
HTTP Method
PUT
ParameterDescriptionNotes
template The email subject template. May contain placeholders $form_name, $form_id, $fs_ref_num, $1, $2,… $n. Required

Submit a DELETE request to cancel the customized email subject line and revert to the default one.

API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/email_subject
HTTP Method
DELETE

Buttons Color

To check the current color of the buttons of a from, insert the form's ID into the URL and submit a GET request:

API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/button_color
HTTP Method
GET

To customize the color of buttons for a form, insert the form's ID into the URL and submit a PUT request:

API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/button_color
HTTP Method
PUT
ParameterDescriptionNotes
button_color The lowercase 6-character hexadecimal code of the color, e.g. ff8215. Required. To revert to the default button color, enter an empty color code.

Input Fields

To get a list of the input fields of an online form in the order they appear on the form, insert the ID of the form into the URL (API endpoint) and submit a GET request:

API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/fields
HTTP Method
GET

Form Prefill

To get the prefill settings a form, insert the form's ID into the URL and submit a GET request:

API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/prefill
HTTP Method
GET

To allow or prohibit prepopulated forms that are not signed, insert the form's ID into the URL and submit a PUT request:

API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/prefill
HTTP Method
PUT
ParameterDescriptionNotes
allow_unsigned yes (allowed) or no (prohibited) Required. Unsigned form prefill is not allowed by default.

Discount Codes

The Discount Code API allows you to manage the discount codes associated with one of your payment forms. This video shows how to use the API.

To list the discount codes associated with an online payment form, insert the ID of the form into the URL (API endpoint) and submit a GET request:

API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/discounts
HTTP Method
GET

To create a discount code and associate it with a payment form, insert the form's ID into the URL and submit a POST request:

API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/discounts
HTTP Method
POST
ParameterDescriptionNotes
code The discount code, for example: FSCP-FALL-REG-AG73PB. Discount codes must start with FSCP- (FSCP stands for FormSmarts CouPon). Required
amount The amount of the discount, for example: 15.65. Required
code_field_name The name of the input field where users are to enter the discount code on the payment form, for example: Discount Code. This is used to identify the input field on the form, so the value submitted must be exactly the same as the field question on the form. If code_field_name is not specified, the discount code can only be used by passing it to the fs_ctxval parameter of the form's URL. Optional

To delete one or all discount codes associated with a payment form:

  1. Insert the ID of the form into the API endpoint
  2. Pass the discount code to delete to the code URL parameter, i.e. code=FSPI-The-Discount-Code
  3. Submit a DELETE request
API Endpoint
https://formsmarts.com/api/v1/forms/Form_ID/discounts?code=FSPI-The-Discount-Code
HTTP Method
DELETE
ParameterDescriptionNotes
code The discount code to delete, for example: FSPI-The-Discount-Code.

If the code parameter is omitted, all discount codes associated with the form will be deleted.

Optional

Webhooks

The API to register a webhook URL, update it and cancel a webhook is discussed in the webhooks documentation.

Errors

Error 400 - Bad Request

Your request was not processed because some parameters are missing or invalid. Check the documentation for the resource you are trying to access.

Error 401 - Authentication Failed

You're not signed in to FormSmarts or are using an incorrect FormSmarts account number and API key to authenticate the request.

Error 403 - Forbidden

You are trying to access a resource which is not yours. You're probably signed in to the wrong FormSmarts account or are using the wrong FormSmarts account number and API key to authenticate the request.

Error 404 - Resource Not Found

No resource was found at this URL (endpoint) you specified.

Error 405 - Method Not Allowed

The HTTP request method (POST, GET, PUT or DELETE) you're using to access a resource is not supported by this resource. For example, you might be trying to create (POST) a resource that can only be modified (PUT).

Error 500 - Internal Server Error

There is a problem with our systems. If the issue persists, please let us know.