Send Verification OTP
APIs for sending Verification OTP
Before you can send OTP via SMS, you need to have created your Sender ID. Please go to your dashboard, click on channels and click on SMS channel to create your Sender ID.
Before you can send OTP via Email, you need to have created your Sender Email. Please go to your dashboard , click on channels and click on Email channel to create your Sender Email.
Please note for now that on Sandbox/Test Environment we simulate the SMS, VOICE & Email sending. Use the simulator here

Base URL

Depending on your environment, use any of these Base URL below
Live Base URL: https://api.sendchamp.com/api/v1/
Sandbox Base URL: https://sandbox-api.sendchamp.com/api/v1/
  1. 1.
    Find the Access Key for Authentication under Account Settings on your Dashboard.
  2. 2.
    When you use Sandbox Environment, your messages can be found on our simulator here
post
https://{BASE_URL}
/api/v1/verification/create
Send Verification OTP

Code Samples

CURL
JSON
PHP
NODE
JAVASCRIPT
PYTHON
C#
JAVA
RUBY
1
curl --location --request POST 'https://sandbox-api.sendchamp.com/api/v1/verification/create' \
2
--header 'Accept: application/json' \
3
--header 'Content-Type: application/json' \
4
--header 'Authorization: Bearer sendchamp_test_$2y$10$U2SHG5T2F/cr0jfzNCKgguHv.23plvJP/75EzZjF5MtLXz65SDrQi' \
5
--data-raw '{
6
"channel":"sms",
7
"token_type":"numeric",
8
"token_length":"5",
9
"expiration_time":6,
10
"customer_email":"[email protected]",
11
"customer_mobile_number":"2348119974190",
12
"meta_data":{"first_name":"segun"}
13
}'
Copied!
1
{
2
"channel":"sms",
3
"token_type":"numeric",
4
"token_length":"5",
5
"expiration_time":6,
6
"customer_email":"[email protected]",
7
"customer_mobile_number":"2348119974190",
8
"meta_data":{"first_name":"segun"}
9
}
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://sandbox-api.sendchamp.com/api/v1/verification/create',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"channel":"sms",
16
"token_type":"numeric",
17
"token_length":"5",
18
"expiration_time":6,
19
"customer_email":"[email protected]",
20
"customer_mobile_number":"2348119974190",
21
"meta_data":{"first_name":"segun"}
22
}',
23
CURLOPT_HTTPHEADER => array(
24
'Accept: application/json',
25
'Content-Type: application/json',
26
'Authorization: Bearer sendchamp_test_$2y$10$U2SHG5T2F/cr0jfzNCKgguHv.23plvJP/75EzZjF5MtLXz65SDrQi'
27
),
28
));
29
30
$response = curl_exec($curl);
31
32
curl_close($curl);
33
echo $response;
34
Copied!
1
var request = require('request');
2
3
var options = {
4
'method': 'POST',
5
'url': 'https://sandbox-api.sendchamp.com/api/v1/verification/create',
6
'headers': {
7
'Accept': 'application/json',
8
'Content-Type': 'application/json',
9
'Authorization': 'Bearer sendchamp_test_$2y$10$U2SHG5T2F/cr0jfzNCKgguHv.23plvJP/75EzZjF5MtLXz65SDrQi'
10
},
11
body: JSON.stringify({"channel":"sms","token_type":"numeric","token_length":"5","expiration_time":6,"customer_email":"[email protected]","customer_mobile_number":"2348119974190","meta_data":{"first_name":"segun"}})
12
13
};
14
15
request(options, function (error, response) {
16
if (error) throw new Error(error);
17
console.log(response.body);
18
});
Copied!
1
var data = JSON.stringify({"channel":"sms","token_type":"numeric","token_length":"5","expiration_time":6,"customer_email":"[email protected]","customer_mobile_number":"2348119974190","meta_data":{"first_name":"segun"}});
2
3
var xhr = new XMLHttpRequest();
4
xhr.withCredentials = true;
5
6
xhr.addEventListener("readystatechange", function() {
7
if(this.readyState === 4) {
8
console.log(this.responseText);
9
}
10
});
11
12
xhr.open("POST", "https://sandbox-api.sendchamp.com/api/v1/verification/create");
13
xhr.setRequestHeader("Accept", "application/json");
14
xhr.setRequestHeader("Content-Type", "application/json");
15
xhr.setRequestHeader("Authorization", "Bearer sendchamp_test_$2y$10$U2SHG5T2F/cr0jfzNCKgguHv.23plvJP/75EzZjF5MtLXz65SDrQi");
16
17
xhr.send(data);
Copied!
1
import requests
2
3
url = "https://sandbox-api.sendchamp.com/api/v1/verification/create"
4
5
payload="{\n \"channel\":\"sms\",\n \"token_type\":\"numeric\",\n \"token_length\":\"5\",\n \"expiration_time\":6,\n \"customer_email\":\"[email protected]\",\n \"customer_mobile_number\":\"2348119974190\",\n \"meta_data\":{\"first_name\":\"segun\"}\n}"
6
headers = {
7
'Accept': 'application/json',
8
'Content-Type': 'application/json',
9
'Authorization': 'Bearer sendchamp_test_$2y$10$U2SHG5T2F/cr0jfzNCKgguHv.23plvJP/75EzZjF5MtLXz65SDrQi'
10
}
11
12
response = requests.request("POST", url, headers=headers, data=payload)
13
14
print(response.text)
15
Copied!
1
var client = new RestClient("https://sandbox-api.sendchamp.com/api/v1/verification/create");
2
client.Timeout = -1;
3
var request = new RestRequest(Method.POST);
4
5
request.AddHeader("Accept", "application/json");
6
request.AddHeader("Content-Type", "application/json");
7
request.AddHeader("Authorization", "Bearer sendchamp_test_$2y$10$U2SHG5T2F/cr0jfzNCKgguHv.23plvJP/75EzZjF5MtLXz65SDrQi");
8
request.AddParameter("application/json", "{\n \"channel\":\"sms\",\n \"token_type\":\"numeric\",\n \"token_length\":\"5\",\n \"expiration_time\":6,\n \"customer_email\":\"[email protected]\",\n \"customer_mobile_number\":\"2348119974190\",\n \"meta_data\":{\"first_name\":\"segun\"}\n}", ParameterType.RequestBody);
9
10
IRestResponse response = client.Execute(request);
11
12
Console.WriteLine(response.Content);
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.post("https://sandbox-api.sendchamp.com/api/v1/verification/create")
3
.header("Accept", "application/json")
4
.header("Content-Type", "application/json")
5
.header("Authorization", "Bearer sendchamp_test_$2y$10$U2SHG5T2F/cr0jfzNCKgguHv.23plvJP/75EzZjF5MtLXz65SDrQi")
6
.body("{\n \"channel\":\"sms\",\n \"token_type\":\"numeric\",\n \"token_length\":\"5\",\n \"expiration_time\":6,\n \"customer_email\":\"[email protected]\",\n \"customer_mobile_number\":\"2348119974190\",\n \"meta_data\":{\"first_name\":\"segun\"}\n}")
7
.asString();
8
Copied!
1
require "uri"
2
require "net/http"
3
4
url = URI("https://sandbox-api.sendchamp.com/api/v1/verification/create")
5
6
https = Net::HTTP.new(url.host, url.port)
7
https.use_ssl = true
8
9
request = Net::HTTP::Post.new(url)
10
request["Accept"] = "application/json"
11
request["Content-Type"] = "application/json"
12
request["Authorization"] = "Bearer sendchamp_test_$2y$10$U2SHG5T2F/cr0jfzNCKgguHv.23plvJP/75EzZjF5MtLXz65SDrQi"
13
request.body = "{\n \"channel\":\"sms\",\n \"token_type\":\"numeric\",\n \"token_length\":\"5\",\n \"expiration_time\":6,\n \"customer_email\":\"[email protected]\",\n \"customer_mobile_number\":\"2348119974190\",\n \"meta_data\":{\"first_name\":\"segun\"}\n}"
14
15
response = https.request(request)
16
puts response.read_body
17
Copied!

Postman Collection

If you have not downloaded the Postman Collection for a quick test, you can do that here

Libraries/SDKs

We would be releasing libraries/SDKs for more easier integrations in your favorite language/framework. If you happen to create one, do let us know via our community and we would be happy to work on making it the official library and some other benefits.

Feedback

We always want to hear about your experience using our API documentation. If you have any comments 😌 or want to tell us good work 😁 , please do tell us here and we will call you.
Don't forget to join our community here
Last modified 14d ago