# Receiving Inbound SMS

### **messages\_get()**

<mark style="color:green;">`GET`</mark> [`/https://eu-api.panaceamobile.com/json?`](#messages_get)

Best practice is to use this function starting with last\_id = 0, then as messages are received, to store last\_id as the highest message ID you receive back from the API request. Results are limited to 50 at a time.

<table><thead><tr><th>HTTPS GET Parameter</th><th width="185">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>action</code></td><td>messages_get</td><td>This function returns all inbound (MO) messages for the user which have an ID larger than 'last_id'.</td></tr><tr><td><code>username</code></td><td>usernamex</td><td>Your account username.</td></tr><tr><td><code>password</code></td><td>passwordy</td><td>Your account password.</td></tr><tr><td><code>last_id</code></td><td>0</td><td>Best practice is to use this function starting with last_id = 0, then as messages are received, to store last_id as the highest message ID you receive back from the API request. Results are limited to 50 at a time.</td></tr></tbody></table>

**Example:**

{% code overflow="wrap" %}

```
{"status":0,"message":"OK","details":[{"id":"11","created":"2023-04-09 19:25:09","from":"27832659217","to":"20000","data":"Test MO Generated","charset":"UTF-8"},{"id":"10","created":"2023-04-09 19:24:02","from":"27832659217","to":"20000","data":"Test MO Generated","charset":"UTF-8"}]}
```

{% endcode %}

### Reply Delivery Channels

Alternatively, you can have all replies sent to your inbox forwarded to a **web service** of your choice using an end-point URL to push these replies to via an **HTTP GET** call-back or **SMPP**:

In the **SMS Numbers** section of the dashboard, you can view and manage the various numbers associated with your account.&#x20;

Here you're able to set the forwarding channel for **inbound messages**. Users can choose from several forwarding options: Default setting, HTTP, or SMPP, each catering to different integration and handling needs.&#x20;

The **Default** setting refers to the Global setting for your user account meaning ALL replies that come back into your inbox. By selecting **Edit** you’ll be presented with a few options.

<figure><img src="/files/8DWQawr2dTYAaj3YubTX" alt=""><figcaption><p>Edit Reply Delivery Channels</p></figcaption></figure>

### SMPP

SMPP (Short Message Peer to Peer) allows all inbound messages to be pushed over SMPP to your SMPP server when bound as an ESME to our platform.

### Inbound Trigger

You can have multiple triggers that define different actions according to conditions/filters. Example message containing any or specific words, coming from a specific number, any or all inbound messages, etc.

Each trigger can also define one or multiple actions e.g. send an email, send an SMS, call a URL, Add/Remove a number to/from a list

### HTTP&#x20;

This setting will allow a server URL to be called with an HTTP GET to push all replies over HTTP. The structure of the payload when we call your URL is as follows:&#x20;

{% code overflow="wrap" %}

```
http://www.yoururl.co.za/tmp/inbox/replies.php?&to=1234567890&from=27123456789&charset=UTF8&message=Hello&code=1001&client_reference=123&mcc=655&mnc=01&mo_message_id=161145956
```

{% endcode %}

<figure><img src="/files/YGvIfCdFtgFNa89uTbD8" alt=""><figcaption><p>Reply Delivery URL (HTTP)</p></figcaption></figure>


---

# 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://panaceamobile.gitbook.io/panacea-mobile-help-centre/developers/https-api/receiving-inbound-sms.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.
