> For the complete documentation index, see [llms.txt](https://docs.kdc.in/storeivr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kdc.in/storeivr/sms/tfsc/mo.md).

# MO \[User Initiated]

Anytime a message originates from a sender, the following is sent to the Callback URL

The REST API provides the ability to the client applications to get directly connected with the TFSC platforms. The TFSC platform then submits the incoming requests to the client application over the HTTP/**HTTPS** API and waits for the return response from the API. The client application performs the necessary action based on the API inputs, and responds with the appropriate response message for the sender.

## Callback URL <a href="#callback" id="callback"></a>

{% hint style="danger" %}
CURRENTLY IN A PRIVATE BETA, SETTINGS AND VALUES MAY CHANGE WITHOUT PRIOR NOTICE. FOR ANY SUPPORT; PLEASE RAISE A TICKET WITH [**assist+tfsc@kdc.in**](mailto:assist+tfsc@kdc.in) OR [WhatsApp](https://wa/me/912248932532).
{% endhint %}

### SAMPLE <a href="#sample" id="sample"></a>

```javascript
curl --location --request POST '<calback_url>' \
--header 'Authorization: Bearer <shared_during_onboarding>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "shortcode": "#####XYZ",
    "message": "Hi, can I get the a demo",
    "msisdn": "911234567890",
    "sender": {
        "cc": "91",
        "ndc": "1234",
        "sn": "567890",
        "operator": "vodafone-idea",
        "circle": "mumbai"
    },
    "tsiso": "2022-08-22T10:25:54.320Z",
    "tsunix": 1661163954320
}'
```

### Parameters to the APIs <a href="#param" id="param"></a>

## POST JSON data to the URL. Response Body is session reply.

<mark style="color:green;">`POST`</mark> `<callback_url>`

The `text/plain` body reply to this callback will be sent back as the session reply message to the sender. Timeout on **30** seconds for the reply. Blank Output/ Body or Timeout session will not send any reply.

#### Headers

| Name                                            | Type   | Description                               |
| ----------------------------------------------- | ------ | ----------------------------------------- |
| authorization<mark style="color:red;">\*</mark> | STRING | Bearer Token as shared during onboarding. |

#### Request Body

| Name                                         | Type      | Description                                                                                                                                                                                                                                                                |
| -------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| shortcode<mark style="color:red;">\*</mark>  | NUMERIC   | The number on which the sender has sent the message                                                                                                                                                                                                                        |
| msisdn<mark style="color:red;">\*</mark>     | NUMERIC   | The 12-digit mobile number (including country code) of the sender. <mark style="color:orange;">Only Indian Numbers will be passed through.</mark>                                                                                                                          |
| message<mark style="color:red;">\*</mark>    | STRING    | Raw message text sent by the sender.                                                                                                                                                                                                                                       |
| sender.circle                                | STRING    | Telecom circle of the sender *<mark style="color:orange;">(May send empty if MNP or if the information is unavailable)</mark>*.                                                                                                                                            |
| sender.operator                              | STRING    | <p>Telecom operator of the sender <em><mark style="color:orange;">(May send empty if MNP or if the information is unavailable)</mark></em>.<br><em>Value:</em> <code>airtel</code>, <code>vodafone</code>, <code>vodafone-idea</code>, <code>reliance-jio, etc.</code></p> |
| sender.cc<mark style="color:red;">\*</mark>  | NUMERIC   | <p>Country Code. <mark style="color:orange;">Only <strong><code>91</code></strong> will be passed through.</mark></p><p><em>Length:</em> 2</p><p><em>Value:</em> <code>91</code></p>                                                                                       |
| sender.ndc<mark style="color:red;">\*</mark> | NUMERIC   | <p>National Destination Code, identifies one or part of a <a href="https://en.wikipedia.org/wiki/PLMN">PLMN</a></p><p><em>Length:</em> 4</p>                                                                                                                               |
| sender.sn                                    | NUMERIC   | <p>Subscriber Number<br><em>Length:</em> 6ISO 8601</p>                                                                                                                                                                                                                     |
| tsiso<mark style="color:red;">\*</mark>      | TIMESTAMP | <p><a href="https://www.iso.org/iso-8601-date-and-time-format.html">ISO 8601</a> in UTC<br><em>Example:</em> <code>2022-08-08T18:29:00.000Z</code></p>                                                                                                                     |
| tsunix<mark style="color:red;">\*</mark>     | TIMESTAMP | <p>EPCOH UNIX in UTC<br><em>Example:</em> <code>1659983340</code></p>                                                                                                                                                                                                      |

{% tabs %}
{% tab title="200: OK Session Reply to sender in `text/plain`" %}
{% code title="Content-Type: text/plan" overflow="wrap" lineNumbers="true" %}

```
Thank you for contacting. \nOur team will get back to you soon.
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Version: 0.1.0 <a href="#changelog" id="changelog"></a>

**Date:** 2022-08-08

{% hint style="info" %}
We will soon be migrating to [https://**docs.tfsc.dev**](https://docs.tfsc.dev)&#x20;
{% endhint %}
