Form Pre-filling via URL, JWT or API on Your Website

Form Pre-filling (via URL/API) on Your Website

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • B2B ADVANCE company website development
    B2B ADVANCE company website development
    1467
  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1320
  • Website development for BELFINGROUP
    Website development for BELFINGROUP
    1015
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1276
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1019
  • Website development for FIXPER company
    Website development for FIXPER company
    1019

Form Pre-filling (via URL/API) on Your Website

Imagine a client booking a tour — a 20-field form. Without pre-filling, they spend 5–7 minutes, and errors in the phone or address wreck the deal. We solve this by pre-filling data from URL parameters, JWT tokens, or API. The client sees a partially filled form and just needs to check and submit.

We develop such solutions turnkey — from analysis to deployment. Average timeline: 1 to 4 days depending on complexity. Over 5 years, we've automated forms for lead generation and CRM, implemented pre-filling for 30+ projects. Average fill time reduced by 40%, conversion increased by 25–50%. We guarantee data security: we use proven protection mechanisms (XSS sanitization, signed JWT, strict server-side validation). Our experience is backed by dozens of successful deployments.

Benefits of Pre-filling

  • The user spends 5 times less time on the form.
  • Input error rate decreases by 30%.
  • Target action conversion increases by 20–50%.

Comparison of Pre-filling Methods

Method Security Complexity Implementation time
URL parameters Low (XSS, leakage) Low 1 day
JWT token High (signature, encryption) Medium 2–3 days
API request (by token) High (server validation) Medium 2–4 days

How to Protect the Form from XSS with URL Pre-filling?

URL parameters are the fastest method, but they are vulnerable. We apply a whitelist of allowed fields and sanitize each value. Example in vanilla JavaScript:

function prefillFromURL() { const params = new URLSearchParams(window.location.search); const allowed = ['name', 'email', 'phone', 'company', 'plan', 'promo']; for (const field of allowed) { const value = params.get(field); if (!value) continue; const el = document.querySelector(`[name="${field}"]`); if (!el) continue; el.value = DOMPurify.sanitize(value, { ALLOWED_TAGS: [] }); el.dispatchEvent(new Event('input', { bubbles: true })); } } document.addEventListener('DOMContentLoaded', prefillFromURL); 

OWASP XSS Prevention Cheat Sheet recommendations confirm the need for such sanitization.

Why JWT is Better Than Open Parameters?

JWT token encrypts data and is signed by the server. Even if the link is intercepted, it's impossible to change the content without knowing the secret. JWT is 3 times more secure than open parameters due to cryptographic signature. On the server (Laravel) we decode the token and return data only after signature verification:

public function decodePrefillToken(Request $request) { try { $payload = JWT::decode($request->token, new Key(config('app.key'), 'HS256')); return response()->json((array) $payload->form_data); } catch (\Exception $e) { return response()->json(['error' => 'Invalid token'], 422); } } 

Link generation for email:

$payload = [ 'form_data' => [ 'name' => $user->name, 'email' => $user->email, 'plan' => 'pro', ], 'exp' => now()->addHours(24)->timestamp, ]; $token = JWT::encode($payload, config('app.key'), 'HS256'); $link = route('form') . '?token=' . $token; 

When to Use Which Method?

Situation Recommended method Rationale
Non-sensitive data (promo code, referral) URL parameters Fast, simple
Data from email campaigns (phone, name) JWT token Security, integrity
Authenticated user API request Dynamic loading from profile

Pre-filling from API for Authenticated Users

If the user is already logged in, the form can load their profile. We set up field mapping and use reset() from React Hook Form:

function ApplicationForm({ userId }) { const { register, reset, handleSubmit } = useForm(); useEffect(() => { async function load() { const res = await fetch(`/api/users/${userId}/prefill`); const data = await res.json(); reset(data); } if (userId) load(); }, [userId, reset]); return ( <form onSubmit={handleSubmit(onSubmit)}> <input {...register('name')} placeholder="Name" /> <input {...register('email')} placeholder="Email" /> </form> ); } 

How We Do It: Work Process

  1. Analytics — define fields, data sources, security requirements.
  2. Design — choose method (URL/JWT/API), prepare mapping.
  3. Development — write backend handlers and frontend logic.
  4. Testing — check XSS resistance, mapping correctness, UX.
  5. Deployment — deploy to production, perform load testing.

Typical Mistakes (and How We Avoid Them)

  • Unchecked whitelist of fields — an attacker could insert is_admin=true. We always set an explicit allowlist.
  • Lack of sanitization — we pass every value through DOMPurify.
  • Ignoring pre-fill indication — the user doesn't know data is already inserted. We add a CSS class field--prefilled and a check mark icon.
  • Trusting a token without server-side validation — we always check signature and expiration.
Step-by-step implementation of JWT pre-filling in Laravel
  1. Create a token generation endpoint (POST /api/prefill-token). Accepts an array of fields and returns a signed JWT.
  2. On the frontend, add handling of the ?token= parameter — decode it and fill the fields.
  3. Implement a middleware that checks the signature and expiration on every call.
  4. Test with various scenarios (expired token, invalid signature).

What's Included in the Deliverable

  • Configured pre-filling mechanism (URL/JWT/API).
  • API endpoints with documentation.
  • Source code with comments.
  • Security testing (XSS, CSRF).
  • Integration guide for existing projects.

Timeline and Cost

Timelines depend on the chosen method: from 1 day for simple URL to 4 days for a comprehensive solution with JWT and API. Cost is calculated individually. Assess your project — contact us. Order turnkey form pre-filling implementation. Get a free consultation for your project.

Note: all code examples above are for illustration. In a real project, we adapt them to your stack (Laravel, React, Vue, etc.) and security requirements.