> For the complete documentation index, see [llms.txt](https://docs.channel360.co.za/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.channel360.co.za/api-usage/get-started/quickstart.md).

# Quickstart: send your first message

Send a WhatsApp message to your own phone and see it delivered, in about ten minutes.

By the end of this page, a WhatsApp message will have arrived on your phone and your server will have been told it was delivered.

## Before you start

* **A Channel360 login.** If you do not have one, sign up in the Channel360 web app. The Channel360 sales or support team then assigns your account to your organisation. You cannot use the API until that is done.
* **One approved template.** For a first test, a template with one placeholder in its body is ideal, for example `Hi {{1}}, welcome to Acme!` named `welcome_message`. Its status in **Templates** must be **APPROVED**.
* **Your own WhatsApp number** to send the test to.

## Steps

### 1. Copy your Organisation API URL

In the Channel360 web app, go to **Settings → Developer Settings**. At the top, the **API details** card shows your **Organization API URL** with a **Copy** button.

It looks like `https://channel360.co.za/v1.1/org/<ORG_ID>`. Every request in these docs starts with it. The part after `/org/` is your organisation ID.

### 2. Create an API key

On the same page, open the **API keys** tab and select **Create**. Give the key a name you will recognise, such as "Production backend", then select **Copy key**.

{% hint style="warning" %}
The full key is shown **once**. Store it somewhere safe, like a password. It only works with your own organisation's URL.
{% endhint %}

### 3. Register a webhook

A webhook is a URL on your server that Channel360 calls to tell you what happened to a message. Without one, you cannot find out whether a message arrived.

Open the **Webhooks** tab and select **Create**. Enter a **Name** and your **Endpoint URL**, then under **Events** tick at least:

* **Notification Delivery Channel**
* **Notification Delivery User**
* **Notification Delivery Failure**

Select **Create**. If you do not have a server yet, use a free request-inspector URL (such as webhook.site) for this test.

### 4. Send the message

Replace `<ORG_ID>`, `<API_KEY>` and the `destination` number (your own, in international format, digits only) before running it.

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

```bash
curl -X POST "https://channel360.co.za/v1.1/org/<ORG_ID>/notification" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "destination": "27821234567",
    "message": {
      "type": "template",
      "template": {
        "name": "welcome_message",
        "language": { "code": "en" },
        "components": [
          {
            "type": "body",
            "parameters": [
              { "type": "text", "text": "Sipho" }
            ]
          }
        ]
      }
    }
  }'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const response = await fetch(
  "https://channel360.co.za/v1.1/org/<ORG_ID>/notification",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer <API_KEY>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      destination: "27821234567",
      message: {
        type: "template",
        template: {
          name: "welcome_message",
          language: { code: "en" },
          components: [
            {
              type: "body",
              parameters: [{ type: "text", text: "Sipho" }]
            }
          ]
        }
      }
    })
  }
);

console.log(await response.json());
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

response = requests.post(
    "https://channel360.co.za/v1.1/org/<ORG_ID>/notification",
    headers={
        "Authorization": "Bearer <API_KEY>",
        "Content-Type": "application/json",
    },
    json={
        "destination": "27821234567",
        "message": {
            "type": "template",
            "template": {
                "name": "welcome_message",
                "language": {"code": "en"},
                "components": [
                    {
                        "type": "body",
                        "parameters": [{"type": "text", "text": "Sipho"}],
                    }
                ],
            },
        },
    },
)

print(response.json())
```

{% endtab %}
{% endtabs %}

If your template is not `welcome_message`, change `name`, `language` and the `parameters` to match it. [Filling template placeholders](https://docs.channel360.co.za/api-usage/send-a-template-notification/filling-template-placeholders.md) explains how.

### 5. Check the response

A successful request returns HTTP `201` and a notification ID:

```json
{ "notification": { "_id": "6710f3c2a1b2c3d4e5f60789" } }
```

{% hint style="info" %}
`201` means Channel360 accepted and queued the message. It does not mean the message was delivered. Delivery is reported to your webhook.
{% endhint %}

## Check it worked

* The message arrives on your phone.
* Your webhook receives `notification:delivery:channel` (WhatsApp accepted the message), then `notification:delivery:user` (it reached your phone).
* If it receives `notification:delivery:failure` instead, read the `error` object in it and see [Troubleshooting](https://docs.channel360.co.za/api-usage/troubleshooting.md).
* If your webhook received nothing, open **Settings → Developer Settings → Delivery Logs**. It lists every attempt Channel360 made to call your URL and the response your server gave.

## What can go wrong

| What you see                                      | Why                                                                    | What to do                                                                                      |
| ------------------------------------------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| **400** `Could not find a valid template`         | Channel360 cannot find a template with that name in your organisation. | Check the name, underscores and case against **Templates** in the web app.                      |
| **400** `Template language code must be provided` | `message.template.language.code` is missing.                           | Add `"language": { "code": "en" }`, using your template's language.                             |
| **400** `Organization Not Found`                  | The organisation ID in the URL does not exist.                         | Copy the Organisation API URL again.                                                            |
| **401 / 403** unauthorised                        | The API key is missing, wrong, or belongs to another organisation.     | Check the `Authorization: Bearer …` header and the URL.                                         |
| **201**, but no message arrives                   | Channel360 accepted it, but WhatsApp rejected it later.                | Check your webhook for `notification:delivery:failure`, then check the template and parameters. |

The full list is in [Troubleshooting](https://docs.channel360.co.za/api-usage/troubleshooting.md).

## Next

{% content-ref url="/pages/F7sOcPd43S0m5RiC3IXD" %}
[Send a template notification](https://docs.channel360.co.za/api-usage/send-a-template-notification.md)
{% endcontent-ref %}

{% content-ref url="/pages/NtsbXspiU4OagtOGfKyY" %}
[Receive delivery updates](https://docs.channel360.co.za/api-usage/receive-delivery-updates.md)
{% endcontent-ref %}
