# Jotform API Libraries | Jotform Developers

*   [Android](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-android)
*   [C#](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-csharp)
*   [GO](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-go)
*   [iOS](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-ios)
*   [Java](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-java)
*   [Javascript](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-javascript)
*   [NodeJS](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-nodejs)
*   [PHP](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-php)
*   [Python](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-python)
*   [Ruby](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-ruby)
*   [Scala](https://www.jotform.com/developers/libraries/?jfNext=1#jotform-api-scala)

[Github](https://github.com/jotform/jotform-api-android)[Download](https://github.com/jotform/jotform-api-android/archive/master.zip)

## Updates

#####28.10.2016 - EU Server API Support Intagrated If your user is in eu protected mode, now you can use JotForm EU Server API

## Installation

*   Download the zipped project from downloads page or clone the git repository to your computer.
*   Once you have the project folder in your system, launch Eclipse, click File -> Import.
*   Select "Existing Android Code Into Workspace", browse to the project folder and click finish.
*   Right click on you own android project (the one that you want to use the library with) and click properties.
*   Click "Android" tab and add "jotform-api-android" project using the Add button in the Library section.

## Sample Usage

Once you successfully added the library as a dependency to your project, you can use it in your Application as follows;

Examples

Print all forms of the user

1.   package com.example;

3.   import android.app.Activity;

5.   // import Jotform client library

6.   // and its reponse handler

7.   import com.jotform.api.JotformAPIClient;

8.   import com.loopj.android.http.JsonHttpResponseHandler;

10.   public class MyActivity extends Avtivity{

11.     

12.     private JotformAPIClient apiClient;

13.     

14.     @Override

15.     protected void onCreate(Bundle savedInstanceState) {

16.      super.onCreate(savedInstanceState);

17.       

18.       // this is for demonstration purposes only

19.       // you should not harcode API Keys, it is different for each user

20.       apiClient = new JotformAPIClient("API_KEY_GOES_HERE");

21.       

22.       apiClient.getForms(new JsonHttpHandler(){

23.       

24.         @Override

25.         public void onSuccess(JSONObject formsResponse){

26.           try {

27.             forms = formsResponse.getJSONArray("content");

28.             

29.             // do something with the forms jsonArray;

30.             

31.           } catch (JSONException e){

32.             // fail

33.           }

34.           

35.         }

36.       });

37.     }

38.   }

Get latest 100 submissions ordered by creation date

1.   public class MyActivity extends Avtivity{

3.   private JotformAPIClient apiClient;

5.   @Override

6.   protected void onCreate(Bundle savedInstanceState) {

7.    super.onCreate(savedInstanceState);

8.     

9.     // this is for demonstration purposes only

10.     // you should not harcode API Keys, it is different for each user

11.     apiClient = new JotformAPIClient("API_KEY_GOES_HERE");

12.     

13.     apiClient.getSubmissions(100, null, new JsonHttpHandler(){

14.     

15.       @Override

16.       public void onSuccess(JSONObject submissionsResponse){

17.         try {

18.           submissions = submissionsResponse.getJSONArray("content");

19.           

20.           // do something with the submissions jsonArray;

21.           

22.         } catch (JSONException e){

23.           // fail

24.         }

25.         

26.       }

27.     });

28.   }

29.   }

Submission filter example

1.   public class MyActivity extends Avtivity{

3.   private JotformAPIClient apiClient;

5.   @Override

6.   protected void onCreate(Bundle savedInstanceState) {

7.    super.onCreate(savedInstanceState);

8.     

9.     // this is for demonstration purposes only

10.     // you should not harcode API Keys, it is different for each user

11.     apiClient = new JotformAPIClient("API_KEY_GOES_HERE");

12.     

13.     HashMap<String, String> filter = new HashMap<String, String>();

14.     filter.put("status", "ACTIVE");

15.     filter.put("flag", "0");

16.     filter.put("updated_at", "2013-06-24 08:17:44");

17.     

18.     JSONObject filterObject = new JSONObject(filter);

19.     

20.     apiClient.getSubmissions(100, "created_at", filterObject, new JsonHttpHandler(){

21.     

22.       @Override

23.       public void onSuccess(JSONObject submissionsResponse){

24.       

25.         try {

26.           submissions = submissionsResponse.getJSONArray("content");

27.           

28.           // do something with the submissions jsonArray;

29.           

30.         } catch (JSONException e){

31.           // fail

32.         }

33.         

34.       }

35.     });

36.   }

37.   }

Delete Submission example

1.   public class MyActivity extends Avtivity{

3.   private JotformAPIClient apiClient;

5.   @Override

6.   protected void onCreate(Bundle savedInstanceState) {

7.    super.onCreate(savedInstanceState);

8.     

9.     // this is for demonstration purposes only

10.     // you should not harcode API Keys, it is different for each user

11.     apiClient = new JotformAPIClient("API_KEY_GOES_HERE");

12.     

13.     long submissionId = SUBMISSION_ID

14.     

15.     apiClient.deleteSubmission(submissionId, new JsonHttpHandler(){

16.     

17.       @Override

18.       public void onSuccess(JSONObject submissionsResponse){

19.       

20.         try {

21.           

22.           // do something with the submissions jsonArray;

23.           

24.             } catch (JSONException e){

25.           // fail

26.         }

27.         

28.       }

29.     });

30.   }

31.   }

[Github](https://github.com/jotform/jotform-api-csharp)[Download](https://github.com/jotform/jotform-api-csharp/archive/master.zip)

## jotform-api-csharp

[JotForm API](https://api.jotform.com/docs/) - C# Client

### Installation

Install via git clone:

1.   $ git clone git://github.com/jotform/jotform-api-csharp.git

2.   $ cd jotform-api-csharp

### Documentation

You can find the docs for the API of this client at [https://api.jotform.com/docs/](https://api.jotform.com/docs)

### Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at [API section](https://www.jotform.com/myaccount/api) of My Account page.

### Examples

Print all forms of the user

1.   using System;

2.   using System.Collections.Generic;

3.   using System.Linq;

4.   using System.Text;

5.   using JotForm;

6.   using Newtonsoft.Json;

7.   using Newtonsoft.Json.Linq;

9.   namespace JotFormTest

10.   {

11.     class PrintFormList

12.     {

13.       static void Main(string[] args)

14.       {

15.         var client = new JotForm.APIClient("YOUR API KEY");

16.         // If your account is in Eu Protected mode, set euProtected to true.

17.         // client.euProtected = false; 

18.         var forms = client.getForms()["content"];

20.         var formTitles = from form in forms

21.                 select form.Value<string>("title");

23.         foreach (var item in formTitles)

24.         {

25.           Console.Out.WriteLine(item);

26.         }

27.         

28.         Console.ReadLine();

29.       }

30.     }

31.   }

Get submissions of the latest form

1.   using System;

2.   using System.Collections.Generic;

3.   using System.Linq;

4.   using System.Text;

5.   using JotForm;

6.   using Newtonsoft.Json;

7.   using Newtonsoft.Json.Linq;

9.   namespace JotFormTest

10.   {

11.     class PrintFormSubmissions

12.     {

13.       static void Main(string[] args)

14.       {

15.         var client = new JotForm.APIClient("YOUR API KEY");

17.         var forms = client.getForms(0, 1, null, "")["content"];

19.         var latestForm = forms[0];

21.         var submissions = client.getFormSubmissons(Convert.ToInt64(latestForm["id"]));

23.         Console.Out.WriteLine(submissions);

25.         Console.ReadLine();

26.       }

27.     }

28.   }

Get latest 100 submissions ordered by creation date

1.   using System;

2.   using System.Collections.Generic;

3.   using System.Linq;

4.   using System.Text;

5.   using JotForm;

6.   using Newtonsoft.Json;

7.   using Newtonsoft.Json.Linq;

9.   namespace JotFormTest

10.   {

11.     class PrintLastSubmissions

12.     {

13.       static void Main(string[] args)

14.       {

15.         var client = new JotForm.APIClient("YOUR API KEY");

17.         var submissions = client.getSubmissions(0, 100, null, "created_at");

19.         Console.Out.WriteLine(submissions);

21.         Console.ReadLine();

22.       }

23.     }

24.   }

Submission and form filter examples

1.   using System;

2.   using System.Collections.Generic;

3.   using System.Linq;

4.   using System.Text;

5.   using JotForm;

6.   using Newtonsoft.Json;

7.   using Newtonsoft.Json.Linq;

9.   namespace JotFormTest

10.   {

11.     class Filters

12.     {

13.       static void Main(string[] args)

14.       {

15.         var client = new JotForm.APIClient("YOUR API KEY");

17.         Dictionary<String, String> submissionFilter = new Dictionary<string, string>();

18.         submissionFilter.Add("id:gt", "FORM ID");

19.         submissionFilter.Add("created_at:gt", "DATE");

21.         var submissions = client.getSubmissions(0, 0, submissionFilter, "");

22.         Console.Out.WriteLine(submissions);

24.         Dictionary<String, String> formFilter = new Dictionary<string, string>();

25.         formFilter.Add("id:gt", "FORM ID");

27.         var forms = client.getForms(0, 0, formFilter, "");

28.         Console.Out.WriteLine(forms);

30.         Console.ReadLine();

31.       }

32.     }

33.   }

Delete last 50 submissions

1.   using System;

2.   using System.Collections.Generic;

3.   using System.Linq;

4.   using System.Text;

5.   using JotForm;

6.   using Newtonsoft.Json;

7.   using Newtonsoft.Json.Linq;

9.   namespace JotFormTest

10.   {

11.     class DeleteSubmissions

12.     {

13.       static void Main(string[] args)

14.       {

15.         var client = new JotForm.APIClient("YOUR API KEY");

17.         var submissions = client.getSubmissions(0, 50, null, "")["content"];

19.         foreach (var submission in submissions)

20.         {

21.           var result = client.deleteSubmission(Convert.ToInt64(submission["id"]));

22.           Console.Out.WriteLine(result);

23.         }

25.         Console.ReadLine();

26.       }

27.     }

28.   }

First the _APIClient_ class is included from the _jotform-api-csharp/APIClient.cs_ file. This class provides access to JotForm's API. You have to create an API client instance with your API key. In case of an exception (wrong authentication etc.), you can catch it or let it fail with a fatal error.

[Github](https://github.com/jotform/jotform-api-go)[Download](https://github.com/jotform/jotform-api-go/archive/master.zip)

## jotform-api-go

[JotForm API](https://api.jotform.com/docs/) - GO Client

**Strongly consider using [v2 of the jotform-api-go client!](https://github.com/jotform/jotform-api-go/v2)!**

v1 works for user scripts, but is unsafe for use in long-running servers. It also silently hides some errors, and is generally less useable than v2.

### Installation

Install via git clone:

1.   $ git clone git://github.com/jotform/jotform-api-go.git

2.   $ cd jotform-api-go

### Documentation

You can find the docs for the API of this client at [https://api.jotform.com/docs/](https://api.jotform.com/docs)

### Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at [API section](https://www.jotform.com/myaccount/api) of My Account page.

### Examples

Get latest 100 submissions ordered by creation date

1.   package main

3.   import (

4.       "jotform-api-go"

5.       "fmt"

6.   )

8.   func main() {

10.     jotformAPI := jotform.NewJotFormAPIClient("YOUR API KEY")

12.     submissions := jotformAPI.GetSubmissions("", "100", nil, "created_at")

13.     fmt.Println(string(submissions))

14.   }

Submission and form filter examples

1.   package main

3.   import (

4.       "jotform-api-go"

5.       "fmt"

6.   )

8.   func main() {

10.     jotformAPI := jotform.NewJotFormAPIClient(

11.       "YOUR API KEY",

12.       "json", // or "xml", depending on how you want results to be formatted

13.       false, // when true, this prints debugging information on each request

14.     )

17.     submissionFilter := map[string]string {

18.         "id:gt": "FORM ID",

19.         "created_at:gt": "DATE",

20.     }

22.     submissions := jotformAPI.GetSubmissions("", "", submissionFilter, "")

23.     fmt.Println(string(submissions))

25.     formFilter := map[string]string {

26.         "id:gt": "FORM ID",    

27.     }

29.     forms := jotformAPI.GetForm("", "", formFilter, "")

30.     fmt.Println(string(forms))

31.   }

First the _jotform_ package is imported from the _jotform-api-go/JotForm.go_ file. This package provides access to JotForm's API. You have to create an API client instance with your API key. In case of an exception (wrong authentication etc.), you can catch it or let it fail with a fatal error.

[Github](https://github.com/jotform/jotform-api-ios)[Download](https://github.com/jotform/jotform-api-ios/archive/master.zip)

## jotform-api-ios

### Missing Documentation

This library is not documented yet. You can access the library from here: [jotform-api-ios](https://www.github.com/jotform/jotform-api-ios)

[Github](https://github.com/jotform/jotform-api-java)[Download](https://github.com/jotform/jotform-api-java/archive/master.zip)

## jotform-api-java

[JotForm API](https://api.jotform.com/docs/) - Java Client

### Installation

Install via git clone:

1.   $ git clone git://github.com/jotform/jotform-api-java.git

2.   $ cd jotform-api-java

### Documentation

You can find the docs for the API of this client at [https://api.jotform.com/docs/](https://api.jotform.com/docs)

### Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at [API section](https://www.jotform.com/myaccount/api) of My Account page.

### Examples

Print all forms of the user

1.   package com.jotform.api.samples;

3.   import org.json.JSONArray;

4.   import org.json.JSONException;

5.   import org.json.JSONObject;

6.   import com.jotform.api.*;

8.   public class PrintFormList {

10.     public static void main(String[] args) {

11.     

12.       JotForm client = new JotForm("YOUR API KEY");

13.       

14.       

15.       JSONObject formsResponse = client.getForms();

16.       

17.       try {

18.         JSONArray forms = formsResponse.getJSONArray("content");

19.         

20.         for (int i=0; i<forms.length(); i++){

21.           JSONObject form = forms.getJSONObject(i);

22.           

23.           System.out.println(form.get("title") + " (Total:" +form.get("count") + " New:" + form.get("new") + ")");

24.         }

25.       } catch (JSONException e) {

26.         e.printStackTrace();

27.       }

28.       

29.     }

30.   }

Get submissions of the latest form

1.   package com.jotform.api.samples;

3.   import org.json.JSONArray;

4.   import org.json.JSONException;

5.   import org.json.JSONObject;

6.   import com.jotform.api.*;

8.   public class LatestFormSubmissions {

10.     public static void main(String[] args) {

11.       

12.       JotForm client = new JotForm("YOUR API KEY");

13.       

14.       JSONObject formsResponse = client.getForms("", "1", null, "");

15.       

16.       try {

17.         JSONArray forms = formsResponse.getJSONArray("content");

18.         

19.         JSONObject latestForm = forms.getJSONObject(0);

20.         

21.         long latestFormID = Long.parseLong(latestForm.get("id").toString());

22.         

23.         JSONObject submissions = client.getFormSubmissions(latestFormID);

24.         

25.         System.out.println(submissions);

26.         

27.       } catch (JSONException e) {

28.         e.printStackTrace();

29.       }

30.     }

31.   }

Get latest 100 submissions ordered by creation date

1.   package com.jotform.api;

3.   import org.json.JSONArray;

4.   import org.json.JSONException;

5.   import org.json.JSONObject;

7.   public class PrintLastSubmissions {

9.     

10.     public static void main(String[] args) {

11.     

12.       JotForm client = new JotForm("YOUR API KEY");

13.       

14.       JSONObject submissions = client.getSubmissions("", "100", null, "created_at");

15.       

16.       System.out.println(submissions);

17.       

18.     }

20.   }

Submission and form filter examples

1.   package com.jotform.api.samples;

3.   import java.util.HashMap;

5.   import org.json.JSONObject;

6.   import com.jotform.api.*;

8.   public class SubmissionFormFilters {

9.       

10.     public static void main(String[] args) {

11.       

12.       JotForm client = new JotForm("YOUR API KEY");

13.       

14.       HashMap<String, String> submissionFilter = new HashMap<String, String>();

15.       submissionFilter.put("id:gt", "FORM ID");

16.       submissionFilter.put("created_at:gt", "DATE");

18.       JSONObject submissions = client.getSubmissions("", "", submissionFilter, "");

19.       

20.       System.out.println(submissions);

21.       

22.       HashMap<String, String> formFilter = new HashMap<String, String>();

23.       formFilter.put("id:gt", "FORM ID");

24.       

25.       JSONObject forms = client.getForms("", "", formFilter, "");

26.       

27.       System.out.println(forms);

28.     }

29.   }

Delete last 50 submissions

1.   package com.jotform.api.samples;

3.   import org.json.JSONArray;

4.   import org.json.JSONException;

5.   import org.json.JSONObject;

6.   import com.jotform.api.*;

8.   public class Delete50Submissions {

9.       

10.     public static void main(String[] args) {

11.       

12.       JotForm client = new JotForm("YOUR API KEY");

13.       

14.       JSONObject submissionsResponse = client.getSubmissions("", "50", null, "");

15.       

16.       JSONArray submissions;

17.       try {

18.         submissions = submissionsResponse.getJSONArray("content");

19.       

20.         for (int i=0; i<submissions.length(); i++){

21.           JSONObject submission = submissions.getJSONObject(i);

22.           

23.           JSONObject result = client.deleteSubmission(Long.parseLong(submission.get("id").toString()));

24.           

25.           System.out.println(result);

26.         }

27.       } catch (JSONException e) {

28.         e.printStackTrace();

29.       }  

30.     }

31.   }

First the _JotForm_ class is included from the _jotform-api-java/JotForm.java_ file. This class provides access to JotForm's API. You have to create an API client instance with your API key. In case of an exception (wrong authentication etc.), you can catch it or let it fail with a fatal error.

[Download](https://js.jotform.com/JotForm.js)

## jotform-api-javascript

[JotForm API](https://api.jotform.com/docs/) - JavaScript Client

### Installation

Copy and paste the script below to your page

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

### Documentation

You can find the docs for the API of this client at [https://api.jotform.com/docs/](https://api.jotform.com/docs)

### Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at [API section](https://www.jotform.com/myaccount/api) of My Account page.

### Examples

Print all forms of the user

1.   JF.getForms(function(response){

2.     /**

3.     successful response including user forms array

4.     *

5.     */

6.     for(var i=0; i<response.length; i++){

7.       document.write(response[i].title);

8.     }

9.   });

Print all submissions of the user

1.   JF.getSubmissions(function(response){

2.     /**

3.     successful response including user submissions data

4.     .

5.     */

6.     for(var i=0; i<response.length; i++){

7.       document.write(response[i].form_id);

8.     }  

9.   });

See [Documentation](https://api.jotform.com/) for full list of methods available

[Github](https://github.com/jotform/jotform-api-nodejs)[Download](https://github.com/jotform/jotform-api-nodejs/archive/master.zip)

![Image 1: logo](https://cdn.jotfor.ms/assets/resources/logo-nb/jotform-logo-transparent-400x100.png)

## Jotform Node.js SDK

### Installation

1.   $ npm install jotform

### Usage

*   Initialize the SDK.

1.   import Jotform from "jotform";

3.   const client = new Jotform('YOUR_API_KEY');

*   Simple examples.

1.   const response = await client.form.createForm();

2.   const formId = response.content.id;

1.   const questions = await client.form.addQuestions(formId, [

2.     {

3.       type: 'control_email',

4.       name: 'emailfield',

5.       text: 'My email field',

6.       order: '1'

7.     }, {

8.       type: 'control_email',

9.       name: 'emailfield2',

10.       text: 'My email field 2',

11.       order: '2'

12.     }

13.   ]);

*   Detailed information of API: [https://api.jotform.com/docs](https://api.jotform.com/docs).
*   Properties reference: [https://api.jotform.com/docs/properties/index.php](https://api.jotform.com/docs/properties/index.php)

### License

*   This project is under the [GPLv2 license](https://www.jotform.com/developers/libraries/LICENSE.md). Copyright (c) 2023 Jotform and it's contributors.

[Github](https://github.com/jotform/jotform-api-php)[Download](https://github.com/jotform/jotform-api-php/archive/master.zip)

## jotform-api-php

[JotForm API](https://api.jotform.com/docs/) - PHP Client

### Installation

Install via git clone:

1.   $ git clone git://github.com/jotform/jotform-api-php.git

2.   $ cd jotform-api-php

or

Install via Composer package manager ([https://getcomposer.org/](https://getcomposer.org/))

_composer.json_

1.   {

2.     "require": {

3.       "jotform/jotform-api-php": "dev-master"

4.     }

5.   }

1.   $ php composer.phar install

### Documentation

You can find the docs for the API of this client at [https://api.jotform.com/docs/](https://api.jotform.com/docs)

### Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at [API section](https://www.jotform.com/myaccount/api) of My Account page.

### Examples

Print all forms of the user

1.   <?php

2.     

3.     include "jotform-api-php/JotForm.php";

4.     

5.     $jotformAPI = new JotForm("YOUR API KEY");

6.     $forms = $jotformAPI->getForms();

7.     

8.     foreach ($forms as $form) {

9.       print $form["title"];

10.     }

12.   ?>

Get submissions of the latest form

1.   <?php

2.     

3.     try {

4.       include "jotform-api-php/JotForm.php";

5.       

6.       $jotformAPI = new JotForm("YOUR API KEY");

8.       $forms = $jotformAPI->getForms(0, 1, null, null);

10.       $latestForm = $forms[0];

12.       $latestFormID = $latestForm["id"];

14.       $submissions = $jotformAPI->getFormSubmissions($latestFormID);

16.       var_dump($submissions);

18.     }

19.     catch (Exception $e) {

20.       var_dump($e->getMessage());

21.     }

22.     

23.   ?>

Get latest 100 submissions ordered by creation date

1.   <?php

2.     

3.     try {

4.       include "jotform-api-php/JotForm.php";

5.       

6.       $jotformAPI = new JotForm("YOUR API KEY");

8.       $submissions = $jotformAPI->getSubmissions(0, 100, null, "created_at");

10.       var_dump($submissions);

11.     }

12.     catch (Exception $e) {

13.       var_dump($e->getMessage());

14.     }

15.     

16.   ?>

Submission and form filter examples

1.   <?php

3.     try {

4.       include "jotform-api-php/JotForm.php";

5.       

6.       $jotformAPI = new JotForm("YOUR API KEY");

7.       

8.       $filter = array(

9.           "id:gt" => "239252191641336722",

10.           "created_at:gt" => "2013-07-09 07:48:34",

11.       );

12.       

13.       $subs = $jotformAPI->getSubmissions(0, 0, $filter, "");

14.       var_dump($subs); 

15.       

16.       $filter = array(

17.           "id:gt" => "239176717911737253",

18.       );

19.       

20.       $formSubs = $jotformAPI->getForms(0, 0, 2, $filter);

21.       var_dump($formSubs);

22.     } catch (Exception $e) {

23.         var_dump($e->getMessage());

24.     }

25.     

26.   ?>

Delete last 50 submissions

1.   <?php

2.     

3.     try {

4.       include "jotform-api-php/JotForm.php";

5.       

6.       $jotformAPI = new JotForm("YOUR API KEY");

8.       $submissions = $jotformAPI->getSubmissions(0, 50, null, null);

10.       foreach ($submissions as $submission) {

11.         $result = $jotformAPI->deleteSubmission($submission["id"]);

12.         print $result;

13.       }

14.     }

15.     catch (Exception $e) {

16.       var_dump($e->getMessage());

17.     }

18.     

19.   ?>

First the _JotForm_ class is included from the _jotform-api-php/JotForm.php_ file. This class provides access to JotForm's API. You have to create an API client instance with your API key. In case of an exception (wrong authentication etc.), you can catch it or let it fail with a fatal error.

[Github](https://github.com/jotform/jotform-api-python)[Download](https://github.com/jotform/jotform-api-python/archive/master.zip)

## jotform-api-python

[JotForm API](https://api.jotform.com/docs/) - Python Client

### Installation

Install via git clone:

1.   $ git clone https://github.com/jotform/jotform-api-python.git

2.   $ cd jotform-api-python

Install via pip (latest version)

1.   $ pip install git+https://github.com/jotform/jotform-api-python.git

### Documentation

You can find the docs for the API of this client at [https://api.jotform.com/docs/](https://api.jotform.com/docs)

### Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at [API section](https://www.jotform.com/myaccount/api) of My Account page.

### Examples

Print all forms of the user

1.   from jotform import *

3.   def main():

5.     jotformAPIClient = JotformAPIClient('YOUR API KEY')

7.     forms = jotformAPIClient.get_forms()

9.     for form in forms:

10.       print(form["title"])

12.   if __name__ == "__main__":

13.     main()

Get submissions of the latest form

1.   from jotform import *

3.   def main():

5.     jotformAPIClient = JotformAPIClient('YOUR API KEY')

7.     forms = jotformAPIClient.get_forms(None, 1, None, None)

9.     latestForm = forms[0]

11.     latestFormID = latestForm["id"]

13.     submissions = jotformAPIClient.get_form_submissions(latestFormID)

15.     print(submissions)

17.   if __name__ == "__main__":

18.     main()

Get latest 100 submissions ordered by creation date

1.   from jotform import *

3.   def main():

5.     jotformAPIClient = JotformAPIClient('YOUR API KEY')

7.     submissions = jotformAPIClient.get_submissions(0, 100, None, "created_at")

9.     print(submissions)

11.   if __name__ == "__main__":

12.     main()

Submission and form filter examples

1.   from jotform import *

3.   def main():

5.     jotformAPIClient = JotformAPIClient('YOUR API KEY')

7.     submission_filter = {"id:gt":"FORM ID", "created_at": "DATE"}

9.     submission = jotformAPIClient.get_submissions(0, 0, submission_filter, "") 

10.     print(submission)

12.     form_filter = {"id:gt": "FORM ID"}

14.     forms = jotformAPIClient.get_forms(0,0, form_filter, "")

15.     print(forms)

17.   if __name__ == "__main__":

18.     main()

Delete last 50 submissions

1.   from jotform import *

3.   def main():

5.     jotformAPIClient = JotformAPIClient('YOUR API KEY')

7.     submissions = jotformAPIClient.get_submissions(0, 50, None, None)

9.     for submission in submissions:

10.       result = jotformAPIClient.delete_submission(submission["id"])

11.       print(result)

13.   if __name__ == "__main__":

14.     main()

First the _JotformAPIClient_ class is included from the _jotform-api-python/jotform.py_ file. This class provides access to JotForm's API. You have to create an API client instance with your API key. In case of an exception (wrong authentication etc.), you can catch it or let it fail with a fatal error.

[Github](https://github.com/jotform/jotform-api-ruby)[Download](https://github.com/jotform/jotform-api-ruby/archive/master.zip)

## jotform-api-ruby

[JotForm API](https://api.jotform.com/docs/) - Ruby Client

### Installation

Install via git clone:

1.   $ git clone git://github.com/jotform/jotform-api-ruby.git

2.   $ cd jotform-api-ruby

### Documentation

You can find the docs for the API of this client at [https://api.jotform.com/docs/](https://api.jotform.com/docs)

### Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at [API section](https://www.jotform.com/myaccount/api) of My Account page.

### Examples

Print all forms of the user

1.   #!/usr/bin/env ruby

2.   require_relative 'JotForm'

4.   jotform = JotForm.new("APIKey")

5.   forms = jotform.getForms()

7.   forms.each do |form|

8.     puts form["title"]

9.   end

Get latest submissions of the user

1.   #!/usr/bin/env ruby

2.   require_relative 'JotForm'

4.   jotform = JotForm.new("APIKey")

5.   submissions = jotform.getSubmissions()

7.   submissions.each do |submission|

8.     puts submission["created_at"] + " " 

9.     submission["answers"].each do | answer|

10.       puts "\t" + answer.join(" ")

11.     end

12.   end

First the _JotForm_ class is included from the _jotform-api-ruby/JotForm.rb_ file. This class provides access to JotForm's API. You have to create an API client instance with your API key. In case of an exception (wrong authentication etc.), you can catch it or let it fail with a fatal error.

[Github](https://github.com/jotform/jotform-api-scala)[Download](https://github.com/jotform/jotform-api-scala/archive/master.zip)

## jotform-api-scala

[JotForm API](https://api.jotform.com/docs/) - Scala Client

### Installation

Install via git clone:

1.   $ git clone git://github.com/jotform/jotform-api-scala.git

2.   $ cd jotform-api-scala

### Documentation

You can find the docs for the API of this client at [https://api.jotform.com/docs/](https://api.jotform.com/docs)

### Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at [API section](https://www.jotform.com/myaccount/api) of My Account page.

### Examples

Print all forms of the user

1.   package com.jotform.api.samples

3.   import com.jotform.api._

4.   import org.json._

6.   object PrintFormList {

7.    

8.    def main(args: Array[String]) {

9.     val client = new JotForm()

10.     client.setAPIKey("YOUR API KEY")

11.     

12.     val response: JSONObject = client.getForms()

13.     

14.     val forms: JSONArray = response.getJSONArray("content")

15.         

16.     for (i <- 0 until forms.length()){

17.       val form: JSONObject = forms.getJSONObject(i)

18.       

19.       println(form.get("title") + " (Total:" +form.get("count") + " New:" + form.get("new") + ")")

20.     }

21.    }

22.   }

Get submissions of the latest form

1.   package com.jotform.api.samples

3.   import com.jotform.api._

4.   import org.json._

6.   object LatestFormSubmissions {

7.    

8.    def main(args: Array[String]) {

9.     val client = new JotForm()

10.     client.setAPIKey("YOUR API KEY")

11.     

12.     val response: JSONObject = client.getForms(0, 1, null, null)

13.     

14.     val forms: JSONArray = response.getJSONArray("content")

15.     

16.     val latestForm: JSONObject = forms.getJSONObject(0)

17.     

18.     val latestFormID: Long = latestForm.getLong("id")

19.     

20.     val submissions: JSONObject = client.getFormSubmissions(latestFormID)

21.     

22.     println(submissions)

24.    }

25.   }

Get latest 100 submissions ordered by creation date

1.   package com.jotform.api.samples

3.   import com.jotform.api._

4.   import org.json._

6.   object Latest100Submissions {

7.    

8.    def main(args: Array[String]) {

9.     val client = new JotForm()

10.     client.setAPIKey("YOUR API KEY")

11.     

12.     val response: JSONObject = client.getSubmissions(0, 100, null, "created_at")

14.     println(response)

16.    }

17.   }

Submission and form filter examples

1.   package com.jotform.api.samples

3.   import com.jotform.api._

4.   import org.json._

6.   object SubmissionFormFilters {

7.    

8.    def main(args: Array[String]) {

9.     val client = new JotForm()

10.     client.setAPIKey("YOUR API KEY")

11.     

12.     val submissionfilter = Map("id:gt" -> "244605793257787946", "created_at:gt" -> "2013-09-06 03:18:44")

13.     

14.     val submissions: JSONObject = client.getSubmissions(0, 0, submissionfilter, null)

16.     println(submissions)

17.     

18.     val formFilter = Map("id:gt" -> "32522773744962")

19.     

20.     val forms: JSONObject = client.getForms(0, 0, formFilter, null)

21.     

22.     println(forms)

23.    }

24.   }

Delete last 50 submissions

1.   package com.jotform.api.samples

3.   import com.jotform.api._

4.   import org.json._

6.   object Delete50Submissions{

7.    

8.    def main(args: Array[String]) {

9.     val client = new JotForm()

10.     client.setAPIKey("YOUR API KEY")

11.     

12.     val response: JSONObject = client.getSubmissions(0, 2, null, null)

13.     

14.     val submissions = response.getJSONArray("content")

15.     

16.     for(i <- 0 until submissions.length()) {

17.      val submission: JSONObject = submissions.getJSONObject(i)

18.      

19.      val result: JSONObject = client.deleteSubmission(submission.getLong("id"))

20.      

21.      println(submission.getLong("id") + " deleted.")

22.     }

24.    }

25.   }

First the _JotForm_ class is included from the _jotform-api-scala/JotForm.scala_ file. This class provides access to JotForm's API. You have to create an API client instance with your API key. In case of an exception (wrong authentication etc.), you can catch it or let it fail with a fatal error.

[Top](https://www.jotform.com/developers/libraries/?jfNext=1#)