Documentation

Here you will find details usage about Jabwn Form API

Basic Usage


<form action="https://formsapi.jabwn.com/key/<api_key>" method="post">
	<input type="text" name="name">
	<input type="email" name="email">
	<textarea name="message">
	<input type="submit" value="Send">
</form>

Email Subject

Customize your email subject with-

<input type="hidden" name="_subject" value="Your awesome subject">

<form action="https://formsapi.jabwn.com/key/<api_key>" method="post">
	<input type="hidden" name="_subject" value="New form submitted">
	<input type="text" name="name">
	<input type="email" name="email">
	<textarea name="message">
	<input type="submit" value="Send">
</form>

Reply To

You can add a replyto email address. In this example we will use user's email address, so you can reply to the user directly by clicking on the reply button from your email client.

<input type="hidden" name="_replyto" value="%email">

Make sure your email field have a name attribute exactly email if you use %email as a value in this field


<form action="https://formsapi.jabwn.com/key/<api_key>" method="post">
	<input type="hidden" name="_subject" value="New form submitted">
	<input type="hidden" name="_replyto" value="%email">
	<input type="text" name="name">
	<input type="email" name="email">
	<textarea name="message">
	<input type="submit" value="Send">
</form>

Redirection

After successfully submitted the Form, you can redirect users to your website's Thank You page or any other website as you want.

<input type="hidden" name="_after" value="http://yourwebsite.com/thank-you.html">

<form action="https://formsapi.jabwn.com/key/<api_key>" method="post">
	<input type="hidden" name="_subject" value="New form submitted">
	<input type="hidden" name="_replyto" value="%email">
	<input type="hidden" name="_after" value="http://yourwebsite.com/thank-you.html">
	<input type="text" name="name">
	<input type="email" name="email">
	<textarea name="message">
	<input type="submit" value="Send">
</form>

Spam Protection

The honey pot (Spam Protection) field adds an additional spam protection to your forms. Please note that the "value" attribute of this field must remain empty.

<input type="text" name="_honey" value="" style="display:none">

<form action="https://formsapi.jabwn.com/key/<api_key>" method="post">
	<input type="hidden" name="_subject" value="New form submitted">
	<input type="hidden" name="_replyto" value="%email">
	<input type="hidden" name="_after" value="http://yourwebsite.com/thank-you.html">
	<input type="text" name="_honey" value="" style="display:none">
	<input type="text" name="name">
	<input type="email" name="email">
	<textarea name="message">
	<input type="submit" value="Send">
</form>

Confirmation message

This field allows you to specify a confirmation message which is shown to the user after submitting the form.

<input type="hidden" name="_confirmation" value="Thank you! We have received your message and will get back to you asap.">

<form action="https://formsapi.jabwn.com/key/<api_key>" method="post">
	<input type="hidden" name="_subject" value="New form submitted">
	<input type="hidden" name="_replyto" value="%email">
	<input type="hidden" name="_after" value="http://yourwebsite.com/thank-you.html">
	<input type="hidden" name="_confirmation" value="Thank you! We have received your message and will get back to you asap.">
	<input type="text" name="_honey" value="" style="display:none">
	<input type="text" name="name">
	<input type="email" name="email">
	<textarea name="message">
	<input type="submit" value="Send">
</form>

Validation

Simply add a hidden field for each form field you'd like to validate. Add _valid[field_name] as name attribute for the field where you replace "field_name" with the name of the field. See the basic example below:

<input type="hidden" name="_valid[name]" value="required">

<form action="https://formsapi.jabwn.com/key/<api_key>" method="post">
	<input type="hidden" name="_subject" value="New form submitted">
	<input type="hidden" name="_replyto" value="%email">
	<input type="hidden" name="_after" value="http://yourwebsite.com/thank-you.html">
	<input type="hidden" name="_confirmation" value="Thank you! We have received your message and will get back to you asap.">
	<input type="hidden" name="_valid[name]" value="required">
	<input type="hidden" name="_valid[email]" value="required|valid_email">
	<input type="hidden" name="_valid[message]" value="required">
	<input type="text" name="_honey" value="" style="display:none">
	<input type="text" name="name">
	<input type="email" name="email">
	<textarea name="message">
	<input type="submit" value="Send">
</form>

Submitting forms with files

Uploaded files will be sent to your email as an attachment along with the message. Files will not store on our server.


<form enctype="multipart/form-data" action="https://formsapi.jabwn.com/key/<api_key>" method="post">
	<input type="text" name="name">
	<input type="email" name="email">
	<textarea name="message">
	<input type="file" name="file">
	<input type="submit" value="Send">
</form>

Allowed file types: pdf, docx, xlsx, csv, txt, rtf, zip, jpg, jpeg, png, gif
Maximum file size: 2MB

Using Ajax

You can use Jabwn Forms API via Ajax like this:


$.ajax({
	dataType: "json",
    url: "https://formsapi.jabwn.com/key/your_key",
    method: "POST",
    data: {message: "hello!"}
});