Guides

Find The Right Submission Pattern For Your Stack

Each guide gives you the key information for a specific stack: what to call, what to send, where the key should live, and how the form can align with your site's theme tokens. For CRM and posting engine scenarios, that same flow can be sent as JSON, XML, or form data instead of a browser UI.

Browser-First

Best for plain HTML, JavaScript, React, Vue, Angular, and Svelte. These are the fastest paths, but the browser sees the API key, so approved-domain controls stay important.

Server-Side

Best for PHP, Node/Express, the wider Microsoft web stack, and CRM or posting engine platforms. The hosting app or integration platform keeps the API key private and forwards the validated inquiry payload to the partner endpoint.

CMS-Friendly

WordPress belongs here. The plugin starter keeps the key on the WordPress server and gives site owners a shortcode-based path they can drop into any page builder.

Implementation Note

These resources assume you are already proficient with the technology you plan to use. If that is not the case, use the contact form.

Contact Partner Support

Browser

Browser Guides

Client-side integration works best when you want the form to live directly inside the host page and inherit the surrounding design language.

Plain HTML

Hosted Widget For Plain HTML

Use the hosted widget when you want a copy-paste form without writing JavaScript. This is the best answer for static sites and page builders.

  • Drop a div and script tag into the page.
  • Set your API base URL and API key in script data attributes.
  • Use the Widget Configurator to preview colors and copy the embed snippet.
API Key: The key is visible in the page source, so this path depends on your domain whitelist for protection.
HTML + JavaScript

Custom HTML And JavaScript Form

Build your own markup and submit it with fetch. Use this path when you want full control over layout, copy, and host-site styling.

  • Fetch active case types from the public case-type endpoint.
  • POST JSON to /api/leads with the required fields.
  • Use the shared token file to keep button, border, and text styling consistent.
API Key: The browser sends the API key, so keep the approved domains list current and avoid posting from untrusted origins.
React

React Component

Use a reusable component with useEffect and useState when the form belongs inside an existing SPA or marketing site built in React.

  • Load case types on mount.
  • Bind form state to controlled inputs.
  • Submit and show inline success or error feedback.
API Key: This stays client-side, so the API key remains in the bundle and the registered domain list is your guardrail.
Vue

Vue Single File Component

Ideal for Vue and Nuxt frontends that want a lightweight component with the same token-ready visual system as the hosted widget.

  • Fetch case types in onMounted.
  • Use ref-driven form state for the required fields.
  • Style the wrapper with the shared token names or your own local overrides.
API Key: This is still a browser integration, so keep the key scoped to approved domains only.
Angular

Angular Standalone Component

A strong fit for internal marketing apps and larger Angular sites that already rely on reactive forms and typed services.

  • Load case types through HttpClient.
  • Use a reactive form with validation on all required fields.
  • Keep the component styles token-based so it can blend into the host theme.
API Key: Angular compiles to browser code too, so treat the key exactly like the other client-side examples.
Svelte

Svelte Component

Great for fast, minimal form experiences where you want simple reactivity and a very small integration surface.

  • Load case types in onMount.
  • Track form and result state with simple local variables.
  • Override tokens in a local wrapper to align the card and inputs with your theme.
API Key: This remains a browser-side integration, so the domain whitelist is still the primary protection.

Server

Server Guides

Server-side examples are the strongest option when you control the backend and want the partner API key to stay private.

CRM / API

CRM Or Posting Engine Direct Post

Use this when a CRM, webhook engine, or lead marketplace can post directly to the partner API. This path is built for JSON, XML, and classic form-style payloads.

  • Call GET https://partners.dipetrillolaw.com/api/leads/casetypes first so you have a valid caseTypeId.
  • POST to https://partners.dipetrillolaw.com/api/leads with X-Api-Key and choose JSON, XML, or form data.
  • Store the returned leadId and status so your system can audit or reconcile submissions.
Authentication: This works only when the platform can send a custom X-Api-Key header or store secrets safely. If it cannot, use a server-side adapter instead.
PHP

PHP Form Handler

Use a single PHP file or fold the handler into an existing site. The browser posts only to your PHP page, and PHP forwards the inquiry to the partner API.

  • Render the form in PHP or plain HTML.
  • Post to your own PHP handler.
  • Use cURL server-side to forward the payload with the private API key.
Security: The API key stays on the PHP server, which makes this a stronger option than any browser-only integration.
Node / Express

Node And Express Proxy

Use a simple Express route when you already own a Node backend or want a middle layer between the browser form and the partner API.

  • Accept a local POST from your frontend.
  • Validate and normalize the body inside Express.
  • Forward the request with the private key from an environment variable.
Security: The key never leaves the server, which makes this the recommended path for custom Node stacks.
ASP.NET Core

ASP.NET Core / Microsoft Stack Adapter

Use the same server-side pattern across ASP.NET Core MVC, Razor Pages, Blazor, minimal APIs, or other .NET web apps. The host application validates locally and forwards the payload with a private key.

  • Load case types from the public endpoint or cache them server-side.
  • Collect the lead in your controller, page handler, component, or endpoint.
  • Forward the request with HttpClient from the server tier so the key stays private.
Security: When the post happens server-side, the key remains in configuration and never reaches the browser.

CMS

CMS Guide

WordPress deserves its own path because it often needs a shortcode, settings surface, and server-side forwarding in one package.

WordPress

WordPress Plugin

Use the installable plugin when you want a normal WordPress admin flow with no PHP editing. Upload it, configure the settings page, and paste the shortcode into any page or block.

  • Download the plugin zip and upload it under Plugins > Add New > Upload Plugin.
  • Activate it, then open Settings > DiPetrillo Affiliate to enter the Affiliate Site URL, for example https://example.com, and your API key.
  • Paste [dp_affiliate_lead_form] into the page, post, or block where you want the form to appear.
Security: The plugin keeps the API key on the WordPress server, which is the right long-term pattern for WordPress sites.

WordPress How-To

WordPress Admin Quick Start

This path is meant for a normal WordPress site admin. If you can install plugins and edit pages, you can use this without touching PHP.

Step By Step

Install And Publish The Form

  1. Download the plugin zip from this page.
  2. In WordPress, go to Plugins > Add New > Upload Plugin.
  3. Choose the zip file, install it, and click Activate.
  4. Open Settings > DiPetrillo Affiliate and paste your Affiliate Site URL as https://example.com, then paste your API key.
  5. Create or edit the page where you want the form, then paste [dp_affiliate_lead_form] into a Shortcode block or page builder text area.
  6. Open the page and submit one test lead to confirm everything is working.
What You Need

Before You Start

  • You need a WordPress account that can install and activate plugins.
  • You need your Affiliate Site URL, for example https://example.com, and your API key.
  • The plugin includes a settings screen, so there is no PHP editing.
  • If you can only edit pages but cannot install plugins, ask the site admin to upload it once for you.

Start With The Stack You Already Own

Pick the guide that matches your site, then grab the matching starter file and token stylesheet.