---
title: Phone Intel - Generate OTP
slug: api-marketplace/phone-intel-generate-otp
description: Learn how to use the Phone KYC Get OTP API for seamless mobile-based KYC verification. Generate secure one-time passwords for user registration, account recovery, financial transactions, and more. This comprehensive document covers everything you need to 
createdAt: 2023-04-20T19:21:10.000Z
---

## Introduction

The Phone Intel Generate OTP API offers a secure and dependable solution for generating One-Time Passwords (OTPs) essential for mobile-based KYC (Know Your Customer) verification. This API endpoint accepts JSON-formatted requests containing the user's mobile number and country code, generating a unique OTP for verification purposes. The generated OTP serves to authenticate the end client's identity during the KYC process. Additionally, the API provides a reference ID for tracking and auditing, enabling developers to monitor requests made via this API endpoint.

### Key Features

- **Secure OTP Generation:** Generates unique One-Time Passwords securely for KYC verification.
- **JSON Request Format:** Accepts requests in JSON format for easy integration into existing systems.
- **Reference ID Provision:** Provides a reference ID for tracking and auditing purposes, facilitating request monitoring.

### Applications

- **KYC Verification:** Enables businesses to verify the identity of users through mobile-based KYC processes.
- **Authentication:** Provides a secure method for authenticating users during registration or login processes.
- **Tracking and Auditing:** Offers a reference ID for tracking and auditing requests, ensuring compliance and accountability.

### Conclusion

In summary, the Phone Intel Generate OTP API serves as a reliable solution for generating OTPs essential for mobile-based KYC verification. Its secure OTP generation, support for JSON request format, and provision of reference IDs make it a valuable tool for businesses seeking to enhance identity verification processes.

***

## API Details

### Endpoints

:::CodeblockTabs
Production Endpoint

```text
POST https://api.signzy.app/api/v3/phone/generateOtp
```
:::

:::CodeblockTabs
UAT/Testing Endpoint

```javascript
POST https://api-preproduction.signzy.app/api/v3/phone/generateOtp
```
:::

***

### Request Body Parameters

| **Parameter** | **Data Type** | **Description**                                                                     | **Required** |
| ------------- | ------------- | ----------------------------------------------------------------------------------- | ------------ |
| countryCode   | String        | The country code associated with the mobile number. The value to be passed is "91". | Mandatory    |
| mobileNumber  | String        | The client's mobile number to be verified.                                          | Mandatory    |

```json
{
    "countryCode": "...country code...",
    "mobileNumber": "...mobile number..."
}
```

***

### Request Headers

| **Name**      | **Value**        | **Required** | **Description**                                                                                            |
| ------------- | ---------------- | ------------ | ---------------------------------------------------------------------------------------------------------- |
| Content-Type  | application/json | Mandatory    | The type of content that the request body contains.                                                        |
| Authorization | XXXXXXXXXXXXXXX  | Mandatory    | An authentication token to authorize the request. Reach out to the Signzy support team to get one created. |

***

### Code Samples

:::CodeblockTabs
```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/phone/generateOtp' \
--header 'Content-Type: application/json' \
--header 'Authorization: <your access token>' \
--data '{
    "countryCode": "91",
    "mobileNumber": "XXXXXXXXXX"
}'
```

```nodejs
const axios = require('axios');
let data = JSON.stringify({
  "countryCode": "91",
  "mobileNumber": "XXXXXXXXXX"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api-preproduction.signzy.app/api/v3/phone/generateOtp',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': '<your access token>'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

```python
import http.client
import json

conn = http.client.HTTPSConnection("preproduction.signzy.app")
payload = json.dumps({
  "countryCode": "91",
  "mobileNumber": "XXXXXXXXXX"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '<your access token>'
}
conn.request("POST", "/api/v3/phone/generateOtp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-preproduction.signzy.app/api/v3/phone/generateOtp"
  method := "POST"

  payload := strings.NewReader(`{
    "countryCode": "91",
    "mobileNumber": "XXXXXXXXXX"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "<your access token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```
:::

***

### Response Body Parameters

| **Parameter**      | **Data Type** | **Description**                                                                                                                                                               |
| ------------------ | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| result.referenceId | String        | A unique reference ID generated by the API for the requested OTP generation task. This referenceID is to be used in conjunction with the generated OTP in the Submit OTP API. |

:::CodeblockTabs
200

```json
{
    "result": {
        "referenceId": "telecom_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
}
```
:::

### Error Codes

:::CodeblockTabs
400

```json
// Invalid mobile number
{
    "error": {
        "statusCode": 400
        "name": "error",
        "message": "Mobile number is not valid",
        "status": 400
    }
}

// Invalid or non supported country code
{
    "error": {
        "statusCode": 400,
        "name": "error",
        "message": "Country Code is not valid / not supported",
        "status": 400,
    }
}
```

401

```json
// When API key is not passed in headers
{
    "message": "No API key found in request"
}

// When wrong API key is passed in headers
{
    "message": "Invalid authentication credentials"
}
```

404

```json
{
    "error": {
        "statusCode": 404,
        "name": "error",
        "message": "Not Found",
        "status": 404,
    }
}
```

409

```json
{
    "error": {
        "statusCode": 409,
        "name": "error",
        "message": "Upstream Down",
        "status": 409,   
    }
}
```

429

```json
{
    "error": {
        "statusCode": 429,
        "name": "error",
        "message": "Daily OTP limit exceeded",
        "status": 429,
    }
}
```

500

```json
{
    "error": {
        "name": "error",
        "message": "Internal Server Error",
        "status": 500,
        "reason": "ERROR",
        "type": "Internal Server Error",
        "statusCode": 500
    }
}
```
:::

:::hint{type="info"}
The generated OTP as part of this API call has a validity of **10 minutes**.
:::

***

**Contact Us for Any Assistance**

If you have any questions or need assistance, please reach out to our customer support team. You can contact us via email at <font color="#2166ae">**help\@signzy.com**</font>. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!
