{
"success": true,
"payload": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"tn": {},
"to": "string",
"thread": "string",
"message": "string",
"reference_id": "string",
"state": "created",
"delivered": true,
"automated": true,
"custom_callback_url": "string",
"account": {},
"created_by": {}
}
}
{
"success": true,
"payload": {
"to": "J Smith",
"message": "test message",
"custom_callback_url": "www.example.com",
"state": "created",
"uuid": "6f837aa1-f6aa-45af-9764-3c4bfa84098f",
"thread": "fdbbf3c163f386c272ed1b75a1d898bf",
"delivered": false,
"reference_id": null,
"created_on": "2020-10-27T16:33:05.928Z",
"modified_on": "2020-10-27T16:33:05.928Z",
"automated": false
}
}
{
"success": true,
"message": "string",
"status": 0
}
{
"success": true,
"message": "string",
"status": 0
}
{
"success": true,
"message": "string",
"status": 0
}
curl -X POST "https://api.opentact.org/rest/sms" \
-H "accept: application/json" \
-H "X-Auth-Token: JWT_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"to\":\"J Smith\",\"tn\":12013046585,\"message\":\"test message\",\"custom_callback_url\":\"www.example.com\"}"
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'X-Auth-Token' => 'JWT_TOKEN',
'Content-Type' => 'application/json'
);
$data = '{"to":"J Smith","tn":12013046585,"message":"test message","custom_callback_url":"www.example.com"}';
$response = Requests::post('https://api.opentact.org/rest/sms', $headers, $data);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json',
}
data = '{"to":"J Smith","tn":12013046585,"message":"test message","custom_callback_url":"www.example.com"}'
response = requests.post('https://api.opentact.org/rest/sms', headers=headers, data=data)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/sms', {
method: 'POST',
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({"to":"J Smith","tn":12013046585,"message":"test message","custom_callback_url":"www.example.com"})
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"to":"J Smith","tn":12013046585,"message":"test message","custom_callback_url":"www.example.com"}`)
req, err := http.NewRequest("POST", "https://api.opentact.org/rest/sms", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-Auth-Token", "JWT_TOKEN")
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}