{"status": 200,"message": "SMS has been sent to recipient successfully.","data": {"id": "YOUR_ID","token": "YOUR_TOKEN","sender": "Tagget","body": "Hello world","to": "+2348188216769"}}
{"status": 400,"message": "Error sending SMS message to recipient.","data": null}
var data = JSON.stringify({"id": "YOUR_ID","token": "YOUR_TOKEN","sender": "Tagget","body": "Hello world","to": "+18397536474 "});var xhr = new XMLHttpRequest();xhr.withCredentials = true;xhr.addEventListener("readystatechange", function () {if (this.readyState === 4) {console.log(this.responseText);}});xhr.open("POST", "https://api.tagget.io/engage/send_sms");xhr.setRequestHeader("content-type", "application/json");xhr.setRequestHeader("cache-control", "no-cache");xhr.send(data);
import requestsurl = "https://api.tagget.io/engage/send_sms"payload = "{\n\t\"id\":\"YOUR_ID\",\n\t\"token\":\"YOUR_TOKEN\",\n\t\"sender\":\"Tagget\",\n\t\"body\": \"Hello world\",\n\t\"to\": \"+2348188216769\"\n}"headers = {'content-type': "application/json",'cache-control': "no-cache"}response = requests.request("POST", url, data=payload, headers=headers)print(response.text)
var http = require("https");var options = {"method": "POST","hostname": "api.tagget.io","port": null,"path": "/engage/send_sms","headers": {"content-type": "application/json","cache-control": "no-cache"}};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.write(JSON.stringify({ id: 'YOUR_ID',token: 'YOUR_TOKEN',sender: 'Tagget',body: 'Hello world',to: '+195848757465' }));req.end();
<?php$curl = curl_init();curl_setopt_array($curl, array(CURLOPT_URL => "https://api.tagget.io/engage/send_sms",CURLOPT_RETURNTRANSFER => true,CURLOPT_ENCODING => "",CURLOPT_MAXREDIRS => 10,CURLOPT_TIMEOUT => 30,CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,CURLOPT_CUSTOMREQUEST => "POST",CURLOPT_POSTFIELDS => "{\n\t\"id\":\"YOUR_ID\",\n\t\"token\":\"YOUR_TOKEN\",\n\t\"sender\":\"Tagget\",\n\t\"body\": \"Hello world\",\n\t\"to\": \"+18578476746\"\n}",CURLOPT_HTTPHEADER => array("cache-control: no-cache","content-type: application/json"),));$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) {echo "cURL Error #:" . $err;} else {echo $response;}
OkHttpClient client = new OkHttpClient();MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{\n\t\"id\":\"YOUR_ID\",\n\t\"token\":\"YOUR_TOKEN\",\n\t\"sender\":\"Tagget\",\n\t\"body\": \"Hello world\",\n\t\"to\": \"+183467364733\"\n}");Request request = new Request.Builder().url("https://api.tagget.io/engage/send_sms").post(body).addHeader("content-type", "application/json").addHeader("cache-control", "no-cache").build();Response response = client.newCall(request).execute();
require 'uri'require 'net/http'url = URI("https://api.tagget.io/engage/send_sms")http = Net::HTTP.new(url.host, url.port)http.use_ssl = truehttp.verify_mode = OpenSSL::SSL::VERIFY_NONErequest = Net::HTTP::Post.new(url)request["content-type"] = 'application/json'request["cache-control"] = 'no-cache'request.body = "{\n\t\"id\":\"YOUR_ID\",\n\t\"token\":\"YOUR_TOKEN\",\n\t\"sender\":\"Tagget\",\n\t\"body\": \"Hello world\",\n\t\"to\": \"+1985458475434\"\n}"response = http.request(request)puts response.read_body
var client = new RestClient("https://api.tagget.io/engage/send_sms");var request = new RestRequest(Method.POST);request.AddHeader("cache-control", "no-cache");request.AddHeader("content-type", "application/json");request.AddParameter("application/json", "{\n\t\"id\":\"YOUR_ID\",\n\t\"token\":\"YOUR_TOKEN\",\n\t\"sender\":\"Tagget\",\n\t\"body\": \"Hello world\",\n\t\"to\": \"+134867465475\"\n}", ParameterType.RequestBody);IRestResponse response = client.Execute(request);