Newsletter Verify Endpoint

REST API endpoint to verify subscriber phone numbers via activation code.

This endpoint allows users to verify their phone numbers by entering an activation code sent via SMS. Once verified, the subscriber can receive SMS messages from the website.

Endpoint

POST /wp-json/wpsms/v1/newsletter/verify

Request Parameters

ParameterTypeRequiredDescription
namestringYesSubscriber’s name
mobilestringYesSubscriber’s mobile number
activationstringYesThe activation code received via SMS

Examples

cURL

curl --location --request POST 'https://site.com/wp-json/wpsms/v1/newsletter/verify?name=John&mobile=0911111113&activation=1857' \
--header 'Authorization: Basic YOUR_API_KEY'

PHP

<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://site.com/wp-json/wpsms/v1/newsletter/verify?name=John&mobile=0911111113&activation=1857',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic YOUR_API_KEY',
  ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;

Response

Success

{
    "message": "Your number has been successfully subscribed.",
    "error": []
}

Verification Flow

  1. User subscribes via the Newsletter Subscribe Endpoint
  2. System sends an SMS with an activation code
  3. User submits the code via this verification endpoint
  4. Upon successful verification, the subscriber is activated

Authentication

This endpoint requires authentication. Include the Authorization header with valid credentials.

Last updated: December 23, 2024