Search code examples
restsmsplivo

Plivo: get SMS message content with pull api


Based on the plivo docs for messages (e.g. https://www.plivo.com/docs/api/message/#get-details-of-all-messages ) it appears that the response for the REST API for retrieving SMS messages does not include the actual content of the message.

I want this functionality for testing purposes, but mostly I am curious why this is the case -- if I own the number and plivo is storing metadata about the texts, why can't I get the contents of the messages post-facto from plivo's servers? Is this a privacy feature? Or is there a way around this short of piping to my own server and pulling from that myself?


Solution

  • The API for retrieving Message details has only the meta-data of the messages. As a matter of internal policy, content of the SMS or Calls (unless explicitly recorded) are not stored.

    If it's an inbound message, the text is sent to the "message_url" and it can be stored from there. If it's an outbound message, you can see the contents of the sent messages in the Debug logs found in your Plivo dashboard (https://manage.plivo.com/logs/debug/?type=all). One other way of storing the content of an outbound message, is to store the details in a DB before sending the message and update the status of that message later on. The status of the message is sent to the "url" parameter (Delivery Report) of the outbound Message API.

    For your reference :

    Message API - https://www.plivo.com/docs/api/message/#send-a-message

    Handling Delivery Reports - https://www.plivo.com/docs/getting-started/sms-delivery-reports/