# OTP 集成

OTP（一次性密码）API offer 流程是一种服务器到服务器的验证方法，常用于移动增值服务（mVAS）活动。这些活动除基础通话和短信外，还提供娱乐、提醒和数据服务等附加服务。

使用 OTP 验证有助于：

* 提高线索质量
* 减少欺诈
* 提高整体活动可靠性

<figure><img src="/files/9e3ec963253400d964360e6a5eefbdc270cb26c7" alt=""><figcaption></figcaption></figure>

### OTP API 的工作原理

#### **生成 OTP**

* 当用户在落地页上提交其手机号码时，会生成一个唯一且有时间限制的 OTP。
* OTP 通过 API 调用发送给用户，并且该操作会被记录为一个 **点击** 在 Offer18 中。

#### **验证 OTP**

* 用户输入其移动设备上收到的 OTP。
* OTP 通过 API 调用进行验证，并且这会被记录为一个 **转化** 在 Offer18 中。

\
要设置 OTP 集成，请按照以下步骤操作：

1. 导航到集成 **»** OTP 集成
2. 在 **"Credentials"** 部分中，定义 **"Name"** 用于该集成
3. 添加广告主的 **"OTP Send API URL" »** 为 API 端点添加键和值
4. 添加 **"OTP Verify API URL" »** 为 API 端点添加键和值
5. 提交并下一步

<figure><img src="/files/8a07f9fcea9072143f0ad926c4195fe79ce0a72e" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
对于 **"OTP Send API URL",** {msisdn} 是必填值。\
对于 **"OTP Verify API URL",** {msisdn} 和 {otp} 都是必填值。\
如果广告主的 API 需要任何额外的必填参数，请根据需要将它们添加到相应的 API 调用中。
{% endhint %}

### 为联盟伙伴生成 OTP API 端点

1. 提交 API 设置后，继续到 **"Affiliate API Endpoints"。**
2. 添加 **"Page Title"** 用于落地页。&#x20;
3. 选择联盟 ID&#x20;
4. 点击 **"Generate"** 以生成 OTP API 端点和落地页脚本

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

{% hint style="info" %}
必须为该联盟启用 API 访问权限。
{% endhint %}

### OTP API 响应

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

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

对于失败的响应，请检查广告主的 API 响应。

***

### OTP 落地页脚本

下载落地页脚本并将其分享给你的联盟伙伴，以便他们将其集成到自己的应用或仓库中。如果他们没有专用落地页，也可以直接使用此脚本作为其现有设置的一部分。该集成所需的配置很少。

该脚本会根据配置中所选的联盟 ID 自动注入联盟 ID、API 凭据以及其他所需参数。所有交易数据，如 MSISDN 和 OTP，都会在 OTP 流程中于运行时动态填充，确保落地页与 OTP API 之间无缝通信。

> 该脚本将以 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/zh/wang-luo/ji-cheng/otp-ji-cheng.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.
