Create a Send SMS OTP Link end point
Call the /send
API with the below body parameters to ensure a magic link being sent to the user.
complete 400 section
Call
curl --request POST
--url https://api.ezid.io/send/otp \
--header 'Content-Type: application/json' \
--data {
client_id: "ezid_client_id",
client_secret: "ezid_client_secret",
digits: "6",
channel: "phone",
target: "+00-0000000",
expiry: "10",
claims: {
test-claims: "full-access"
},
}
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));');
let url = 'https://api.ezid.io/send/otp';
let options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: {
client_id: "ezid_client_id",
client_secret: "ezid_client_secret",
digits: "6",
channel: "phone",
target: "+00-0000000",
expiry: "10",
claims: {
test-claims: "full-access"
},
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
Attributes | Definition |
---|---|
client_id* | Your companies unique ID, provided by EZiD |
client_secret* | You companies unique secret, provided by EZiD |
digits* | Length of OTP sent to user. Note: Default: 6, Min: 4, Max: 6 |
channel | How you choose to send the OTP to your user. Note: Currently, we only have phone available. Whats app and Email OTPs are coming soon. |
target | Users phone number Note: To test our OTP, please enter a valid number |
expiry | expiry for OTP in minutes |
claims | Add custom claims for your own API access control. These will be encoded into the access token you receive |
Responses:
{
otp: 343786,
login_id: "157637a8-3840-4c8b-009e8d4d0af"
}
{
success: false,
reason: "Invalid Client Secret"
}
Attributes | Definition |
---|---|
otp | One time passcode sent to the user |
login_id | The login id sent to the user for authentication |