Unsubscribe endpoint

Updated on Jan 11, 2023

This endpoint allows you to unsubscribe or opt-out of SMS messages. This endpoint can be useful if you no longer want to receive SMS messages, or if you need to unsubscribe from SMS messages for any other reason.

POST  /wp-json/wpsms/v1/newsletter/unsubscribe?name=YourName&mobile=YourMobile

Request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'http://site.com/wp-json/wpsms/v1/newsletter/unsubscribe?name=Kimberly%20S.%20Okeefe&mobile=0911111113&group_id=5',
  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 ***',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Response

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