twiliotwilio-php

How to delete message logs in twilio trial account?


I am using twilio trial account for sending message and it generate SMS logs. I want to remove all SMS logs from my trial account of twilio. please help me.


Solution

  • You can use the PHP helper library to redact the body of a message, or delete the entire message resource:

    $client = new Services_Twilio('AC123', '123');
    $message = $client->account->messages->get("MM123");
    $message->redact(); // Erases 'Body' field contents
    $message->delete(); // Deletes entire message record
    

    More info on deleting message can be found in our docs.

    Hope that helps.