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-dev.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.5.tar.gz (14.9 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.5-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spida_api-1.0.5.tar.gz
  • Upload date:
  • Size: 14.9 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.5.tar.gz
Algorithm Hash digest
SHA256 fd529a614449a7096a1cdd2d79525e1f127a6caa5a5533c3bdea029e3f0cc924
MD5 30dde1aae692c759e56e65502f234c2f
BLAKE2b-256 0421f9f0da0e036b43ff494121d50f20e3ebff9612c36488866f30be6dfd40aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for spida_api-1.0.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: spida_api-1.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4ac463981e5c70a4469dc31ad4e7d82bf197e302e854db4177175d07adcc5edd
MD5 f90add8a45ec891da47b1e2266923bf6
BLAKE2b-256 5916570fc16448930dae5752cfaa1483ea06a7e6296914ed265504afb5f93744

See more details on using hashes here.

Provenance

The following attestation bundles were made for spida_api-1.0.5-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