Giter Site home page Giter Site logo

jotform-api-python's Introduction

jotform-api-python

JotForm API - Python Client

Installation

Install via git clone:

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

Install via pip (latest version)

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

Documentation

You can find the docs for the API of this client at http://api.jotform.com/docs/

Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at API section of My Account page.

Examples

Print all forms of the user

from jotform import *

def main():

    jotformAPIClient = JotformAPIClient('YOUR API KEY')

    forms = jotformAPIClient.get_forms()

    for form in forms:
    	print(form["title"])

if __name__ == "__main__":
    main()

Get submissions of the latest form

from jotform import *

def main():

    jotformAPIClient = JotformAPIClient('YOUR API KEY')

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

    latestForm = forms[0]

    latestFormID = latestForm["id"]

    submissions = jotformAPIClient.get_form_submissions(latestFormID)

    print(submissions)

if __name__ == "__main__":
    main()

Get latest 100 submissions ordered by creation date

from jotform import *

def main():

    jotformAPIClient = JotformAPIClient('YOUR API KEY')

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

    print(submissions)

if __name__ == "__main__":
    main()

Submission and form filter examples

from jotform import *

def main():

    jotformAPIClient = JotformAPIClient('YOUR API KEY')

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

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

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

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

if __name__ == "__main__":
    main()

Delete last 50 submissions

from jotform import *

def main():

    jotformAPIClient = JotformAPIClient('YOUR API KEY')

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

    for submission in submissions:
        result = jotformAPIClient.delete_submission(submission["id"])
        print(result)

if __name__ == "__main__":
    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.

jotform-api-python's People

Contributors

elifceren avatar eeertekin avatar cbalci avatar jhillacre avatar kennethpdev avatar umutbugrahan avatar sambasafety-jvalliswalker avatar utkubekci avatar uelmalioglu avatar aytekintank avatar erikvisser22 avatar atleta avatar sevastos avatar appaky avatar ed-hughes avatar ehawman-rosenberg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.