Code :
<?php
var client = new RestClient("http://yourdomain.com/api/mt/SendSMS?APIKey=yourkey&senderid=TESTIN&channel=2&route=1&DCS=0&flashsms=0&number=9999999999&text=Test%20sms");
var request = new RestRequest(Method.POST);
request.AddHeader("postman-token", "aea61da0-8374-fb2d-8f07-9db176651869");
request.AddHeader("cache-control", "no-cache");
IRestResponse response = client.Execute(request);
?>
Code :
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "http://yourdomain.com/api/mt/SendSMS?APIKey=yourkey&senderid=TESTIN&channel=2&route=1&DCS=0&flashsms=0&number=9999999999&text=Test%20sms"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("cache-control", "no-cache")
req.Header.Add("postman-token", "ac2197da-fe66-8512-74ca-aff8803e37c1")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Code :
<script>
var settings = {
"async": true,
"crossDomain": true,
"url": "http://yourdomain.com/api/mt/SendSMS?APIKey=yourkey&senderid=TESTIN&channel=2&route=1&DCS=0&flashsms=0&number=9999999999&text=Test%20sms",
"method": "POST",
"headers": {
"cache-control": "no-cache",
"postman-token": "81474fbe-f0f9-14ba-34a9-5e19517c83a2"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
</script>
Code :
<script>
var request = require("request");
var options = { method: 'POST',
url: 'http://yourdomain.com/api/mt/SendSMS',
qs:
{ APIKey: 'yourkey',
senderid: 'TESTIN',
channel: '2',
route: '1',
DCS: '0',
flashsms: '0',
number: '9999999999',
text: 'Test sms' },
headers:
{ 'postman-token': '40649815-9f72-6874-3ab5-5e0485f3ede6',
'cache-control': 'no-cache' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
</script>
Code :
import requests
url = "http://yourdomain.com/api/mt/SendSMS"
querystring = {"APIKey":"yourkey","senderid":"TESTIN","channel":"2","route":"1","DCS":"0","flashsms":"0","number":"9999999999","text":"Test sms"}
headers = {
'cache-control': "no-cache",
'postman-token': "6847c2e0-a826-79a1-ce21-f84cbd756681"
}
response = requests.request("POST", url, headers=headers, params=querystring)
print(response.text)
Code :
require 'uri'
require 'net/http'
url = URI("http://yourdomain.com/api/mt/SendSMS?APIKey=yourkey&senderid=TESTIN&channel=2&route=1&DCS=0&flashsms=0&number=9999999999&text=Test%20sms")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["cache-control"] = 'no-cache'
request["postman-token"] = 'a8de183e-6133-23b3-2b4a-5cc5332f15c2'
response = http.request(request)
puts response.read_body
Code :
import Foundation
let headers = [
"cache-control": "no-cache",
"postman-token": "0436367a-8fda-1cb0-41e5-91699b66c3b1"
]
let request = NSMutableURLRequest(url: NSURL(string: "http://yourdomain.com/api/mt/SendSMS?APIKey=yourkey&senderid=TESTIN&channel=2&route=1&DCS=0&flashsms=0&number=9999999999&text=Test%20sms")! 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()