API CODE

Here you can find our API in multiple programming languages for integration with your system.

cURL / Shell

SMS API

curl --request POST--url 'http://sms.mtalkz.com/SendSMS/sendmsg.php?pass=password&send=SenderId%20as%20required&dest=Destination%20Mobile%20Number&uname=Username&msg=Body%20of%20the%20message&wapurl=URL'

Voice Template API

curl --request POST--url 'http://vapi.mtalkz.com/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time'--header 'content-type: application/javascript'

Voice Broadcast API

curl --request POST--url 'http://vapi.mtalkz.com/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id'
PHP

SMS API

<?php
$data =array(
‘dest’ => ‘0000000000’,
‘msg’=>’This is Test message’,
‘pass’=>’xyz’,
‘send’=>’ALERTS’,
‘uname’=>’ xyz ‘,
‘wapurl’=>’sms.mtalkz.com‘
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => “http://www.sms.mtalkz.com/SendSMS/sendmsg.php“,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
“cache-control: no-cache”,
“content-type: multipart/form-data”,
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo “cURL Error #:” . $err;
} else {
echo $response;
}

Voice Template API

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => “http://vapi.mtalkz.com/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => “”,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_HTTPHEADER => array(
“content-type: application/javascript”
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo “cURL Error #:” . $err;
} else {
echo $response;
}

Voice Broadcast API

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => “http://vapi.mtalkz.com/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => “”,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo “cURL Error #:” . $err;
} else {
echo $response;
}
Python

SMS API

import http.client
conn = http.client.HTTPConnection(“sms.mtalkz.com”)
payload = “”
conn.request(“POST”, “/SendSMS/sendmsg.php?pass=password&send=SenderId%20as%20required&dest=Destination%20Mobile%20Number&uname=Username&msg=Body%20of%20the%20message&wapurl=URL”, payload)
res = conn.getresponse()
data = res.read()
print(data.decode(“utf-8”))

Voice Template API

import http.client
conn = http.client.HTTPConnection(“vapi.mtalkz.com”)
payload = “”
headers = { ‘content-type’: “application/javascript” }
conn.request(“POST”, “/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time”, payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode(“utf-8”))

Voice Broadcast API

import http.client
conn = http.client.HTTPConnection(“vapi.mtalkz.com”)
payload = “”
conn.request(“POST”, “/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id”, payload)
res = conn.getresponse()
data = res.read()
print(data.decode(“utf-8”))
Ruby

SMS API

require 'uri'require 'net/http'
url = URI(“http://sms.mtalkz.com/SendSMS/sendmsg.php?pass=password&send=SenderId%20as%20required&dest=Destination%20Mobile%20Number&uname=Username&msg=Body%20of%20the%20message&wapurl=URL”)
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body

Voice Template API

require 'uri'require 'net/http'
url = URI(“http://vapi.mtalkz.com/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time”)
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request[“content-type”] = ‘application/javascript’
response = http.request(request)
puts response.read_body

Voice Broadcast API

import http.client
conn = http.client.HTTPConnection(“vapi.mtalkz.com”)
payload = “”
conn.request(“POST”, “/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id”, payload)
res = conn.getresponse()
data = res.read()
print(data.decode(“utf-8”))
Go

SMS API

package main
import (
“fmt”
“net/http”
“io/ioutil”
)
func main() {
url := “http://sms.mtalkz.com/SendSMS/sendmsg.php?pass=password&send=SenderId%20as%20required&dest=Destination%20Mobile%20Number&uname=Username&msg=Body%20of%20the%20message&wapurl=URL”
req, _ := http.NewRequest(“POST”, url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}

Voice Template API

package main
import (
“fmt”
“net/http”
“io/ioutil”
)
func main() {
url := “http://vapi.mtalkz.com/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time”
req, _ := http.NewRequest(“POST”, url, nil)
req.Header.Add(“content-type”, “application/javascript”)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}

Voice Broadcast API

package main
import (
“fmt”
“net/http”
“io/ioutil”
)
func main() {
url := “http://vapi.mtalkz.com/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id”
req, _ := http.NewRequest(“POST”, url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Java

SMS API

HttpResponse<String> response = Unirest.post("http://sms.mtalkz.com/SendSMS/sendmsg.php?pass=password&send=SenderId%20as%20required&dest=Destination%20Mobile%20Number&uname=Username&msg=Body%20of%20the%20message&wapurl=URL").asString();

Voice Template API

HttpResponse<String> response = Unirest.post("http://vapi.mtalkz.com/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time").header("content-type", "application/javascript").asString();

Voice Broadcast API

HttpResponse<String> response = Unirest.post("http://vapi.mtalkz.com/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id").asString();
JavaScript

SMS API

var settings = {"async": true,"crossDomain": true,"url": "http://sms.mtalkz.com/SendSMS/sendmsg.php?pass=password&send=SenderId%20as%20required&dest=Destination%20Mobile%20Number&uname=Username&msg=Body%20of%20the%20message&wapurl=URL","method": "POST","headers": {}}
$.ajax(settings).done(function (response) {
console.log(response);
});

Voice Template API

var settings = {"async": true,"crossDomain": true,"url": "http://vapi.mtalkz.com/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time","method": "POST","headers": {"content-type": "application/javascript"}}
$.ajax(settings).done(function (response) {
console.log(response);
});

Voice Broadcast API

var settings = {"async": true,"crossDomain": true,"url": "http://vapi.mtalkz.com/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id","method": "POST","headers": {}}
$.ajax(settings).done(function (response) {
console.log(response);
});
NodeJS

SMS API

var http = require("http");
var options = {
“method”: “POST”,
“hostname”: “sms.mtalkz.com”,
“port”: null,
“path”: “/SendSMS/sendmsg.php?pass=password&send=SenderId%20as%20required&dest=Destination%20Mobile%20Number&uname=Username&msg=Body%20of%20the%20message&wapurl=URL”,
“headers”: {}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on(“data”, function (chunk) {
chunks.push(chunk);
});
res.on(“end”, function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();

Voice Template API

var http = require("http");
var options = {
“method”: “POST”,
“hostname”: “vapi.mtalkz.com”,
“port”: null,
“path”: “/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time”,
“headers”: {
“content-type”: “application/javascript”
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on(“data”, function (chunk) {
chunks.push(chunk);
});
res.on(“end”, function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();

Voice Broadcast API

var http = require("http");
var options = {
“method”: “POST”,
“hostname”: “vapi.mtalkz.com”,
“port”: null,
“path”: “/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id”,
“headers”: {}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on(“data”, function (chunk) {
chunks.push(chunk);
});
res.on(“end”, function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
Swift

SMS API

import Foundation
let request = NSMutableURLRequest(url: NSURL(string: “http://sms.mtalkz.com/SendSMS/sendmsg.php?pass=password&send=SenderId%20as%20required&dest=Destination%20Mobile%20Number&uname=Username&msg=Body%20of%20the%20message&wapurl=URL”)! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = “POST”
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()

Voice Template API

import Foundation
let headers = [“content-type”: “application/javascript”]let request = NSMutableURLRequest(url: NSURL(string: “http://vapi.mtalkz.com/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time”)! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = “POST”
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()

Voice Broadcast API

import Foundation
let request = NSMutableURLRequest(url: NSURL(string: “http://vapi.mtalkz.com/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id”)! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = “POST”
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
C#

SMS API

var client = new RestClient("http://sms.mtalkz.com/SendSMS/sendmsg.php?pass=password&send=SenderId%20as%20required&dest=Destination%20Mobile%20Number&uname=Username&msg=Body%20of%20the%20message&wapurl=URL");var request = new RestRequest(Method.POST);IRestResponse response = client.Execute(request);

Voice Template API

var client = new RestClient("http://vapi.mtalkz.com/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time");var request = new RestRequest(Method.POST);request.AddHeader("content-type", "application/javascript");IRestResponse response = client.Execute(request);

Voice Broadcast API

var client = new RestClient("http://vapi.mtalkz.com/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id");var request = new RestRequest(Method.POST);IRestResponse response = client.Execute(request);
C

SMS API

CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, “POST”);
curl_easy_setopt(hnd, CURLOPT_URL, “http://sms.mtalkz.com/SendSMS/sendmsg.php?pass=password&send=SenderId%20as%20required&dest=Destination%20Mobile%20Number&uname=Username&msg=Body%20of%20the%20message&wapurl=URL”);
CURLcode ret = curl_easy_perform(hnd);

Voice Template API

CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, “POST”);
curl_easy_setopt(hnd, CURLOPT_URL, “http://vapi.mtalkz.com/voiceapi/tapi.php?account=account%20name&pin=password&templateid=unique%20number&retry=number%20of%20retries&sch_time=scheduled%20start%20time&end_time=scheduled%20end%20time”);
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, “content-type: application/javascript”);
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);

Voice Broadcast API

CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, “POST”);
curl_easy_setopt(hnd, CURLOPT_URL, “http://vapi.mtalkz.com/voiceapi/bapi.php?account=account%20name&pin=unique%20password&campaignid=unique%20campaign%20id”);
CURLcode ret = curl_easy_perform(hnd);

Looking for a WooCommerce Plugin?

Talk To Sales

Enquire for a Service

Fill the form on the right and enquire for our services, a free trial or find a developer for integrating our service with your apps.

Get Started for Free

Use mTalkz to connect to your customers, vendors and employees over an SMS. Send promotional SMS for special offers, Delivery notifications via transactional SMS, or OTP message for purchase confirmation.

Contact us now to get 100 Free SMS credits to test our services.

Find Developers

Need help with integrating the API with your system? We can connect you with some technical experts proficient with our APIs.

Contact us now to get in touch with a developer.







 

Looking for a Job?

Send your resume to [email protected]