# Send a messagecurl -X POST https://api.wali.chat/v1/messages \ -H "Authorization: $WALI_TOKEN" \ -H "Content-Type: application/json" \ -d '{"phone": "+14155550142", "message": "Your order shipped"}'# Send a file: same call, media body -d '{"phone": "+14155550142", "media": {"url": "https://acme.co/cat.pdf"}}'# Schedule it: same call, deliverAt -d '{"phone": "+14155550142", "message": "Doors open at 9:00", "deliverAt": "2026-08-25T09:00:00Z"}'
// One tiny client for every callconst wali = (body) => fetch('https://api.wali.chat/v1/messages', { method: 'POST', headers: { Authorization: process.env.WALI_TOKEN, 'Content-Type': 'application/json' }, body: JSON.stringify(body) })// Send a messageawait wali({ phone: '+14155550142', message: 'Your order shipped' })// Send a fileawait wali({ phone: '+14155550142', media: { url: 'https://acme.co/cat.pdf' } })// Schedule it for tomorrow at 9:00await wali({ phone: '+14155550142', message: 'Doors open at 9:00', deliverAt: '2026-08-25T09:00:00Z' })
import os, requestsdef wali(**body): return requests.post( "https://api.wali.chat/v1/messages", headers={"Authorization": os.environ["WALI_TOKEN"]}, json=body)# Send a messagewali(phone="+14155550142", message="Your order shipped")# Send a filewali(phone="+14155550142", media={"url": "https://acme.co/cat.pdf"})# Schedule it for tomorrow at 9:00wali(phone="+14155550142", message="Doors open at 9:00", deliverAt="2026-08-25T09:00:00Z")
<?php // composer require guzzlehttp/guzzle$wali = new GuzzleHttp\Client([ 'base_uri' => 'https://api.wali.chat/v1/', 'headers' => [ 'Authorization' => getenv('WALI_TOKEN') ]]);// Send a message$wali->post('messages', ['json' => [ 'phone' => '+14155550142', 'message' => 'Your order shipped']]);// Send a file$wali->post('messages', ['json' => [ 'phone' => '+14155550142', 'media' => ['url' => 'https://acme.co/cat.pdf']]]);// Schedule it for tomorrow at 9:00$wali->post('messages', ['json' => [ 'phone' => '+14155550142', 'message' => 'Doors open at 9:00', 'deliverAt' => '2026-08-25T09:00:00Z']]);
// One helper for every callfunc wali(body string) { req, _ := http.NewRequest("POST", "https://api.wali.chat/v1/messages", strings.NewReader(body)) req.Header.Set("Authorization", os.Getenv("WALI_TOKEN")) req.Header.Set("Content-Type", "application/json") http.DefaultClient.Do(req)}// Send a messagewali(`{"phone": "+14155550142", "message": "Your order shipped"}`)// Send a filewali(`{"phone": "+14155550142", "media": {"url": "https://acme.co/cat.pdf"}}`)// Schedule it for tomorrow at 9:00wali(`{"phone": "+14155550142", "message": "Doors open at 9:00", "deliverAt": "2026-08-25T09:00:00Z"}`)
require "net/http"; require "json"def wali(**body) uri = URI("https://api.wali.chat/v1/messages") Net::HTTP.post(uri, body.to_json, "Authorization" => ENV["WALI_TOKEN"], "Content-Type" => "application/json")end# Send a messagewali(phone: "+14155550142", message: "Your order shipped")# Send a filewali(phone: "+14155550142", media: { url: "https://acme.co/cat.pdf" })# Schedule it for tomorrow at 9:00wali(phone: "+14155550142", message: "Doors open at 9:00", deliverAt: "2026-08-25T09:00:00Z")
// Java 11+, one helper for every callHttpClient http = HttpClient.newHttpClient();void wali(String body) throws Exception { http.send(HttpRequest.newBuilder() .uri(URI.create( "https://api.wali.chat/v1/messages")) .header("Authorization", System.getenv("WALI_TOKEN")) .header("Content-Type", "application/json") .POST(BodyPublishers.ofString(body)) .build(), BodyHandlers.ofString());}// Send a messagewali(""" {"phone": "+14155550142", "message": "Your order shipped"}""");// Send a filewali(""" {"phone": "+14155550142", "media": {"url": "https://acme.co/cat.pdf"}}""");// Schedule it for tomorrow at 9:00wali(""" {"phone": "+14155550142", "message": "Doors open at 9:00", "deliverAt": "2026-08-25T09:00:00Z"}""");
// One client for every callvar http = new HttpClient();http.DefaultRequestHeaders.Add( "Authorization", Environment.GetEnvironmentVariable( "WALI_TOKEN"));Task Wali(object body) => http.PostAsJsonAsync( "https://api.wali.chat/v1/messages", body);// Send a messageawait Wali(new { phone = "+14155550142", message = "Your order shipped" });// Send a fileawait Wali(new { phone = "+14155550142", media = new { url = "https://acme.co/cat.pdf" } });// Schedule it for tomorrow at 9:00await Wali(new { phone = "+14155550142", message = "Doors open at 9:00", deliverAt = "2026-08-25T09:00:00Z" });