# Lean - sendOtpDisposable

Use this method to send an otp by sms.

DEPRECATED API
**This method is deprecated. You should replace it with the** [**sendOtp**](/products/leandisposable/enterprise-documentation/developer-documentation/api-references/lean-send-otp/lean-sendotp-method)  **method.**

REST API
no REST API

SOAP API
The SOAP interface is deprecated. Use the REST API instead.

**Method:** sendOtpDisposable

| **Parameter** | **Description** | **Mandatory** |
|  --- | --- | --- |
| certIdOtp | the identification of the otp associate to the disposable | YES |
| deviceCode | the device code of the issued certificate | YES |
| textSms | The text of the sms. With the addition of tag `$OTP$` inside the field textSMS the otp code is inserted in the desired position, while in the absence of this tag it will be inserted at the end. | YES |
| sendSms_test | it is considered only in test environment and allow to not send an sms when the function is called.    Use false to not send the sms.  Default value is true. | NO |
| lraid | The LRA identification code | NO |


Only in test environment this function returns in the output header the otp code generated by the function.

#### Request example:


```xml
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.nam/">
   <soapenv:Header />
   <soapenv:Body>
      <ser:sendOtpDisposable>
         <certIdOtp>226762</certIdOtp>
         <deviceCode>RHILN00000040</deviceCode>
         <textSMS>COMPANY_NAME: otp code to sign:</textSMS>
         <lraid>111</lraid>
      </ser:sendOtpDisposable>
   </soapenv:Body>
</soapenv:Envelope>
```

‌

#### Error codes

The main errors that can be found within this function are (all return HTTP `500`):

| Error code | Description |
|  --- | --- |
| [2](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-2-empty-field) | Some required fields are missing |
| [6](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-6-generic-exception---internal-exception) | Generic exception — internal exception |
| 62 | The `certIdOtp` is not valid |
| 66 | The device OTP is not active |
| 71 | The device OTP is disabled |
| [85](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-85-device-type-missing-or-not-allowed) | The `deviceCode` is not valid |
| [99](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-99-otp-was-not-sent) | OTP was not sent |
| [100](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-100-the-mobile-phone-number-is-not-valid) | The mobile phone number is not valid |
| [101](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-101-sms-blocked-by-the-watchlist) | SMS blocked by the watchlist |
| [102](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-102-the-email-address-is-not-valid) | The email address is not valid |
| [103](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-103-the-otp-service-has-exceeded-the-timeout) | The OTP service has exceeded the timeout |
| 138 | The device OTP is not an SMS OTP device |
| [231](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-231-otp-is-blocked) | OTP is blocked |
| [241](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors#error-241-lra-not-authorized-to-use-this-type-of-otp) | LRA not authorized to use this OTP type |


For authentication errors, see [Authentication](/products/leandisposable/enterprise-documentation/developer-documentation/authentication).

For details on how to handle errors, see [How to handle errors](/products/leandisposable/enterprise-documentation/developer-documentation/integration-guide/lean-ig-how-to-handle-errors).