### Install jotform-api-python via Git and Pip Source: https://github.com/jotform/jotform-api-python/blob/master/README.md Instructions for installing the jotform-api-python library. Users can either clone the repository directly from GitHub or install the latest version using pip. ```bash git clone https://github.com/jotform/jotform-api-python.git cd jotform-api-python ``` ```bash pip install git+https://github.com/jotform/jotform-api-python.git ``` -------------------------------- ### GET /user/settings Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Retrieves the user's account settings, including time zone and language preferences. ```APIDOC ## GET /user/settings ### Description Get user's settings for this account. User's time zone and language. ### Method GET ### Endpoint /user/settings ### Response #### Success Response (200) - **settings** (object) - User account settings. - **timezone** (string) - The user's time zone. - **language** (string) - The user's preferred language. ### Response Example ```json { "settings": { "timezone": "America/New_York", "language": "en" } } ``` ``` -------------------------------- ### GET /user/webhooks Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Retrieves a list of webhooks configured for the user's account. ```APIDOC ## GET /user/webhooks ### Description Get a list of webhooks for a form. ### Method GET ### Endpoint /user/webhooks ### Parameters #### Query Parameters - **formID** (string) - Required - Form ID is the numbers you see on a form URL. You can get form IDs when you call /user/forms. ### Response #### Success Response (200) - **webhooks** (array) - List of webhook objects. - **url** (string) - The URL where the webhook data will be sent. - **methods** (array) - The HTTP methods used for the webhook. - **headers** (object) - Custom headers to include in the webhook request. ### Response Example ```json { "webhooks": [ { "url": "https://example.com/webhook", "methods": ["POST"], "headers": {"X-Custom-Header": "value"} } ] } ``` ``` -------------------------------- ### List All Forms Source: https://context7.com/jotform/jotform-api-python/llms.txt Get a paginated list of forms with optional filtering and sorting capabilities. ```APIDOC ## List All Forms Get a paginated list of forms with optional filtering and sorting capabilities. ### Method GET ### Endpoint /user/forms ### Parameters #### Path Parameters None #### Query Parameters - **offset** (integer, optional) - The number of forms to skip before returning results. - **limit** (integer, optional) - The maximum number of forms to return. - **order_by** (string, optional) - The field to sort the forms by (e.g., 'created_at', 'updated_at', 'title'). - **filterArray** (object, optional) - An object containing filter criteria. Keys can include status (e.g., "ENABLED", "DISABLED") or ID comparisons (e.g., "id:gt": "123456789"). #### Request Body None ### Request Example ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') # Get all forms (default pagination) forms = client.get_forms() for form in forms: print(f"Form ID: {form['id']}, Title: {form['title']}") print(f"Status: {form['status']}, Submissions: {form['count']}") # Get first 10 forms sorted by creation date recent_forms = client.get_forms(offset=0, limit=10, order_by='created_at') # Filter forms by status filter_active = {"status": "ENABLED"} active_forms = client.get_forms(filterArray=filter_active) # Complex filter: forms created after specific ID filter_complex = {"id:gt": "123456789"} filtered_forms = client.get_forms(offset=0, limit=20, filterArray=filter_complex, order_by='updated_at') for form in filtered_forms: print(f"{form['title']} - Last updated: {form['updated_at']}") ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the form. - **title** (string) - The title of the form. - **status** (string) - The current status of the form (e.g., 'ENABLED', 'DISABLED'). - **count** (integer) - The total number of submissions for the form. - **created_at** (string) - The timestamp when the form was created. - **updated_at** (string) - The timestamp when the form was last updated. #### Response Example ```json [ { "id": "123456789", "title": "Customer Feedback Form", "status": "ENABLED", "count": 150, "created_at": "2023-01-15T10:00:00+00:00", "updated_at": "2023-10-20T14:30:00+00:00" } ] ``` ``` -------------------------------- ### Print All Forms (Python) Source: https://github.com/jotform/jotform-api-python/blob/master/README.md Example demonstrating how to retrieve all forms associated with a user's API key and print their titles. Requires the JotformAPIClient and an API key. ```python 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 /forms Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Retrieves a list of forms associated with the user's account. Supports pagination and ordering. ```APIDOC ## GET /forms ### Description Get a list of forms for this account. Basic details such as title of the form, when it was created, number of new and total submissions are returned. ### Method GET ### Endpoint /forms ### Parameters #### Query Parameters - **offset** (string) - Optional - Start of each result set for form list. - **limit** (string) - Optional - Number of results in each result set for form list. - **filterArray** (array) - Optional - Filters the query results to fetch a specific form range. - **order_by** (string) - Optional - Order results by a form field name. ### Response #### Success Response (200) - **forms** (array) - List of form objects. - **title** (string) - The title of the form. - **created_at** (string) - The date and time the form was created. - **new_submissions** (integer) - The number of new submissions for the form. - **total_submissions** (integer) - The total number of submissions for the form. ### Response Example ```json { "forms": [ { "title": "My Awesome Form", "created_at": "2023-10-27T10:00:00Z", "new_submissions": 5, "total_submissions": 100 } ] } ``` ``` -------------------------------- ### GET /form/{id} Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Retrieves basic information about a specific Jotform form, including its ID, status, and creation/update dates. ```APIDOC ## GET /form/{id} ### Description Retrieves fundamental details about a specified Jotform form. This includes metadata such as the form's status, creation date, last update date, and submission count. ### Method GET ### Endpoint /form/{formID} ### Parameters #### Path Parameters - **formID** (string) - Required - The unique identifier for the form. #### Query Parameters None ### Request Example ```json { "formID": "1234567890" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the form. - **form_title** (string) - The title of the form. - **status** (string) - The current status of the form (e.g., 'active', 'inactive'). - **created_at** (string) - The date and time the form was created. - **updated_at** (string) - The date and time the form was last updated. - **submission_count** (integer) - The total number of submissions received for the form. #### Response Example ```json { "id": "1234567890", "form_title": "Contact Us Form", "status": "active", "created_at": "2023-01-15T09:00:00+00:00", "updated_at": "2023-10-20T14:30:00+00:00", "submission_count": 525 } ``` ``` -------------------------------- ### Submission and Form Filtering Examples (Python) Source: https://github.com/jotform/jotform-api-python/blob/master/README.md Demonstrates how to filter submissions and forms using specific criteria. It shows how to apply filters for submission IDs greater than a certain value and for forms. Requires JotformAPIClient and an API key. ```python 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() ``` -------------------------------- ### GET /submissions Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Retrieves a list of all submissions for the user's account. Supports pagination, filtering, and ordering. ```APIDOC ## GET /submissions ### Description Get a list of submissions for this account. Basic details such as title of the form, when it was created, number of new and total submissions. ### Method GET ### Endpoint /submissions ### Parameters #### Query Parameters - **offset** (string) - Optional - Start of each result set for form list. - **limit** (string) - Optional - Number of results in each result set for form list. - **filterArray** (array) - Optional - Filters the query results to fetch a specific form range. - **order_by** (string) - Optional - Order results by a form field name. ### Response #### Success Response (200) - **submissions** (array) - List of submission objects. - **sid** (string) - The submission ID. - **form_id** (string) - The ID of the form the submission belongs to. - **created_at** (string) - The date and time the submission was created. ### Response Example ```json { "submissions": [ { "sid": "1234567890", "form_id": "987654321", "created_at": "2023-10-27T12:00:00Z" } ] } ``` ``` -------------------------------- ### Get Folders Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieves all form folders for the authenticated account, including shared folders. ```APIDOC ## Get Folders ### Description Retrieve all form folders for the authenticated account including shared folders. ### Method GET ### Endpoint `/folders` (This is an assumed endpoint based on the code usage, actual endpoint might vary) ### Parameters None ### Response #### Success Response (200) - **folders** (object) - An object where keys are folder IDs and values are folder data objects. - **folder_id** (string) - The ID of the folder. - **name** (string) - The name of the folder. - **owner** (string) - The owner of the folder (e.g., 'You' or a username). - **color** (string) - The color assigned to the folder (e.g., hex code). - **parent** (string) - The ID of the parent folder, or an empty string for root folders. #### Response Example ```json { "folders": { "12345": { "name": "Customer Surveys", "owner": "You", "color": "#3498db", "parent": "" }, "67890": { "name": "Internal Reports", "owner": "admin@example.com", "color": "#f1c40f", "parent": "" } } } ``` ``` -------------------------------- ### GET /user/folders Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Retrieves a list of all form folders associated with the authenticated user's account. ```APIDOC ## GET /user/folders ### Description Fetches a list of all folders created within the user's Jotform account. This includes details about the folder name and owner, particularly for shared folders. ### Method GET ### Endpoint /user/folders ### Parameters None ### Request Example (No request body or parameters needed for this GET request) ### Response #### Success Response (200) - **folders** (array) - A list of folder objects. #### Response Example ```json { "folders": [ { "id": "folder1", "name": "Marketing Forms", "owner": "user@example.com" }, { "id": "folder2", "name": "Support Forms", "owner": "user@example.com" } ] } ``` ``` -------------------------------- ### Get Form Details Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieve comprehensive information about a specific form including its configuration, status, and metadata. ```APIDOC ## Get Form Details Retrieve comprehensive information about a specific form including its configuration, status, and metadata. ### Method GET ### Endpoint /form/{formID} ### Parameters #### Path Parameters - **formID** (string) - Required - The unique identifier of the form. #### Query Parameters None #### Request Body None ### Request Example ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') form_id = '123456789' try: form = client.get_form(form_id) print(f"Form Title: {form['title']}") print(f"Status: {form['status']}") print(f"Created: {form['created_at']}") print(f"Updated: {form['updated_at']}") print(f"Total Submissions: {form['count']}") print(f"New Submissions: {form['new']}") print(f"Form URL: {form['url']}") print(f"Form Height: {form.get('height', 'Auto')}") except Exception as e: print(f"Error fetching form {form_id}: {e}") ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the form. - **title** (string) - The title of the form. - **status** (string) - The current status of the form (e.g., 'ENABLED', 'DISABLED'). - **created_at** (string) - The timestamp when the form was created. - **updated_at** (string) - The timestamp when the form was last updated. - **count** (integer) - The total number of submissions for the form. - **new** (integer) - The number of new submissions for the form. - **url** (string) - The URL of the form. - **height** (string, optional) - The height of the form embed (e.g., 'Auto'). #### Response Example ```json { "id": "123456789", "title": "Contact Us Form", "status": "ENABLED", "created_at": "2023-03-10T09:00:00+00:00", "updated_at": "2023-11-01T11:00:00+00:00", "count": 300, "new": 5, "url": "https://www.jotform.com/form/123456789", "height": "1200" } ``` ``` -------------------------------- ### GET /user/usage Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Retrieves information about the user's monthly submission usage, including SSL submissions, payment submissions, and upload space. ```APIDOC ## GET /user/usage ### Description Get number of form submissions received this month. Number of submissions, number of SSL form submissions, payment form submissions and upload space used by user. ### Method GET ### Endpoint /user/usage ### Response #### Success Response (200) - **usage** (object) - User's monthly usage statistics. - **submissions** (integer) - Total number of submissions this month. - **ssl_submissions** (integer) - Number of SSL form submissions. - **payment_submissions** (integer) - Number of payment form submissions. - **upload_space_used** (integer) - Amount of upload space used in MB. ### Response Example ```json { "usage": { "submissions": 500, "ssl_submissions": 100, "payment_submissions": 25, "upload_space_used": 50 } } ``` ``` -------------------------------- ### Get All Jotform Form Properties with Python Source: https://context7.com/jotform/jotform-api-python/llms.txt Illustrates how to retrieve all configuration properties for a given Jotform form. This includes settings related to styling, behavior, and general form information. Requires the form ID and an API key. ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') form_id = '123456789' try: properties = client.get_form_properties(form_id) print(f"Title: {properties.get('title', 'Untitled')}") print(f"Status: {properties.get('status', 'ENABLED')}") print(f"Height: {properties.get('height', 'Auto')}") print(f"Form Width: {properties.get('width', 'Default')}") print(f"Thank You Message: {properties.get('thanktext', 'N/A')}") print(f"Send Post Data: {properties.get('sendpostdata', 'No')}") if 'styles' in properties: print(f"Background Color: {properties['styles'].get('backgroundColor', 'Default')}") except Exception as e: print(f"Error fetching properties: {e}") ``` -------------------------------- ### Get Subusers with Python Source: https://context7.com/jotform/jotform-api-python/llms.txt Fetches a list of subusers associated with the Jotform account. Includes their usernames, emails, and access permissions for forms and folders. Returns a list of subuser dictionaries. ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') try: subusers = client.get_subusers() if subusers: print(f"Found {len(subusers)} subuser(s):") for subuser in subusers: print(f"Username: {subuser.get('username', 'N/A')}") print(f"Email: {subuser.get('email', 'N/A')}") print(f"Status: {subuser.get('status', 'N/A')}") if 'forms' in subuser: print(f"Access to {len(subuser['forms'])} form(s)") print("---") else: print("No subusers found") except Exception as e: print(f"Error fetching subusers: {e}") ``` -------------------------------- ### Get Jotform Plan Details with Python Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieves information about a specific JotForm subscription plan. Requires the `jotform` library and an API key. It takes a plan name as input and outputs details like price, submissions limit, and form limit. ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') plan_name = 'PREMIUM' # Options: FREE, BRONZE, SILVER, GOLD, PREMIUM, ENTERPRISE try: plan = client.get_plan(plan_name) print(f"Plan: {plan.get('name', 'N/A')}") print(f"Price: ${plan.get('price', '0')}") print(f"Monthly Submissions: {plan.get('submissions', 'Unlimited')}") print(f"Form Limit: {plan.get('forms', 'Unlimited')}") print(f"Payment Forms: {plan.get('payments', 'N/A')}") print(f"Upload Space: {plan.get('space', 'N/A')}") print(f"SSL: {plan.get('ssl', 'N/A')}") except Exception as e: print(f"Error fetching plan: {e}") # Compare multiple plans plans_to_compare = ['FREE', 'BRONZE', 'SILVER', 'GOLD'] for plan_name in plans_to_compare: try: plan = client.get_plan(plan_name) print(f"\n{plan_name}: ${plan.get('price', '0')}/mo - {plan.get('submissions', 'N/A')} submissions") except Exception as e: print(f"Could not fetch {plan_name}: {e}") ``` -------------------------------- ### GET /user/reports Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Lists all available reports for the user's account, including formats like Excel, CSV, and HTML tables. ```APIDOC ## GET /user/reports ### Description List of URLs for reports in this account. Reports for all of the forms. ie. Excel, CSV, printable charts, embeddable HTML tables. ### Method GET ### Endpoint /user/reports ### Response #### Success Response (200) - **reports** (array) - List of report objects. - **reportID** (string) - The unique identifier for the report. - **type** (string) - The type of report (e.g., 'excel', 'csv', 'pdf'). - **url** (string) - The URL to access the report. ### Response Example ```json { "reports": [ { "reportID": "report123", "type": "csv", "url": "https://api.jotform.com/reports/report123.csv" } ] } ``` ``` -------------------------------- ### GET /user Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Retrieves details about the user's Jotform account, including account type, avatar URL, name, email, website, and account limits. ```APIDOC ## GET /user ### Description Get user account details for a Jotform user. User account type, avatar URL, name, email, website URL and account limits. ### Method GET ### Endpoint /user ### Response #### Success Response (200) - **userDetails** (object) - Details of the user's Jotform account. - **account_type** (string) - The type of Jotform account (e.g., 'bronze', 'silver', 'gold'). - **avatar_url** (string) - URL of the user's avatar. - **name** (string) - The user's full name. - **email** (string) - The user's email address. - **website** (string) - The user's website URL. - **limits** (object) - Account limits. - **monthly_form_submissions** (integer) - Maximum monthly submissions allowed. - **storage_space** (integer) - Total storage space allowed in MB. ### Response Example ```json { "userDetails": { "account_type": "gold", "avatar_url": "https://www.jotform.com/images/avatars/default.png", "name": "Jane Doe", "email": "jane.doe@example.com", "website": "https://janedoe.com", "limits": { "monthly_form_submissions": 10000, "storage_space": 1024 } } } ``` ``` -------------------------------- ### Get All Reports Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieves a list of all reports associated with the authenticated user across all forms. ```APIDOC ## Get All Reports ### Description Retrieve all reports across all forms for the authenticated user. ### Method GET ### Endpoint `/reports` (This is an assumed endpoint based on the code usage, actual endpoint might vary) ### Parameters None ### Response #### Success Response (200) - **reports** (object) - An object where keys are report IDs and values are report data objects. - **report_id** (string) - The ID of the report. - **title** (string) - The title of the report. - **form_id** (string) - The ID of the form associated with the report. - **list_type** (string) - The type of the report (e.g., 'csv', 'excel'). - **url** (string) - The URL to access the report. #### Response Example ```json { "reports": { "1234567890": { "title": "Monthly Sales Report", "form_id": "112233", "list_type": "csv", "url": "https://www.jotform.com/uploads/username/report/1234567890.csv" }, "0987654321": { "title": "Customer Feedback Summary", "form_id": "445566", "list_type": "excel", "url": "https://www.jotform.com/uploads/username/report/0987654321.xlsx" } } } ``` ``` -------------------------------- ### GET /submission/{sid} Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Retrieves detailed information and answers for a specific submission, identified by its submission ID (sid). ```APIDOC ## GET /submission/{sid} ### Description Get submission data. Information and answers of a specific submission. ### Method GET ### Endpoint /submission/{sid} ### Parameters #### Path Parameters - **sid** (string) - Required - You can get submission IDs when you call /form/{id}/submissions. ### Response #### Success Response (200) - **submissionData** (object) - Data of the specified submission. - **id** (string) - The submission ID. - **answers** (object) - An object containing the answers to the form questions. - **created_at** (string) - The date and time the submission was created. ### Response Example ```json { "submissionData": { "id": "1234567890", "answers": { "1": {"answer": "John Doe"}, "2": {"answer": "john.doe@example.com"} }, "created_at": "2023-10-27T12:00:00Z" } } ``` ``` -------------------------------- ### Get Report Details Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieves detailed information about a specific report, including its configuration, data, and status. ```APIDOC ## Get Report Details ### Description Retrieves detailed information about a specific report including its configuration and data. ### Method GET ### Endpoint `/report/{report_id}` (This is an assumed endpoint based on the code usage, actual endpoint might vary) ### Parameters #### Path Parameters - **report_id** (string) - Required - The ID of the report to retrieve. ### Response #### Success Response (200) - **title** (string) - The title of the report. - **form_id** (string) - The ID of the form associated with the report. - **list_type** (string) - The type of the report (e.g., 'csv', 'excel'). - **status** (string) - The current status of the report. - **url** (string) - The URL to access the report. - **created_at** (string) - The timestamp when the report was created. - **fields** (string) - A comma-separated string of question IDs included in the report (if applicable). - **isProtected** (boolean) - Indicates if the report is password protected. #### Response Example ```json { "title": "Survey Responses Q1 2024", "form_id": "987654", "list_type": "csv", "status": "completed", "url": "https://www.jotform.com/uploads/username/report/9876543210.csv", "created_at": "2024-01-15T10:30:00Z", "fields": "1,2,3,4,5", "isProtected": false } ``` ``` -------------------------------- ### Get Submissions Source: https://github.com/jotform/jotform-api-python/blob/master/README.md Retrieves submissions across all forms for the authenticated user. Supports filtering and pagination. ```APIDOC ## GET /submissions ### Description Retrieves submissions from all forms associated with the authenticated user. This endpoint allows for comprehensive filtering, sorting, and pagination of all submissions. ### Method GET ### Endpoint /submissions ### Parameters #### Query Parameters - **limit** (int) - Optional - The maximum number of submissions to return. - **offset** (int) - Optional - The number of submissions to skip before starting to collect the result set. - **filter** (dict) - Optional - A dictionary to filter submissions across all forms. Keys can include field names with operators (e.g., 'id:gt', 'form_id'). - **orderby** (string) - Optional - The field to sort the results by (e.g., 'created_at'). ### Request Example ```python from jotform import * jotformAPIClient = JotformAPIClient('YOUR API KEY') submissions = jotformAPIClient.get_submissions(limit=100, offset=0, filter={'created_at': 'DATE'}, orderby='created_at') print(submissions) ``` ### Response #### Success Response (200) - **submissions** (list) - A list of submission objects from various forms, each containing submission details. #### Response Example ```json { "submissions": [ { "id": "9876543210", "created_at": "2023-10-26 15:30:00", "form_id": "1234567890" }, { "id": "9876543211", "created_at": "2023-10-25 14:00:00", "form_id": "0987654321" } ] } ``` ``` -------------------------------- ### Get Folder Details Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieves detailed information about a specific folder, including the forms contained within it. ```APIDOC ## Get Folder Details ### Description Retrieve detailed information about a specific folder including forms within it. ### Method GET ### Endpoint `/folder/{folder_id}` (This is an assumed endpoint based on the code usage, actual endpoint might vary) ### Parameters #### Path Parameters - **folder_id** (string) - Required - The ID of the folder to retrieve details for. ### Response #### Success Response (200) - **name** (string) - The name of the folder. - **color** (string) - The color assigned to the folder. - **path** (string) - The hierarchical path of the folder. - **forms** (array) - An array of form objects contained within the folder. - **id** (string) - The ID of the form. - **title** (string) - The title of the form. - **subfolders** (array) - An array of subfolder IDs contained within this folder. #### Response Example ```json { "name": "Customer Surveys", "color": "#3498db", "path": "/Customer Surveys", "forms": [ { "id": "987654", "title": "New Customer Onboarding" }, { "id": "112233", "title": "Feedback Survey" } ], "subfolders": [ "12345_sub1", "12345_sub2" ] } ``` ``` -------------------------------- ### Login Jotform User and Get API Key with Python Source: https://context7.com/jotform/jotform-api-python/llms.txt Authenticates a user and retrieves API credentials for application access. Requires the `jotform` library. It takes a dictionary with username, password, appName, and access level, returning an API key and user information. ```python from jotform import JotformAPIClient client = JotformAPIClient() # No API key needed for login credentials = { 'username': 'myusername', 'password': 'mypassword', 'appName': 'MyApplication', 'access': 'full' } try: result = client.login_user(credentials) print(f"Login successful!") print(f"API Key: {result['appKey']}") print(f"Username: {result['username']}") print(f"Email: {result['email']}") # Use the returned API key for subsequent requests authenticated_client = JotformAPIClient(result['appKey']) except Exception as e: print(f"Error logging in: {e}") ``` -------------------------------- ### Get All Reports Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieves all reports associated with the authenticated user across all forms. Requires a JotformAPIClient instance. Outputs the total number of reports and details for each report. ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') try: reports = client.get_reports() print(f"Total reports: {len(reports)}") for report_id, report_data in reports.items(): print(f"\nReport ID: {report_id}") print(f"Title: {report_data.get('title', 'Untitled')}") print(f"Form ID: {report_data.get('form_id', 'N/A')}") print(f"Type: {report_data.get('list_type', 'Unknown')}") print(f"URL: {report_data.get('url', 'N/A')}") except Exception as e: print(f"Error fetching reports: {e}") ``` -------------------------------- ### Get Account Usage Statistics in Python Source: https://context7.com/jotform/jotform-api-python/llms.txt Fetches and displays monthly usage statistics for a JotForm account, including total submissions, SSL submissions, payment submissions, and upload storage usage. Includes basic error handling. ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') try: usage = client.get_usage() print(f"Total Submissions: {usage['submissions']}") print(f"SSL Submissions: {usage.get('ssl_submissions', 0)}") print(f"Payment Submissions: {usage.get('payments', 0)}") print(f"Upload Space Used: {usage.get('uploads', '0 MB')}") except Exception as e: print(f"Error fetching usage: {e}") ``` -------------------------------- ### Get Folders Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieves all form folders for the authenticated account, including shared folders. Requires a JotformAPIClient instance. Outputs the number of folders found and their details. ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') try: folders = client.get_folders() if folders: print(f"Found {len(folders)} folder(s):") for folder_id, folder_data in folders.items(): print(f"Folder ID: {folder_id}") print(f"Name: {folder_data.get('name', 'Unnamed')}") print(f"Owner: {folder_data.get('owner', 'You')}") print(f"Color: {folder_data.get('color', 'Default')}") print(f"Parent: {folder_data.get('parent', 'Root')}") print("---") else: print("No folders found") except Exception as e: print(f"Error fetching folders: {e}") ``` -------------------------------- ### Get Form Submissions Source: https://github.com/jotform/jotform-api-python/blob/master/README.md Retrieves submissions for a specific form. Supports filtering and pagination. ```APIDOC ## GET /form/{form_id}/submissions ### Description Retrieves all submissions for a specified form. You can control the number of submissions returned and apply filters. ### Method GET ### Endpoint /form/{form_id}/submissions ### Parameters #### Path Parameters - **form_id** (string) - Required - The ID of the form for which to retrieve submissions. #### Query Parameters - **limit** (int) - Optional - The maximum number of submissions to return. - **offset** (int) - Optional - The number of submissions to skip before starting to collect the result set. - **filter** (dict) - Optional - A dictionary to filter submissions. Keys can include field names with operators (e.g., 'id:gt'). - **orderby** (string) - Optional - The field to sort the results by (e.g., 'created_at'). ### Request Example ```python from jotform import * jotformAPIClient = JotformAPIClient('YOUR API KEY') submissions = jotformAPIClient.get_form_submissions('1234567890', limit=100, orderby='created_at') print(submissions) ``` ### Response #### Success Response (200) - **submissions** (list) - A list of submission objects, where each object contains the data for a single submission. #### Response Example ```json { "submissions": [ { "id": "9876543210", "created_at": "2023-10-26 15:30:00", "form_id": "1234567890" } ] } ``` ``` -------------------------------- ### Get Forms Source: https://github.com/jotform/jotform-api-python/blob/master/README.md Retrieves a list of forms associated with the authenticated user. Supports filtering and pagination. ```APIDOC ## GET /forms ### Description Retrieves a list of all forms belonging to the authenticated user. This endpoint supports optional parameters for filtering, sorting, and pagination. ### Method GET ### Endpoint /forms ### Parameters #### Query Parameters - **limit** (int) - Optional - The maximum number of forms to return. - **offset** (int) - Optional - The number of forms to skip before starting to collect the result set. - **filter** (dict) - Optional - A dictionary to filter forms. Keys can include field names with operators (e.g., 'id:gt'). - **orderby** (string) - Optional - The field to sort the results by (e.g., 'created_at'). ### Request Example ```python from jotform import * jotformAPIClient = JotformAPIClient('YOUR API KEY') forms = jotformAPIClient.get_forms(limit=10, offset=0, filter={'id:gt': 'FORM ID'}, orderby='created_at') print(forms) ``` ### Response #### Success Response (200) - **forms** (list) - A list of form objects, where each object contains details about a form (e.g., id, title, created_at). #### Response Example ```json { "forms": [ { "id": "1234567890", "title": "My First Form", "created_at": "2023-01-01 10:00:00" } ] } ``` ``` -------------------------------- ### Get All Form Questions with Python Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieves all questions and their configurations from a specified Jotform form. This function is useful for understanding the structure of a form and its fields. It handles different question types and optional fields like validation and options. ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') form_id = '123456789' try: questions = client.get_form_questions(form_id) for qid, question in questions.items(): print(f"Question ID: {qid}") print(f"Type: {question['type']}") print(f"Text: {question['text']}") print(f"Required: {question.get('required', 'No')}") if question['type'] == 'control_dropdown': print(f"Options: {question.get('options', '')}") if 'validation' in question: print(f"Validation: {question['validation']}") print("---") except Exception as e: print(f"Error fetching questions: {e}") ``` -------------------------------- ### Get User Account Details Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieve account information for the authenticated user including account type, avatar, email, website, and usage limits. ```APIDOC ## Get User Account Details Retrieve account information for the authenticated user including account type, avatar, email, website, and usage limits. ### Method GET ### Endpoint /user ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') try: user_info = client.get_user() print(f"Username: {user_info['username']}") print(f"Email: {user_info['email']}") print(f"Account Type: {user_info['account_type']}") print(f"Website: {user_info.get('website', 'Not set')}") print(f"Avatar URL: {user_info.get('avatarUrl', 'No avatar')}") print(f"Status: {user_info['status']}") except Exception as e: print(f"Error fetching user info: {e}") ``` ### Response #### Success Response (200) - **username** (string) - The username of the account. - **email** (string) - The email address associated with the account. - **account_type** (string) - The type of Jotform account (e.g., 'bronze', 'silver', 'gold'). - **website** (string, optional) - The website associated with the account. - **avatarUrl** (string, optional) - The URL of the user's avatar. - **status** (string) - The status of the account (e.g., 'active'). #### Response Example ```json { "username": "johndoe", "email": "john.doe@example.com", "account_type": "gold", "website": "https://example.com", "avatarUrl": "https://www.jotform.com/uploads/johndoe/avatar.png", "status": "active" } ``` ``` -------------------------------- ### Get Account Usage Statistics Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieve monthly usage statistics including form submissions, SSL submissions, payment submissions, and upload storage usage. ```APIDOC ## Get Account Usage Statistics Retrieve monthly usage statistics including form submissions, SSL submissions, payment submissions, and upload storage usage. ### Method GET ### Endpoint /user/usage ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') try: usage = client.get_usage() print(f"Total Submissions: {usage['submissions']}") print(f"SSL Submissions: {usage.get('ssl_submissions', 0)}") print(f"Payment Submissions: {usage.get('payments', 0)}") print(f"Upload Space Used: {usage.get('uploads', '0 MB')}") except Exception as e: print(f"Error fetching usage: {e}") ``` ### Response #### Success Response (200) - **submissions** (integer) - The total number of submissions made this month. - **ssl_submissions** (integer, optional) - The number of SSL submissions. - **payments** (integer, optional) - The number of payment submissions. - **uploads** (string, optional) - The amount of upload space used (e.g., '100 MB'). #### Response Example ```json { "submissions": 500, "ssl_submissions": 100, "payments": 10, "uploads": "250 MB" } ``` ``` -------------------------------- ### GET /user/forms Source: https://github.com/jotform/jotform-api-python/blob/master/jotform.html Retrieves a list of forms for the authenticated user. This endpoint is similar to /forms but may be intended for a different context or include additional details not specified. ```APIDOC ## GET /user/forms ### Description Get a list of forms for this account. Basic details such as title of the form, when it was created, number of new and total submissions. ### Method GET ### Endpoint /user/forms ### Parameters #### Query Parameters - **offset** (string) - Optional - Start of each result set for form list. - **limit** (string) - Optional - Number of results in each result set for form list. - **filterArray** (array) - Optional - Filters the query results to fetch a specific form range. - **order_by** (string) - Optional - Order results by a form field name. ### Response #### Success Response (200) - **forms** (array) - List of form objects. - **title** (string) - The title of the form. - **created_at** (string) - The date and time the form was created. - **new_submissions** (integer) - The number of new submissions for the form. - **total_submissions** (integer) - The total number of submissions for the form. ### Response Example ```json { "forms": [ { "title": "Contact Form", "created_at": "2023-10-26T15:30:00Z", "new_submissions": 2, "total_submissions": 50 } ] } ``` ``` -------------------------------- ### Get User Account Details in Python Source: https://context7.com/jotform/jotform-api-python/llms.txt Retrieves and prints user account information such as username, email, account type, website, avatar URL, and status using the JotformAPIClient. Includes basic error handling. ```python from jotform import JotformAPIClient client = JotformAPIClient('YOUR_API_KEY_HERE') try: user_info = client.get_user() print(f"Username: {user_info['username']}") print(f"Email: {user_info['email']}") print(f"Account Type: {user_info['account_type']}") print(f"Website: {user_info.get('website', 'Not set')}") print(f"Avatar URL: {user_info.get('avatarUrl', 'No avatar')}") print(f"Status: {user_info['status']}") except Exception as e: print(f"Error fetching user info: {e}") ```