Contents
On this page

Confirm Lead Opt-in - Plugixa CRM

GET /plugixa-crm/v1/lead-capture/confirm/{token}

The link in a double opt-in e-mail. Opening it confirms the address, creates the lead if it was waiting for this, and redirects to the page the form was on.

Public: no sign-in. The token is the proof. This route keeps working while the Web forms app is off, so links already sent can still be confirmed.

Note. Opening a link that was already confirmed confirms it again: the visitor is redirected as confirmed.

Request

GET https://your-site.example/wp-json/plugixa-crm/v1/lead-capture/confirm/9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c

Path parameters

Name Type Description
token string The 64-character token from the e-mail

Responses

303 See Other. Always a redirect, never JSON.

HTTP/1.1 303 See Other
Location: https://your-site.example/contact?plugixa-crm-optin=confirmed
Cache-Control: no-store, no-cache, must-revalidate

plugixa-crm-optin tells the page what happened: confirmed, or, sent to the home page, expired when the link is past the form’s opt-in window and invalid when the token is unknown.

Errors

Status Code When
404 rest_no_route The token is not 64 lowercase hexadecimal characters.

Plus the errors every endpoint can return.

Examples

curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" "https://your-site.example/wp-json/plugixa-crm/v1/lead-capture/confirm/9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-crm/v1/lead-capture/confirm/9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER         => true,
    CURLOPT_FOLLOWLOCATION => false,
]);
curl_exec($ch);
$location = curl_getinfo($ch, CURLINFO_REDIRECT_URL);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-crm/v1/lead-capture/confirm/9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c9f2c', {
  redirect: 'manual',
});
const location = response.headers.get('location');

Quick Links

Share