# OTP Integration

The OTP (One-Time Password) API offer flow is a server-to-server verification method commonly used in Mobile Value-Added Services (mVAS) campaigns. These campaigns provide additional services beyond basic calls and SMS, such as entertainment, alerts, and data services.

Using OTP verification helps:

* Improve lead quality
* Reduce fraud
* Increase overall campaign reliability

<figure><img src="/files/ZL1fjcQEMUBCdPdGMjZm" alt=""><figcaption></figcaption></figure>

### How OTP API Works

#### **Generate OTP**

* When a user submits their mobile number on a landing page, a unique, time-bound OTP is generated.
* The OTP is delivered via an API call to the user and this action is recorded as a **click** in Offer18.

#### **Verify OTP**

* The user enters the OTP received on their mobile device.
* The OTP is validated via an API call and this is recorded as a **conversion** in Offer18.

\
To setup OTP Integration follow the below steps:

1. Navigate to Integration **»** OTP Integration
2. In **"Credentials"** section, Define **"Name"** for the integration
3. Add advertiser's **"OTP Send API URL" »** add keys and values for API endpoint
4. Add **"OTP Verify API URL" »** add keys and values for API endpoint
5. Submit & Next

<figure><img src="/files/06QcxZplJU6POYUmwv3H" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
For the **"OTP Send API URL",** {msisdn} is a mandatory value.\
For the **"OTP Verify API URL",** both {msisdn} and {otp} are mandatory values.\
If the advertiser’s API requires any additional mandatory parameters, add them to the respective API calls as needed.
{% endhint %}

### Generate OTP API endpoints for the affiliates

1. After submitting the API setup, proceed to **"Affiliate API Endpoints".**
2. Add **"Page Title"** for the landing page.&#x20;
3. Select Affiliate ID&#x20;
4. Click **"Generate"** for OTP API endpoints and landing page script

<figure><img src="/files/fupHH6JRzuECljqMGgpR" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
API access must be enabled for the affiliate.
{% endhint %}

### OTP API Response

```javascript
Generate OTP
{
  "status": "200",
  "response": "otp_sent_successfully",
}
```

```javascript
Verify OTP
{
  "status": "200",
  "response": "otp_verified_successfully"
}
```

For failed responses, please check your advertiser's API response.

***

### OTP Landing Page Script

Download the landing page script and share it with your affiliate so they can integrate it into their application or repository. If they do not have a dedicated landing page, they can use this script directly as part of their existing setup. The integration requires minimal configuration.

The script automatically injects the Affiliate ID, API credentials, and other required parameters based on the selected affiliate id in configuration. All transactional data such as MSISDN and OTP are dynamically populated at runtime during the OTP flow, ensuring seamless communication between the landing page and the OTP APIs.

> The script will be downloaded in PHP.


---

# 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://knowledgebase.offer18.com/network/integration/otp-integration.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.
