# SMS 2 WAY Interactive

### Sequence Diagram

![Sequence Diagram SMS 2 WAY](/files/-M2D3pIGVSLBB008YeJ_)

{% tabs %}
{% tab title="Request" %}

#### Request body requires parameters as these following

| **Parameters** | type   | description                                   |
| -------------- | ------ | --------------------------------------------- |
| TRAN\_ID       | String | The ID which uniquely identifies the request  |
| MOBILE\_NO     | String | The destination phone number for your message |
| KEYWORD        | String | Keyword of this campaign                      |
| MESSAGE        | String | Message text                                  |

**The request will look like:**

```
{
"TRAN_ID":"db41f538-66bc-4d13-8d99-a6c2b5414ff8",
"MOBILE_NO":"66987654321",
"MESSAGE":"4567930000000048",
"KEYWORD":"ANTS"
}
```

{% endtab %}

{% tab title="Response" %}
**SMS 2 Way Response**

| Parameters   | type   | description                                       |
| ------------ | ------ | ------------------------------------------------- |
| TRAIN\_ID    | String | The ID that uniquely identifies the sent message. |
| RESULT\_CODE | String | Code ID of return result                          |
| RESULT\_NAME | String | Name of return result                             |
| MESSAGE      | String | Text of the message return                        |

**The response will look like:**

```
{
    "TRAIN_ID": "db41f538-66bc-4d13-8d99-a6c2b5414ff8",
    "RESULT_CODE": "301",
    "RESULT_NAME": " INVALID_MEMBER ",
    "MESSAGE": "Sorry, Membership  is not eligible for this event."
}
```

{% endtab %}
{% endtabs %}

### Callback

{% tabs %}
{% tab title="Request" %}

#### Request body requires parameters as these following

| **Parameters**  | types  | description                                  |
| --------------- | ------ | -------------------------------------------- |
| ERROR\_MESSAGE  | String | Reason of each transaction ID                |
| TRANSACTION\_ID | String | The ID which uniquely identifies the request |

**The  JSON callback will look like:**

```
"ERROR_MESSAGE":"CHARGING_FAILED",
"TRANSACTION_ID":" db41f538-66bc-4d18-8d99-a6c2b5484ff8"
```

{% endtab %}
{% endtabs %}

### RESULT THIRD PARTY

| **Code**   | **Name of the code** | Description                                      |
| ---------- | -------------------- | ------------------------------------------------ |
| 00         | Success              | Success                                          |
| 301 to 399 | Configurable         | Response based on configuration that you defined |

#### The sample of naming different codes will look like:

| Code | Name of the code | Description                                                                        |
| ---- | ---------------- | ---------------------------------------------------------------------------------- |
| 00   | Success          | Your registration is successful; please show this message at the counter.          |
| 301  | INVALID\_MEMBER  | Sorry, this membership account is not eligible for this event.                     |
| 302  | INVALID\_PRICE   | Sorry, you have entered the wrong amount, please kindly check and re-submit again. |

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidoc.ants.co.th/sms-2-way.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
