Subscriber opt out

**This section only affects Bulk Messaging using alphanumeric sender ids

The mobile subscriber may decide to opt out from receiving bulk messages from your alphanumeric sender id. The instructions on how to opt out are automatically appended to the first message you send to the mobile subscriber. From then onwards, any other message will be sent 'as is' to the subscriber.

The sent message status in the code will be "User In Blacklist" for users who have opted out as illustrated by the PHP code below:

Sending a Message

   <?php
     // This code can be found in the send message tutorial in the 'Sending' link above in the 'Tutorials' tab
	 :
	 :
	 :
	 :
	 : 
	//This code is within the try block of the send message sample code
	
  foreach($results as $result) {
    echo " Number: " .$result->number;
    echo " Status: " .$result->status; //This will have "User In Blacklist" string
    echo " MessageId: " .$result->messageId;
    echo " Cost: "   .$result->cost."\n";
	:
	:
	?>
  

If a subscriber opts out, we will send those details to your callback URL. You will need to register one with us so that we may update you.

To register User Optout callback url, please click here to get one

We will make a POST request with the following parameters:

  • senderId: This is the shortcode/alphanumeric sender id the user opted out from.
  • phoneNumber: This will contain the phone number of the subscriber who opted out.

User optout callback PHP sample code

   <?php
   
     $senderId = $_POST['senderId']; //This would contain the shortcode or the alphanumeric sender id
     $phoneNumber = $_POST['phoneNumber'];
	 
	 //Update your user list
	 
	?>