---
description: >-
  This document explains the procedure for adding an SSP on the Lemnisk platform
  on your own.
---

# Add an SSP

Lemnisk provides the convenience of adding an SMS vendor on your own on the platform itself, saving a great deal of engineering effort and time that goes into the integration, enabling the marketer to take campaigns live faster.&#x20;

This feature will help marketers configure the External API-led SMS vendors just by providing the authorization keys, and mapping the designated SMS fields to the payload.

## Pre-requisites

* The vendor's API that works with -&#x20;
  * HTTP POST or GET Method
  * JSON payload (for POST APIs).
* The authentication mechanism and credentials that is a static key and not a refresh key.

## Configuration Steps

* To set up an SMS vendor, it is mandatory to map two configuration values: “To” and “Message Body”. These two fields are variable at the engagement level.
* &#x20;Ensure you assign the authorisation keys, senderID (if present), sender number and other essential global constants in the respective places in the API. Usually, these are configured in the URL parameters or header parameters.&#x20;
* To configure a field at engagement level, assign that key with "Custom Field" and then provide a static value or define it at engagement-level by entering the variable name in curly braces like \{{Custom Value\}}.
* A default value is not mandatory, but recommended when the value does not change frequently. This value will be displayed again those parameters when creating engagements. You can also assign a Macro value to fields by type.

## Setup new SMS client

**Step 1:** Go to > Campaigns > Channels > SMS

**Step 2:** Click on the "+" Icon in the top row of the window.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FjZsrFuNqRgISLLi6urmZ%2Fimage.png?alt=media&#x26;token=d4255f93-3930-4db4-840f-246735a71f15" alt=""><figcaption><p><em>Add your own ESP</em></p></figcaption></figure>

**Step 3:** Select "+ Add Client" from the list of clients.

**Step 4:** Enter your client name in the given input box.(Ensure you put the business name of the vendor. This is for the sanity of the records)

**Step 5:** Name your configuration in the given input box.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2Fhp3HAquHUoZLKhghsAaW%2Fimage.png?alt=media&#x26;token=3a411fab-e711-4caf-aac4-d51d1f5806e2" alt=""><figcaption><p><em>Image: Add Client</em></p></figcaption></figure>

## Configure your SMS client

### **Step 1: Basic details**

**Name of configuration:** The name you entered in the previous step will be displayed here&#x20;

**Description:** Add a description for the new SMS client.

### **Step 2: API Details**

You can set up the Vendor API in the same way as you set up an[ External API](../external-api) with a global payload.&#x20;

**HTTP Method:** Select the HTTP method as POST or GET.

**API URL:** Provide the API URL.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2F6lACSCz8MIpeK9KnM4YG%2Fsms%20wrapAPI.png?alt=media&#x26;token=5e69dc15-fdb3-4e6f-a1a8-777615dd4104" alt=""><figcaption><p><em>Image: API Details</em></p></figcaption></figure>

Alternatively, You can simply import the cURL of the API and skip to the next step! Let's understand how "Detect from cURL" works.

Clicking the **+detect from URL** button will pop up the following window.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FeWymkAndYtFv386vWAvw%2Fimage.png?alt=media&#x26;token=47baf34a-d5b3-4d25-999c-fa24239fe2be" alt=""><figcaption><p><em>Image: Detect from cURL</em></p></figcaption></figure>

Once you enter the curl, it will automatically fetches the Headers and Payload from the API and populate in the relevant fields and the tree-view will occur based on the values in the payload.

### **Step 3: Map API Keys to SMS Fields**

Now, select the SMS Configuration fields and map the mandatory values To\* and Message Body\* to the appropriate keys in the API Body.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FASPCgcXoCIW8lu8tZ8QT%2Fimage.png?alt=media&#x26;token=85637111-a990-44ef-b221-dbecccfe9dd9" alt=""><figcaption><p><em>Image: SMS configuration fields mapping</em> </p></figcaption></figure>

If you have a GET based API, you will have to do the same mapping, but to query parameters instead. Below is an example.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2F6kBSwgS7IsW7yOJtkmQX%2Fimage.png?alt=media&#x26;token=994c4744-7f2e-43ca-8dc9-49dec8289914" alt=""><figcaption></figcaption></figure>

**Custom Field:** You can add custom values to the Configuration by assigning variables in curly braces \{{Example\}}.

In this example, the vendor also expects the Template ID to be passed in the API request. This shall be a mandatory field, configured with the 'Custom Field' mapping.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FDPvC07Qtd2JWEyNTZgdK%2Fimage.png?alt=media&#x26;token=67edd867-6835-4a62-8cae-c82f34e77e65" alt=""><figcaption><p><em>Image: Custom Field</em></p></figcaption></figure>

**Optional field:** On adding the custom values you can choose to assign the variable to be optional and apply conditions from the following. Click [here](../../external-api#optional-field) to learn more about optional fields.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FUnQhYbLxiNJp5H9336OM%2Fimage.png?alt=media&#x26;token=9d221e12-688a-4cc1-a7a2-30603722c5f7" alt=""><figcaption><p><em>Image: Optional Field</em> </p></figcaption></figure>

{% embed url="https://drive.google.com/file/d/1NSOGCHdyjvHXcMjvKmmDfDP7jKBGfGl-/view?usp=sharing" %}
_Demo: Create your own SSP_
{% endembed %}

## **Send Test SMS**

* Navigate to > Test API
* Assign working values to the payload like SMS body, recipient phone etc and click "test".
* You will receive the success confirmation as shown below once your API is validated&#x20;

This is the same functionality we implemented in External API. Click [here](../external-api/test-your-api-configuration) to know in detail.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FGzKpq3ATXdHvhmeI1svC%2Fimage.png?alt=media&#x26;token=66bc07ae-fab8-4e6d-87b8-fc9796ad6159" alt=""><figcaption><p><em>Image: Test API</em></p></figcaption></figure>

## Response and Webhooks

The response and Webhooks screen is where you will map the relevant path of the unique ID in the response body to the internal MessageID identifier which helps Lemnisk identify every message trigger and account for the delivery reports.

* Navigate to > Response and Webhooks
* Enter values to the payload and Click " Test Configuration"
* You will receive the confirmation once your API is validated.
* Select the mapping key to map the Unique message ID.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FuyPbKnPVIjJoCzmq4xjN%2Fimage.png?alt=media&#x26;token=a079d941-2b28-47cf-998f-5a72d496ad48" alt=""><figcaption><p><em>Image: Response and Webhooks</em></p></figcaption></figure>

Lemnisk's Add an SMS provider feature supports Text as well as JSON response. Below is an example of how you can assign an index position as the messageID path when your SSP of choice has a text based response:

1. Select the Key separator from the Response.
2. Optionally, you may have the text response in Key-Value format. If applicable, also provide a Key-value separator to distinguish Keys and values indices.
3. Click on **Proceed,** and the response is appropriately diced into it's constituent Keys (and values). Select the appropriate index that hold the Message\_ID.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FV7SYmimPI0B2SPlr5P1d%2Fimage.png?alt=media&#x26;token=38a80d7c-4f7f-4319-a5fb-274c246f1b2c" alt=""><figcaption></figcaption></figure>

Click on **Save Configuration** to successfully save the message\_ID path of the response.

{% hint style="success" %}
Congratulations! You've successfully added the SMS provider's API in the system and you can now create engagements to start your SMS campaigns.
{% endhint %}
