# Send Your First Message

### Guide to Sending Your First Message with Waabot API

#### Step 1: Set Up Your Base URL and Endpoint

The base URL for the Waabot API is:

```
https://client.waabot.com/api/v2
```

The endpoint for sending a message is:

```
/send-message
```

#### Step 2: Prepare Your Request Body

To send a message via WhatsApp using the Waabot API, your request body should be structured as follows:

```json
{
    "platform": "whatsapp",
    "recipient": "**********",
    "message": {
        "messaging_product": "whatsapp",
        "recipient_type": "individual",
        "to": "**********",
        "type": "text",
        "text": {
            "body": "messageText"
        }
    }
}
```

#### Example Request

Here is an example of how to send a simple text message:

```json
{
    "platform": "whatsapp",
    "recipient": "**********",
    "message": {
        "messaging_product": "whatsapp",
        "recipient_type": "individual",
        "to": "**********",
        "type": "text",
        "text": {
            "body": "Hello, this is your first message from Waabot API!"
        }
    }
}
```

#### Important Note

This message will only be delivered if the user has initiated a conversation with your business number within the last 24 hours. If the user hasn't messaged your business within this timeframe, you will need to use a pre-approved message template to initiate the conversation.

#### Step 3: Sending a Template Message

To initiate a message to a user who hasn't contacted your business within the last 24 hours, follow these steps:

1. **Create a Template:**
   * Go to your WhatsApp Business Manager.
   * Create a message template that follows WhatsApp's guidelines.
   * Submit the template for approval by Facebook.
2. **Send the Template Message:**
   * Once your template is approved, use the Waabot API to send the template message.

#### Example Request for Template Message

```json
POST https://client.waabot.com/api/v2/send-message
Content-Type: application/json

{
    "platform": "whatsapp",
    "recipient": "**********",
    "message": {
        "messaging_product": "whatsapp",
        "recipient_type": "individual",
        "to": "**********",
        "type": "template",
        "template": {
            "name": "your_template_name",
            "language": {
                "code": "en_US"
            },
            "components": [
                {
                    "type": "body",
                    "parameters": [
                        {
                            "type": "text",
                            "text": "Hello, this is a template message using Waabot API!"
                        }
                    ]
                }
            ]
        }
    }
}
```

#### Summary

1. **Direct Messages:**
   * Use the `/send-message` endpoint with the appropriate JSON body to send messages to users who have messaged your business within the last 24 hours.
2. **Template Messages:**
   * Create and get approval for a message template in your WhatsApp Business Manager.
   * Use the `/send-message` endpoint with the template structure to initiate a conversation with users outside the 24-hour window.

By following these steps, you can effectively send messages and engage with your customers using the Waabot API.


---

# 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://mrbarnk.gitbook.io/waabot-api-documentation/api-references/send-your-first-message.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.
