---
title: How to Integrate SMSGatewayCenter OTP SMS API
description: "Ready to secure your transactions with SMSGatewayCenter’s **[OTP SMS API](https://www.smsgatewaycenter.com/developer-api/generate-otp/)**? This powerful tool generates and delivers one-time passwords instantly, perfect for 2FA or user verification. Let’s walk through the integration process step-by-step! ## **Integration Steps** 1. **Get Your Credentials**: Log…"
url: "https://www.smsgatewaycenter.com/blog/kb/how-to-integrate-smsgatewaycenter-otp-sms-api/"
updated: "2025-04-15"
category: API
---

# How to Integrate SMSGatewayCenter OTP SMS API

Ready to secure your transactions with SMSGatewayCenter’s **[OTP SMS API](https://www.smsgatewaycenter.com/developer-api/generate-otp/)**? This powerful tool generates and delivers one-time passwords instantly, perfect for 2FA or user verification. Let’s walk through the integration process step-by-step!

## **Integration Steps**

1. **Get Your Credentials**: Log in to your SMSGatewayCenter account, head to the API section, and grab your `userId`, `password`, and `senderId` (ensure it’s DLT-registered for compliance).
2. **Choose Your Method**: Use POST or GET requests. Endpoint: **https://unify.smsgateway.center/SMSApi/otp**.
3. **Set Up Parameters**: Include required fields like `userId`, `password`, `mobile` (e.g., `919876543210`), `msg` (e.g., `Your OTP is $otp$`), `codeLength` (e.g., `4`), and `sendMethod=generate`. Example (PHP with cURL):

```
   $curl = curl_init();
   curl_setopt_array($curl, array(
       CURLOPT_URL => "https://unify.smsgateway.center/SMSApi/otp",
       CURLOPT_RETURNTRANSFER => true,
       CURLOPT_POSTFIELDS => "userid=YourUserName&password=YourPassword&mobile=919876543210&msg=Your OTP is $otp$&codeLength=4&sendMethod=generate",
   ));
   $response = curl_exec($curl);
   curl_close($curl);
   echo $response;
```

1. **Test the API**: Send a test OTP and check the response (e.g., `status: success`, `transactionId`).
2. **Implement Verification**: Use `sendMethod=verify` with the `otp` value entered by the user to validate.

**Best Practices**

- Register OTP templates with DLT for compliance.
- Set `codeExpiry` (e.g., 60 seconds) to limit OTP validity.
- Use HTTPS to secure data transmission.

**Support**
Need assistance? Reach out to contact @ smsgatewaycenter.com or call +912228657726.

### More Related Articles

- [How do I secure my API keys in a production environment?](https://www.smsgatewaycenter.com/blog/kb/how-do-i-secure-my-api-keys-in-a-production-environment/)
- [What should I do if my API request times out?](https://www.smsgatewaycenter.com/blog/kb/what-should-i-do-if-my-api-request-times-out/)
- [Solving Common Verify OTP API Problems](https://www.smsgatewaycenter.com/blog/kb/solving-common-verify-otp-api-problems/)

Found this useful?[Add as Preferred Source on Google](https://www.google.com/preferences/source?q=smsgatewaycenter.com)
