Data privacy is a key concern for every organization that processes third-party personal data, including phone numbers. With the GDPR now in effect, data privacy holds more importance today than ever.
Plivo provides SMS redaction features to customers interested in limiting how their outbound and inbound SMS usage data is retained on Plivo’s servers and databases.
Outbound SMS redaction
When outbound SMS message redaction is enabled:
The last three digits of the destination number are redacted (replaced with ***).
The actual message content is redacted and replaced with ***Text Content Redacted***.
Redaction is applied on
Server logs
Console debug logs
Console debug UI
Customer callbacks
Console logs UI
How to enable outbound SMS and MMS redaction
Plivo offers a simple way to redact the content and destination number of an outbound SMS or MMS message. Set the log request parameter of the Send SMS API request to false. The default value is true: outbound messages are not redacted unless the log request parameter is explicitly set to false.
We also support partial redaction of your messaging data. To enable partial redaction,
set the log request parameter of the Send SMS API request to content_only to log message content and redact the phone numbers; or,
set the log request parameter of the Send SMS API request to number_only to log phone number data and redact the message content.
Please note that if the redaction is enabled, Plivo cannot debug or recover the message content if there are any issues.
importplivoclient=plivo.RestClient('<auth_id>','<auth_token>')response=client.messages.create(src='14092102231',# Sender's phone number with country code
dst='19177220741',# Receiver's phone Number with country code
text='hello, test message!',log=False)print(response)# print str(resp)
1
2
3
4
5
6
7
8
9
10
11
require"plivo"includePlivoapi=RestClient.new("<auth_id>","<auth_token>")response=api.messages.create(src:"<sender_id>",dst:"<destination_number>",text:"Hello, this is a sample text",url: "https://<yourdomain>.com/sms_status/",log:false)putsresponse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Example for Message createvarplivo=require('plivo');(functionmain(){'use strict';// If auth id and auth token are not specified, Plivo will fetch them from the environment variables.varclient=newplivo.Client("<auth_id>","<auth_token>");client.messages.create({src:"14092102231",dst:"19177220741",text:"hello, test message!",log:'false'}).then(function(response){console.log(response);},function(err){console.error(err);});})();
<?phprequire'vendor/autoload.php';usePlivo\RestClient;usePlivo\Exceptions\PlivoRestException;$client=newRestClient("<auth_id>","<auth_token>");try{$response=$client->messages->create(["src"=>"+12025550000","dst"=>"+12025551111","text"=>"Hello, this is a sample text","url"=>"https://<yourdomain>.com/sms_status/","log"=>"false"]);print_r($response);}catch(PlivoRestException$ex){print_r($ex);}
packagecom.plivo.api.samples.message;importjava.io.IOException;importjava.util.Collections;importcom.plivo.api.Plivo;importcom.plivo.api.exceptions.PlivoRestException;importcom.plivo.api.models.message.Message;importcom.plivo.api.models.message.MessageCreateResponse;/**
* Example for Message create
*/classExample{publicstaticvoidmain(String[]args){Plivo.init("<auth_id>","<auth_token>");try{MessageCreateResponseresponse=Message.creator("14092102231",Collections.singletonList("19177220741"),"hello, test message!").log(false).create();System.out.println(response);}catch(PlivoRestException|IOExceptione){e.printStackTrace();}}}
// Example for Message createpackagemainimport("fmt""github.com/plivo/plivo-go/v7")funcmain(){client,err:=plivo.NewClient("<auth_id>","<auth_token>",&plivo.ClientOptions{})iferr!=nil{fmt.Print("Error",err.Error())return}response,err:=client.Messages.Create(plivo.MessageCreateParams{Src:"14092102231",Dst:"19177220741",Text:"hello, test message!",Log:"false",},)iferr!=nil{fmt.Print("Error",err.Error())return}fmt.Printf("Response: %#v\n",response)}
usingSystem;usingSystem.Collections.Generic;usingPlivo;usingPlivo.Exception;namespaceSend_Sms{classProgram{publicstaticvoidMain(string[]args){varapi=newPlivoApi("<auth_id>","<auth_token>");try{varresponse=api.Message.Create(src:"14092102231",dst:newList<String>{"19177220741"},text:"hello, test message!",log:false);Console.WriteLine(response);}catch(PlivoRestExceptione){Console.WriteLine("Exception: "+e.Message);}}}}
The last three digits of the originating number are redacted (replaced with ***).
The actual message content is redacted and replaced with ***Text Content Redacted***.
Redaction is applied on
Server logs
Console debug logs
Console debug UI
Console logs UI
Inbound MMS redaction
When inbound message redaction is enabled:
The source number is redacted in logs and in the Message Detail Record (MDR).
Hyperlinks for attached media are logged anywhere on Plivo server logs, including callback logs.
Media subresources for the received media are created and will remain accessible. They may be deleted by explicitly invoking the Delete Media API to delete the media files hosted on Plivo servers.
How to enable inbound SMS and MMS redaction
You can control inbound SMS and MMS redaction at the application level.
Setting the application-level flag log_incoming_messages to
false enables redaction. The default value is
true, so inbound messages are not redacted unless the flag is explicitly set to
false. The text and from_number fields are redacted when redaction is enabled.
When message redaction is enabled for an application, incoming messages to Plivo phone numbers associated with the application are redacted.
Note: If inbound messages are redacted, Plivo cannot debug or recover message content if there are any issues with the callback URL.
## Example for Application Create#require'rubygems'require'plivo'includePlivoincludePlivo::Exceptionsapi=RestClient.new("<auth_id>","<auth_token>")beginresponse=api.applications.create('Test Application',answer_url: 'https://answer.url',answer_method: 'GET',log_incoming_messages: false)putsresponserescuePlivoRESTError=>eputs'Exception: '+e.messageend
// Example for Application createvarplivo=require('plivo');(functionmain(){'use strict';// If auth id and auth token are not specified, Plivo will fetch them from the environment variables.varclient=newplivo.Client("<auth_id>","<auth_token>");client.applications.create("Test Application",// app name{answerUrl:"https://answer.url",// answer urllogIncomingMessages:"false"}).then(function(response){console.log(response);},function(err){console.error(err);});})();
<?php/**
* Example for Application create
*/require'vendor/autoload.php';usePlivo\RestClient;usePlivo\Exceptions\PlivoRestException;$client=newRestClient("<auth_id>","<auth_token>");try{$response=$client->applications->create('Test Application',['answer_url'=>'https://answer.url','answer_method'=>'POST','log_incoming_messages'=>'false']);print_r($response);}catch(PlivoRestException$ex){print_r($ex);}
packagecom.plivo.api.samples.application;importjava.io.IOException;importcom.plivo.api.Plivo;importcom.plivo.api.exceptions.PlivoRestException;importcom.plivo.api.models.application.Application;importcom.plivo.api.models.application.ApplicationCreateResponse;/**
* Example for Message create
*/classExample{publicstaticvoidmain(String[]args){Plivo.init("<auth_id>","<auth_token>");try{ApplicationCreateResponseresponse=Application.creator("Test Application").answerUrl("https://answer.url").logIncomingMessages(false).create();System.out.println(response);}catch(PlivoRestException|IOExceptione){e.printStackTrace();}}}
// Example for Application createpackagemainimport("fmt""github.com/plivo/plivo-go/v7")funcmain(){client,err:=plivo.NewClient("<auth_id>","<auth_token>",&plivo.ClientOptions{})iferr!=nil{fmt.Print("Error",err.Error())return}response,err:=client.Applications.Create(plivo.ApplicationCreateParams{AppName:"Test Application",AnswerURL:"https://answer.url",LogIncomingMessages:false,},)iferr!=nil{fmt.Print("Error",err.Error())return}fmt.Printf("Response: %#v\n",response)}