API Documentation
API Documentation

Overview

The JotForm API makes it possible to connect to your form data without using the JotForm web site.

The JotForm API is written for JotForm users and 3rd party developers who would like to serve JotForm users. For example, Zapier uses the JotForm API to connect form submission data with other services.

The JotForm API is currently in BETA. We’d love to hear your thoughts. Care to tell us how you would like to use JotForm API? Feel free to email us at api@jotform.com. We'd be happy to help you—we’ll even assign a developer to help you with your task!

Getting Started

To get started using JotForm API you need a valid API key. Obtaining an API key is very simple.

  • 1. Go to My Account
  • 2. Navigate to API Section
  • 3. Create a new API Key

Get started with the JotForm API by using an API library in the language of your choice. See libraries section for a complete list.

Authentication

The JotForm API supports more than one authentication method to simplify the authentication process in different programming languages.

1. Authenticate with Query Parameters

You can send your API Key with your query as a parameter

GET An example call to get user details

    curl -X GET "http://api.jotform.com/user?apiKey={myApiKey}"
    
POST An example call to setup a new webhook

    curl -X POST -d "webhookURL=http://my.webhook.url/connect-to-DB.ext" -d "apiKey={myApiKey}" "http://api.jotform.com/v1/form/{myFormID}/webhooks"

2. Authenticate with HTTP Headers

You can send your API Key with your query as a HTTP header

An example call to get user details by HTTP header

    curl -H "APIKEY: {myApiKey}" "http://api.jotform.com/user"

3. Authenticate with Javascript SDK

You can authenticate users through JotForm by using our Javascript SDK.

1. First, you should call JF.login() to launch a login form within an iFrame pop-up to prompt a user to sign-in. If the user authenticates successfully, (s)he will be asked to allow permissions to access to her account. You can pass callback functions to JF.login for both successful and failed authorizations.

<script src="http://js.jotform.com/JotForm.js"></script>
<script>

    //JF.login(success, error) method takes two optional arguments
    //Both arguments should be function 
    //First argument will be called after successful login
    //Second argument will be called if authorization fails
    JF.login(

        function success(){
            JF.getForms(function(response){
                for(var i=0; i<response.length; i++){
                    document.write( "<li> " + response[i].title);
                }
            });
        },

        function error(){
            window.alert("Could not authorize user");
        }
    ); 
</script> 
                            
2. At this point, we can use the API to perform actions. But, what if we want to be able to store this authentication so that we can use it in the future? To be able to do that, you need to get the user's API key and save it in your servers. In order to obtain API key from SDK, call JF.getAPIKey method.

var apiKey = JF.getAPIKey();
console.log(apiKey); //should log currently used API key
                            


Once you have the API key, you can call JF.initialize({apiKey: "123456789"}) and then call any other API methods. Note that JF.login method will automatically call initialize method after successful login.

JF.initialize( {apiKey: "123456789"} ); 
                            

Libraries

Github Repositories

Android : https://github.com/jotform/jotform-api-android - ZIP or Tarball
C# : https://github.com/jotform/jotform-api-csharp - ZIP or Tarball
GO : https://github.com/jotform/jotform-api-go - ZIP or Tarball
iOS : https://github.com/jotform/jotform-api-ios - ZIP or Tarball
Java : https://github.com/jotform/jotform-api-java - ZIP or Tarball
NodeJS : https://github.com/jotform/jotform-api-nodejs - ZIP or Tarball
PHP : https://github.com/jotform/jotform-api-php - ZIP or Tarball
Python 2.7 : https://github.com/jotform/jotform-api-python - ZIP or Tarball
Ruby : https://github.com/jotform/jotform-api-ruby - ZIP or Tarball
Scala : https://github.com/jotform/jotform-api-scala - ZIP or Tarball


Installation Notes


PHP Client Library

Simply download JotForm.php into your application path and include in your php file as:

include "../JotForm.php";

More info available on repository page at Github.


Python 2.7 Client Library

There is currently no package submitted to PyPi. You need to download and import jotform_api.py as follows.

from jotform_api import JotformAPIClient

More info available on repository page at Github.


Java Client Library

Java client library is not available as a '.jar' file so you have to copy the folder structure of Jotform Java package into your project. Jotform API Java client uses Apache HTTP Client 4.2.5 and org.json packages. So in order to work with the api client you need to add them to your project.

First check out the git repository and add the following files into your src folder as:

/src/com/jotform/api/JotformAPIWrapper.java
/src/com/jotform/api/JotformException.java
/src/com/jotform/api/samples/GetTodaysSubmissions.java
/src/com/jotform/api/samples/PrintFormList.java
/src/org/json/JSONArray.java
/src/org/json/JSONException.java
/src/org/json/JSONObject.java
/src/org/json/JSONString.java
/src/org/json/JSONStringer.java
/src/org/json/JSONTokener.java
/src/org/json/JSONWriter.java

Then copy the contents of the /lib/ folder into your project with the same path.

/lib/commons-logging-1.1.1.jar
/lib/httpclient-4.2.5.jar
/lib/httpcore-4.2.4.jar

Then you will need to add these .jars into your buildpath. If you are using eclipse, you can simply right click on each jar file and click Build Path->Add To Build Path. If the jars are not visible in your project explorer even though you copied them into your lib/ folder, try right clicking on your project in Package Explorer and then clicking refresh.

More information available on repository page at Github.

Javascript Client Library Copy and paste the script below to your page
<script src="http://js.jotform.com/JotForm.js"></script>
                                
NodeJS Client Library
npm install jotform-api-nodejs
                                

Use cases

You can find some use cases in API Use Cases Repository

  • Calculate Survey Result Percentages : Example written with API PHP library to calculate the percentages of star rates/radio buttons in the form submissions.
  • Download your submissions' uploaded files to your computer, implemented with Ruby.
  • Combine Submissions from different forms into one .csv file. Implemented with JavaScript and PHP.
  • Contribution Map : See where submissions come from. Implemented with JavaScript only.
  • JotForm Views : List and display Submissions blended with your imagination. Made so easy. Implemented with JavaScript and PHP.
  • Populate Fields : A script that creates urls to prepopulate your forms with your desired values. Implemented with JavaScript.
  • Answer Comparator : This script compares the current form entries to those that have already been submitted by previous users. Implemented with JavaScript and PHP.
  • Import Submissions : This script imports data from .CSV and Microsoft Excel files and submits them to JotForm via the PHP API. Implemented with JavaScript and PHP.

  • Do you have an use case to share with us? Fork our repository, commit your code and open a pull request!

    Do you want us to implement examples for you? Contact Us and let us know your request!

    FAQ

    What is JotForm API?

    JotForm API allows you to access your JotForm account, forms and form submissions. Writing applications, integrations and scripts with JotForm API is very easy since it is based on REST principles. Code samples are also available on most common languages such as PHP, Java, Python, NodeJS and GO.

    What are the most common uses for JotForm API?

  • Integration with a 3rd party app to process existing form submission data, or to receive submission notifications with webhooks.
  • Mobile frontend apps for JotForm.
  • To Process form submission data to with your own scripts.
  • What is covered in Version 1?

    JotForm API v1 is mostly read only. You can get information about the JotForm user and forms. You can also download existing form data.

    Are there any restrictions?

    API Keys are limited 1000 requests for free accounts and 10000 requets for paid accounts per day. If you need your limits to be increased please contact us.

    Where can I get an API Key?

    You can get your JotForm API Key from API section at My Account.

    Does JotForm API supports JSONP?

    Yes, JotForm API supports JSONP requests. You can simply add "callback" variable with your callback function's name to your API requests.

    Example usage: http://api.jotform.com/user?apiKey={APIKey}&callback=myCallBackFunction

    If you have any further question, please contact API Team.

    Contact API Team