---
title: Generate OTP
slug: v3-gateway/generate-otp
description: Learn about Signzy's API that generates One-Time Passwords (OTPs) for mobile numbers linked to Udyam registration numbers. Obtain an authorization token from support to access the API. This document includes a sample cURL command, response, and error mess
createdAt: 2022-12-09T07:28:39.000Z
---

## Introduction

This API from Signzy is used to generate an OTP to the mobile number given in the input which is linked to the udyam number in the input.

## How to call the API

You will contact support to create an authorization token. You will be using this authorization token in the headers of the request.

## API Input Guidelines

Need to pass the following information

- mobile
- udyamNumber

### Sample cURL

::::Tabs
:::Tab{title="Production"}
```curl
curl --location --request POST 'https://api.signzy.app/api/v3/udyamcertificate/generateotp' \
--header 'Authorization: <auth-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "mobile": "9876543210",
    "udyamNumber": "UDYAM-MH-12-3456789"
}'
```
:::

:::Tab{title="Pre Production"}
```curl
curl --location --request POST 'https://api-preproduction.signzy.app/api/v3/udyamcertificate/generateotp' \
--header 'Authorization: <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "mobile": "9876543210",
    "udyamNumber": "UDYAM-MH-89-1234567"
}'
```
:::
::::

### Input Parameters

| **PARAMETER NAME** | **REQUIRED**/**OPTIONAL** | **DESCRIPTION**           |
| ------------------ | ------------------------- | ------------------------- |
| Content-Type       | Required                  | application/json          |
| Authorization      | Required                  | Authorization token       |
| mobile             | Required                  | 10 digit mobile number    |
| udyamNumber        | Required                  | udyam registration number |

## Sample Response

:::CodeblockTabs
200

```json
{
   "result": {
       "requestId": "udyam_otp_cRtrliyiWrcMfEZyulay"
   }

}
```
:::

### Response Parameter

| PARAMETER NAME   | DESCRIPTION                                |
| ---------------- | ------------------------------------------ |
| result           | This parameter contains the actual output. |
| result.requestId | unique request id                          |

## Sample Error

:::CodeblockTabs
400

```json
{
    "error": {
        "name": "error",
        "message": "please enter mobile",
        "status": 400,
        "reason": "BadRequest",
        "type": "Bad Request",
        "statusCode": 400
    }
}
```

400

```json
{
    "error": {
        "name": "error",
        "message": "please enter udyamNumber",
        "status": 400,
        "reason": "BadRequest",
        "type": "Bad Request",
        "statusCode": 400
    }
}
```

400

```json
{
    "error": {
        "name": "error",
        "message": "Invalid udyamNumber",
        "status": 400,
        "reason": "BadRequest",
        "type": "OK",
        "statusCode": 200
    }
}
```

400

```json
{
    "error": {
        "name": "error",
        "message": "Invalid mobile",
        "status": 400,
        "reason": "BadRequest",
        "type": "OK",
        "statusCode": 200
    }
}
```

404

```json
{
    "error": {
        "name": "error",
        "message": "Data not found",
        "status": 404,
        "reason": "Error",
        "type": "OK",
        "statusCode": 200
    }
}
```

409

```json
{
   "error": {
       "name": "error",
       "message": "Error in getting data",
       "status": 409,
       "reason": "CONFLICT",
       "type": "Conflict",
       "statusCode": 409
   }
}
```

408

```json
{
    "error": {
        "name": "error",
        "message": "Request Timed Out. Please try again.",
        "status": 408,
        "reason": "Error",
        "type": "Request Timeout",
        "statusCode": 408
    }
}
```

401

```json
{
    "message": "Invalid authentication credentials"
}
```

500

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

### Error Parameter

| PARAMETER NAME   | DESCRIPTION                        |
| ---------------- | ---------------------------------- |
| error            | This parameter contains the error. |
| error.name       | the name of the error              |
| error.message    | the error message                  |
| error.status     | status of the api                  |
| error.reason     | Reason for error                   |
| error.type       | Type of the error                  |
| error.statusCode | Request Status code from Signzy    |

### Error Codes

| CODE | DESCRIPTION                          | INTERPRETATION                                     |
| ---- | ------------------------------------ | -------------------------------------------------- |
| 400  | Bad Request                          | Input Parameter has a missing required parameter   |
| 401  | Authorization Failed                 | Authorization token is invalid.                    |
| 404  | Data not found                       | The Udyam number and mobile number are not linked. |
| 409  | Upstream Error                       | Upstream is down, please contact support           |
| 500  | Internal Server Error                | Internal error at Signzy, please contact support.  |
| 408  | Request Timed Out. Please try again. | Request took too long to process and timed out.    |

:::hint{type="info"}
### Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.


You can reach out to us at [help@signzy.com](#).
:::

