---
title: Generate OTP API
slug: v2/generate-otp-api
description: Learn how to generate a secure One-Time Password (OTP) with this document's comprehensive guidelines for accessing your vaccination certificate. Find step-by-step instructions on calling the API and the necessary input parameters. Implement the provided s
createdAt: 2022-09-19T07:28:09.000Z
---

# Introduction

An OTP is required to fetch the vaccination certificate from the server . This API is used to generate the OTP and the requestId which will be then used in Vaccination Details API to fetch the vaccination certificate along with other important details.

## How to call the API

You will need to [login](https://docs.signzy.com/sandboxapis) before sending Vaccine Generate OTP API request. You are required to pass the access token received from the login call, as authorization header in the request for Vaccine Generate OTP API along with other parameters.

## API Input Guidelines

An OTP will be sent to the registered mobile number.

### Sample Curl

::::Tabs
:::Tab{title="Preproduction"}
```curl
curl --location --request POST 'https://preproduction.signzy.tech/api/v2/patrons/..patronId../vaccine' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.8' \
--header 'Authorization: <token>' \
--header 'content-type: application/json' \
--data-raw '{
    "task": "generateOTP",
    "essentials": {
        "mobileNumber": "<Mobile Number>"
    }
}'
```
:::

:::Tab{title="Production"}
```curl
curl --location --request POST 'https://signzy.tech/api/v2/patrons/..patronId../vaccine' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.8' \
--header 'Authorization: <token>' \
--header 'content-type: application/json' \
--data-raw '{
    "task": "generateOTP",
    "essentials": {
        "mobileNumber": "<Mobile Number>"
    }
}'
```
:::
::::

### Input Parameters

| **Parameter Name&#x20;** | **Required/Optional** | **Description**                        |
| ------------------------ | --------------------- | -------------------------------------- |
| Authorization            | Required              | Authorization token                    |
| content-type             | Required              | application/json                       |
| task                     | Required              | Type of task - generateOTP             |
| essentials               | Required              | Contains the essential output data     |
| essentials.mobileNumber  | Required              | Registered mobile number of the person |

### Sample API Response

```json
{
    "essentials": {
        "mobileNumber": " "
    },
    "id": " ",
    "patronId": " ",
    "task": "generateOTP",
    "result": {
        "requestId": " "
    }
}
```

### Response Parameters

| **Parameter Name**      | **Description**                                                               |
| ----------------------- | ----------------------------------------------------------------------------- |
| essentials              | Contains the essential output data                                            |
| essentials.mobileNumber | Registered mobile number of the person                                        |
| id                      | The unique identifier of the each API calls                                   |
| patronId                | This parameter is returned as userId parameter of login request.              |
| task                    | Type of task - generateOTP                                                    |
| result                  | An object that contains result                                                |
| result.requestId        | This token will be used to fetch the certifcate using Vaccination Details API |

***

:::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](mailto\:help@signzy.com).
:::

