# Postman collection

To test and debug requests, you can use the Swagger section of the API on [your channel page in dashboard](https://panel.whapi.cloud/dashboard) or the [Postman collection](https://www.postman.com/whapi-cloud-api/whapi-cloud-api/collection/huzy5nm/whatsapp-api?action=share\&creator=33022403\&active-environment=33022403-69de92fb-d4d1-40ff-877e-f9fc886fd1b1).

{% embed url="<https://www.postman.com/whapi-cloud-api/workspace/whapi-cloud-api/collection/33022403-51773546-5ab6-4a7f-9eb2-9f9ec02a5068?action=share&creator=33022403&active-environment=33022403-69de92fb-d4d1-40ff-877e-f9fc886fd1b1>" %}
Postman Whapi.Cloud API Collection
{% endembed %}

### How to Always Stay Updated with the Latest Postman Collection

To ensure you always have the most up-to-date version of the Whapi.Cloud API collection, follow the steps below.

1. Open the [**WhatsApp API Collection**](https://www.postman.com/whapi-cloud-api/workspace/whapi-cloud-api/collection/33022403-51773546-5ab6-4a7f-9eb2-9f9ec02a5068?action=share\&active-environment=33022403-69de92fb-d4d1-40ff-877e-f9fc886fd1b1\&creator=33022403) in Postman Web.
2. Click **Fork →** select your workspace → **Fork**. You can press the shortcut keys to do this: `Ctrl + Alt + F`

<figure><img src="https://2417185145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhsdgGmVCG31mEaHyRvxC%2Fuploads%2FVVIlQWaO5df3yeUC3JRa%2Ffork.png?alt=media&#x26;token=640fd06a-3f57-49a4-8e06-f9884a495136" alt=""><figcaption><p>Create a fork</p></figcaption></figure>

3. When creating a Fork, be sure to leave the check mark next to the item: `Watch original collection`. &#x20;

<figure><img src="https://2417185145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhsdgGmVCG31mEaHyRvxC%2Fuploads%2F7WnD99IvrfiK3zwtgG8M%2Fimage.png?alt=media&#x26;token=7c71ff04-33bc-4b18-83f1-de6be28606b1" alt=""><figcaption></figcaption></figure>

3.1. Or, in the top bar of your Fork, enable **Watch** (to subscribe to updates).

<div data-full-width="false"><figure><img src="https://2417185145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhsdgGmVCG31mEaHyRvxC%2Fuploads%2Ft37gJLihmkRNKksbUEm7%2F-1.png?alt=media&#x26;token=ba93f2d9-5ed7-44b5-ace9-526548ed140e" alt="" width="563"><figcaption></figcaption></figure></div>

4. Keep the proposed variable environment

<figure><img src="https://2417185145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhsdgGmVCG31mEaHyRvxC%2Fuploads%2FOdLPw6adB31H5275aMNy%2Fimage.png?alt=media&#x26;token=a79b93f4-b93b-45c9-a961-fd8c23ca05f7" alt=""><figcaption></figcaption></figure>

5. When updates are released, you’ll see **Pull changes** in your fork — click **Pull**, then **Merge** (if prompted).\
   This keeps your fork in your workspace while syncing all new updates.

#### If You Previously Imported the Collection

If you used **Run in Postman** or **Import**, that version will **not update automatically**.\
To fix this, delete the old imported collection and create a **Fork** from the link above, following the steps above.

***

### Environment Variables

The collection uses the variable **`baseUrl`**.\
Create an **Environment** in Postman and set your preferred `baseUrl` (e.g., `https://gate.whapi.cloud`)

Specify your **channel token** in the authorization header by entering the value of a global variable.

<figure><img src="https://2417185145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhsdgGmVCG31mEaHyRvxC%2Fuploads%2FczUNQM6eWDJLkVkwNVkq%2Fimage.png?alt=media&#x26;token=14394a5a-d256-4eeb-903b-36d178782062" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2417185145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhsdgGmVCG31mEaHyRvxC%2Fuploads%2F81mFBYWV4qkFZhAphdmW%2Fscope.png?alt=media&#x26;token=58a98f77-0c3d-4447-b0a2-c2d5b606b20f" alt=""><figcaption><p>Set Variable</p></figcaption></figure>

If you automatically create a Fork from our website, don't forget to specify Whapi Env as your primary environment:

<figure><img src="https://2417185145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhsdgGmVCG31mEaHyRvxC%2Fuploads%2FGVbPNla9DYuWghvxUrUf%2FToken-enb.jpg?alt=media&#x26;token=7b7fb3bc-b0d2-4434-b8cf-39549d2d43c5" alt=""><figcaption></figcaption></figure>

Now you can select any API method in the collection and start sending requests. For convenience, all methods are listed in the same order as they are discussed in the [API Documentation](https://whapi.readme.io/reference/sendmessagetext). You can make any changes to these methods to simplify their testing and response handling.

<figure><img src="https://2417185145-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhsdgGmVCG31mEaHyRvxC%2Fuploads%2Fajc6mKdxARgvdAswS2TZ%2Fsend.png?alt=media&#x26;token=57f4b621-901f-43ed-907f-c4e4c450a38f" alt=""><figcaption><p>Test any API Call: Send text message</p></figcaption></figure>
