Skip to main content

No project description provided

Project description

SPIDA FORMS - API Library + Webhook & Form Manager

Overview

This project provides a Webhook & Form Manager for interacting with SPIDA Studio forms. The application allows users to:

  • Manage Webhooks: Register and unregister webhooks for form updates.
  • Edit Forms: Fetch and update SPIDA forms.
  • View Webhook Events: Monitor real-time webhook event logs.

This document provides instructions on how to set up and use the system.


API Library

Add to requirements.in

spida-api
# Read SPIDA API values from .env
SPIDA_SERVER = os.getenv("SPIDA_SERVER")
SPIDA_API_KEY = os.getenv("SPIDA_API_KEY")
SPIDA_USERNAME = os.getenv('SPIDA_USERNAME')
SPIDA_PASSWORD = os.getenv('SPIDA_PASSWORD')
SPIDA_COMPANY_ID = os.getenv('SPIDA_COMPANY_ID')

spida_api = SpidaAPI(SPIDA_USERNAME, SPIDA_PASSWORD, SPIDA_SERVER)
spida_api.switch_company(SPIDA_COMPANY_ID)

SPIDA Documentation

Form Templates

Form Name Template URL
Oncor Work Order Form (JUMR) Edit Template 849
Oncor JUFR Work Order Form Edit Template 951317

Installation & Setup

Prerequisites

Ensure you have the following installed:

  • Node.js (for local testing, if required)
  • Python & Flask (for backend services)

Environment Variables (.env)

Create a .env file in the project root and add the following credentials:

# Admin user for both (Ask Keagan/Logan)
SPIDA_USERNAME=
SPIDA_PASSWORD=
# Oncor
SPIDA_COMPANY_ID=145

# PROD
# SPIDA_SERVER=techserv.spidastudio.com
# SPIDA_API_KEY=

# TEST
SPIDA_SERVER=test-techserv.spidastudio.com
SPIDA_API_KEY=

Running the Server

# Clone the repository
git clone https://github.com/TechServ-Consulting-Training-Ltd/spida_api
cd spida_api

# Install dependencies
pip install -r requirements.txt

# Start the Flask server
python server.py

Running the Web App

The frontend runs directly in the browser using Babel. To start:

# Ensure you are in the project root
python -m http.server 8000

Then, open http://localhost:8000 in your browser.


Features & Usage

Manage Webhooks

  • View all registered webhooks.
  • Register a new webhook by providing a URL, channel, and event regex.
  • Unregister existing webhooks.

Example UI for Production: Webhook   Form Manager

Example Cloudwatch logs for Production: Pasted Graphic 19

To test webhook registrations:

  1. Navigate to the test SPIDA manager: Test Project Manager SPIDA UI: unknown
  2. Modify a form and submit changes.
  3. View logs to verify webhook events.

Webhook Expiration

We have a scheduler that hits a Lambda every 4 hours that refreshes all of our webhooks for another 24 hours.

Edit Forms

  • Retrieve a form by entering its Form ID.
  • Update form field values and submit changes.
  • View API responses directly in the UI.

View Webhook Events

  • Monitor incoming webhook events in real-time.
  • Uses WebSockets for dynamic updates.

Using Ngrok for Webhook Debugging

To test webhooks locally, use ngrok to expose your local server.

ngrok http 5003

Then register https://your-ngrok-url/webhooks as a webhook URL in the SPIDA UI.


Example Webhook Payload

{
  "channel": "Form",
  "eventName": "update:TEST_02_14_2025:Oncor Work Order Form",
  "hookId": "257b38c2-2d3b-4d14-b660-22feb8b2417a",
  "payload": {
    "form": {
      "fields": {
        "Email Subject Field": "Oncor Action Required: Need WR Approval in WMIS (WR Number shown below)",
        "Oncor Work Order Name": "3334452",
        "Oncor Work Order Number": "3334452"
      },
      "projectLevelRequiredFor": "PROJECT",
      "template": "849",
      "title": "Oncor Work Order Form"
    },
    "parentId": 15672587,
    "parentName": "TEST_02_14_2025",
    "projectId": 15672587,
    "projectName": "TEST_02_14_2025",
    "user": "kmcnew@techservltd.net"
  },
  "timestamp": 1739905831161
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spida_api-1.0.4.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spida_api-1.0.4-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file spida_api-1.0.4.tar.gz.

File metadata

  • Download URL: spida_api-1.0.4.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spida_api-1.0.4.tar.gz
Algorithm Hash digest
SHA256 73ad4ff0560f0698499a1d504883e5273884efa2243724bb01b6d6c378af5709
MD5 bfdccfe7303605cbbad3d6c07db38a71
BLAKE2b-256 92bd37f8623c7f2053518e0d6d97d2daf37c368473fe57e6c2e73f274b8f7483

See more details on using hashes here.

Provenance

The following attestation bundles were made for spida_api-1.0.4.tar.gz:

Publisher: publish.yml on TechServ-Consulting-Training-Ltd/spida-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spida_api-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: spida_api-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spida_api-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 81b768eb410eb199eae0135b3f1ae72f05b91aac4abf5f8c6a641f31e83fed59
MD5 9e5ecfb06de2f35400bcabe8f7f63f97
BLAKE2b-256 d05a752eda29e81f5c3de2ac659cde3ba128c8983e5ae347de8ddaea7d72016f

See more details on using hashes here.

Provenance

The following attestation bundles were made for spida_api-1.0.4-py3-none-any.whl:

Publisher: publish.yml on TechServ-Consulting-Training-Ltd/spida-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page