---
# System prepended metadata

title: '**Message API Document**'

---

# **Message API Document**

- Message API Route is used to perform send message without time limited. It allows you to send message to user based on the scheduling you prefer. You can manipulate the endpoint with `cron-job` or `background-processing` or `scheduler` etc...

## **Pre-Requirements**

- There are some pre-requirements to meet to perform action for this route.

  1. A valid access token is required to access routes.

  2. Records of transaction references store in our database.

## **Perform a Facebook Message Event:**

- Perform a Facebook Message Event allows you to jump rule of `one time` or `24 hours` limited policy. It allows you to send message to user based on the scheduling you prefer. You can manipulate the endpoint with `cron-job` or `background-processing` or `scheduler` etc...

### **Parameter in Search All User Transactions**

| Parameter                      | Description                                                                                | Type         |
| --------                       | --------                                                                                   | --------     |
| app_id(Required)               | App ID That Represent your Bot. Where you can find the information on system routes.       | string       |
| page_id(Required)              | Page ID That Represent your Bot. Where you can find the information on system routes.      | string       |
| app_type(Required)             | Type of your Bot. It can be either `line` or `messenger`.                                  | string       |
| transaction_ref_id(Required)   | Transaction reference id which was send within the checkbox plugin.                        | string       |
| shortcode_id(Required)         | Shortcode ID with only `message-tag` is allowed                                            | string       |

### **Method**

`GET /v1.0/messages/facebooks/transactions/<transaction_ref_id>/shortcodes/<shortcode_id>?app_id=<app_id>&page_id=<page_id>&app_type=<app_type>`

#### **Success Response**

- **Code:** 200 <br />
  **Content** `{ status: "success"; message: "Send Message Success"; }`

#### **Error Response**

- **Code:** 400 <br />
  **Content** `{ status: "error"; message: "Shortcode <shortcode_id> is not a message tag shortcode"; }`

- **Code:** 403 <br />
  **Content** `{ status: "error"; message: "Transaction Reference ID must provide and must be string type" | "Shortcode ID must provide and must be string type"; }`
  
- **Code:** 404 <br />
  **Content** `{ status: "error"; message: "Transaction Reference <transaction_ref_id> Not Found" | "Shortcode <shortcode_id> Not Found"; }`

- **Code:** 409 <br />
  **Content** `{ status: "error"; message: "Send Message To FB Conflict"; }`

- **Code:** 500 <br />
  **Content** `{ status: "error"; message: "Internal Server Error"; }`

#### Example Request

```bash
curl --request GET '/v1.0/messages/facebooks/transactions/<transaction_ref_id>/shortcodes/<shortcode_id>?app_id=<app_id>&page_id=<page_id>&app_type=<app_type>' \
--header 'Authorization: Bearer <access-token>'
```

#### Example Response

```json
{
  "status": "success",
  "message": "Send Message Success"
}
```