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.2.tar.gz (12.4 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.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spida_api-1.0.2.tar.gz
  • Upload date:
  • Size: 12.4 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.2.tar.gz
Algorithm Hash digest
SHA256 3099b5e6da1b06f21ff27bea9e8e895cb3da820934f75068651bffefa49081d8
MD5 b0c3c5e6168389bdd465a844a011cd00
BLAKE2b-256 2da5c26361cd55ac43e33b93bae7aa946683ef480b5aac6fcd9f9596c858a1c5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: spida_api-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 54f14980ebea0c8aa80cd9523570f974b377ccb40b1fa418b380e5e851de4c92
MD5 901e57c0c93a661dce2934543637b4a0
BLAKE2b-256 34eb66999caf59f35f33d101b4ae79ebfe9df54ceadabcbb8f84f00d1b4b70a9

See more details on using hashes here.

Provenance

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