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
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Subscriber’s name |
mobile | string | Yes | Subscriber’s mobile number |
activation | string | Yes | The 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
- User subscribes via the Newsletter Subscribe Endpoint
- System sends an SMS with an activation code
- User submits the code via this verification endpoint
- Upon successful verification, the subscriber is activated
Authentication
This endpoint requires authentication. Include the Authorization header with valid credentials.
Related
- Newsletter Subscribe Endpoint - Subscribe users to newsletter
- wp_sms_subscriber_form() - Display subscriber form
Last updated: December 23, 2024