How it works

    Let’s take an example to understand how Plivo XML works. Consider a usecase where you want to reply to an incoming SMS.

    The diagram below outlines a typical case where XML is used: Plivo XML Overview

    Here’s how the message flow works.

    An incoming SMS is received on a Plivo number and is connected through the Plivo SMS Platform. Plivo then looks up your message_url configured for the Application that is linked to the Plivo number and makes a request to that URL. Your web application at that URL should return an XML document that provides instructions to the Plivo API on how the SMS should be handled. In this case, it should return an message XML to reply to the incoming SMS.

    In this example, Plivo works like an HTTP Client which receives the SMS and requests your web application for instructions to control the SMS. By default, XML requests to your application are made via POST. However, you can configure Plivo to make its XML requests to your application via HTTP GET or POST by changing the related configuration parameter.

    You can set these configuration parameters while sending out a message. To deal with incoming messages, Plivo uses the configuration attached to the Application that is linked to the phone number on which your incoming message is being received.