# Sms otp


# Description

You can use this API to send otp code.

# Endpoint

    POST https://019sms.co.il/api
  

# Parameters

Name Type Description Required
send_otp object Contains all other elements. ✔️
user object Contains the user element. ✔️
username string The username of the account by which you are recognized in the system ✔️
phone int Must be formatted: 5xxxxxxx or 05xxxxxxx ✔️
app_id int If you have several applications that you want to use with this service - use to differentiate the authentication in each application. By default it is 1
source string The source number of the SMS, meaning the number that will appear as the sender. ✔️
max_tries int A number between 3-5. which means how many attempts you can make on the code. By default it is 3
valid_time int A number between 1-15. That means how many minutes the code will be available. By default it is 5
text string Custom text – must contains '[code]' in which the real code will appear in the message for the destination. (if not send the default is : ' the code is [code]')

# Request Example

json
Copy code
    {
  "send_otp": {
    "user": {
      "username": "username"
    },
    "phone": "05XXXXXXXX",
    "app_id": "1000",
    "source": "***",
    "max_tries": "4",
    "text": "the code is [code]"
  }
}

  
xml
Copy code
    <?xml version="1.0" encoding="UTF-8"?>
<send_otp>
    <user>
        <username>username</username>
    </user>
    <phone>05XXXXXXXX</phone>
    <app_id>1000</app_id>
    <source>***</source>
    <max_tries>4</max_tries>
    <text>the code is [code]</text>
</send_otp>

  

# Response Example

json
Copy code
    {
  "status": 0,
  "code": "494036",
  "message": "The code is : 494036 and is valid for 5 minutes"
}

  
xml
Copy code
    <?xml version="1.0" encoding="utf-8"?>
<sms>
    <status>0</status>
    <code>448431</code>
    <message>The code is : 448431 and is valid for 5 minutes</message>
</sms>

  

Note

Full description of the response status and message can be found here.

Last Updated: 7/13/2025, 9:35:34 AM