# Vonage SMS Integration

Before proceeding, ensure that you have[ purchased at least one DID on the Vonage platform](https://support.portsip.com/portsip-communications-solution/configuring-sip-trunks/vonage-sip-trunk/purchase-a-did-on-vonage-platform) that supports SMS/MMS.

***

### Obtain the Vonage API Key

PortSIP PBX uses the **Vonage API Key and API Secret** to send SMS and MMS messages.

#### Steps

1. Log in to your **Vonage account**.
2. Click the **Vonage logo** in the top-left corner to open the **Vonage API Dashboard**.
3. Copy and securely record the following values:
   * **API Key**
   * **API Secret**

> ❗**Important**\
> Treat the API Key and API Secret as **sensitive credentials**. Do not share them publicly or commit them to source control.

<figure><img src="https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FMNXxYYLHQxLJ6B51o032%2Fvonage-fig4.png?alt=media&#x26;token=ee79f46b-0c5c-45a0-b80b-e72b76d99a17" alt=""><figcaption></figcaption></figure>

***

### Configure SMS with the Vonage Trunk in PortSIP PBX

Before configuring SMS/MMS in PortSIP PBX, you must have already configured a Vonage SIP trunk using one of the following methods:

* [Configuring Vonage Register Based Trunk](https://support.portsip.com/portsip-communications-solution/configuring-sip-trunks/vonage-sip-trunk/configuring-vonage-register-authentication-trunk)
* [Configuring Vonage IP Based Trunk](https://support.portsip.com/portsip-communications-solution/configuring-sip-trunks/vonage-sip-trunk/configuring-vonage-ip-authentication-trunk)

***

#### Sign In to the PortSIP PBX Web Portal

You can manage SMS/MMS settings at the tenant level using one of the following methods:

* **System Administrator**
  1. Sign in to the PortSIP PBX Web Portal as a **System Administrator**.
  2. Navigate to **Tenants**.
  3. Select the target tenant and click **Manage**.
* **Tenant Administrator**
  * Sign in directly as a **Tenant Administrator** for the tenant.

> ❗**Reference**\
> For more details, see [Tenant Management](https://support.portsip.com/portsip-communications-solution/portsip-pbx-administration-guide/3-tenant-management).

***

#### Add an SMS Configuration in PortSIP PBX

Follow the steps below to create an SMS/MMS configuration.

1. In the PortSIP PBX Web Portal, navigate to **SMS/MMS**.
2. Click **Add**.
3. Configure the following fields:
   * **Sender ID** *(Optional)*\
     Enter the sender ID used for outbound SMS, if applicable.\
     For more information, see:
     * [*Global Sender ID Registration Guide*](https://api.support.vonage.com/hc/en-us/articles/6791919802652-Global-Sender-ID-Registration-Guide)
     * [*Global Sender ID Portal – FAQs*](https://api.support.vonage.com/hc/en-us/articles/9092597969436-Global-Sender-ID-Portal-FAQs)
   * **Trunk**\
     Select your previously configured **Vonage SIP trunk**.
   * **API Key**\
     Enter the Vonage [API Key obtained earlier](#obtain-the-vonage-api-key).
   * **Secret**\
     Enter the Vonage [API Secret obtained earlier](#obtain-the-vonage-api-key).

<figure><img src="https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FJDtX0DCIApfLKfLXEOCZ%2Fvonage-fig27.png?alt=media&#x26;token=25de0730-080f-42cd-8748-19adbe504e35" alt=""><figcaption></figcaption></figure>

4. Click **OK** to save the configuration.
5. You are redirected to the **SMS/MMS list** page, and the new SMS configuration is displayed.

<figure><img src="https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2Fv9i7VabIrm38WqFb5HYj%2Fvonage-fig28.png?alt=media&#x26;token=0c116e84-d973-41f3-9a8f-ebd77ed71696" alt=""><figcaption></figcaption></figure>

***

#### Copy the PortSIP PBX SMS Webhook URL

Vonage requires a webhook URL to deliver **inbound SMS** to PortSIP PBX.

You can obtain the webhook URL using either method:

* Select the SMS configuration and click **Copy Webhook**, or
* Double-click the SMS configuration to open it, then copy the **Webhook URL** from the details page.

Keep this webhook URL available for the next step.

***

### Configure Inbound SMS Webhooks in Vonage

Vonage sends inbound SMS messages to PortSIP PBX using the configured webhook URL.

You can configure the webhook at either the **account level** or the **number level**.

***

#### Option 1: Add a Webhook URL at the Account Level

1. Log in to your [Vonage account](https://ui.idp.vonage.com/ui/auth/login).
2. Navigate to **Build & Manage**.
3. Under the **SMS settings** section, configure the following:
   * **API**: Select **SMS API**
   * **Webhook format**: Select **POST-JSON**
   * **Inbound SMS webhooks**: Paste the PortSIP PBX SMS Webhook URL
4. Click **Save changes**.

<figure><img src="https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FT5lsEviyhAPqUtQ6Y94K%2Fvonage-fig29.png?alt=media&#x26;token=ec435174-c643-48fc-b34b-73b942ad3468" alt=""><figcaption></figcaption></figure>

***

#### Option 2: Add a Webhook URL at the Number Level

You can define a **unique inbound SMS webhook** for a specific number.

> ❗**Important**\
> A number-level webhook **takes precedence** over the account-level webhook.

1. Navigate to [Your Numbers](https://dashboard.nexmo.com/your-numbers).
2. Locate the number you want to configure.
3. Click the **pencil icon** in the **Manage** column.

<figure><img src="https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FRNtF5reBu2TW0klxOHt9%2Fvonage-fig30.png?alt=media&#x26;token=88eef6be-1d9c-4d8d-bb1d-f8611b9c2bc1" alt=""><figcaption></figcaption></figure>

4. In the pop-up configuration window, set the **Inbound SMS Webhook URL**.
5. Click **Save** before closing the window.

<figure><img src="https://846155343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfkamWLaD5pcQwlKWwC%2Fuploads%2FC8y0o7FjgYg21sGuLiJB%2Fvonage-fig31.png?alt=media&#x26;token=3ef9112a-0616-422c-a961-4c7aacfbfc29" alt="" width="563"><figcaption></figcaption></figure>

***

### Verify the Configuration

At this point, the Vonage SMS/MMS integration is complete.

You can now [create outbound and inbound rules](https://support.portsip.com/portsip-communications-solution/configuring-sip-trunks/twilio-sip-trunk/configuring-outbound-and-inbound-calls) in PortSIP PBX to send and receive SMS/MMS messages using the Vonage trunk—just as you would configure rules for outbound and inbound voice calls.
