Retrieve sent messages
Lists the text messages you sent between two dates.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
retrieve_sent_messagesfor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
Your DCDial company ID.
Example101Start date (YYYY-MM-DD).
Example2026-10-01End date (YYYY-MM-DD).
Example2026-10-15Sort by send time: oldest first (ASC) or newest first (DESC).
One ofASCDESCNumber of rows to skip.
Example0Maximum number of rows to return.
Example50
Notes
Messages are returned as numbered keys ("0", "1", …) next to company_id and the date range. When nothing matches, key "0" holds {"message": "no message was found"}.
curl https://api.dcdial.com/api/ \ -d type=retrieve_sent_messages \ -d token="$DCDIAL_TOKEN" \ -d company_id=101 \ -d start_date=2026-10-01 \ -d end_date=2026-10-15<?php$ch = curl_init('https://api.dcdial.com/api/');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => http_build_query([ 'type' => 'retrieve_sent_messages', 'token' => getenv('DCDIAL_TOKEN'), 'company_id' => 101, 'start_date' => '2026-10-01', 'end_date' => '2026-10-15', ]),]);$result = json_decode(curl_exec($ch), true);curl_close($ch);
if (($result['response']['success'] ?? 0) != 1) { throw new RuntimeException($result['response']['error'] ?? 'Request failed');}const res = await fetch('https://api.dcdial.com/api/', { method: 'POST', body: new URLSearchParams({ type: "retrieve_sent_messages", token: process.env.DCDIAL_TOKEN, company_id: "101", start_date: "2026-10-01", end_date: "2026-10-15", }),});const { response } = await res.json();if (response.success != 1) throw new Error(response.error);import osimport requests
r = requests.post( "https://api.dcdial.com/api/", data={ "type": "retrieve_sent_messages", "token": os.environ["DCDIAL_TOKEN"], "company_id": 101, "start_date": "2026-10-01", "end_date": "2026-10-15", }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "response": { "0": { "message_id": "99120", "phone_number": "5550100123", "sms_text": "Your payment of $150.00 was received. Thank you!", "message_log_id": "551200", "status": "SENT", "sms_sent_time": "2026-10-14 16:20:05", "lead_id": "884512", "list_id": "2048", "account_id": "ACC-10045", "first_name": "Jane", "last_name": "Doe" }, "company_id": "101", "start_date": "2026-10-01", "end_date": "2026-10-15", "request_time_utc": "2026-10-15 14:02:11" }}Try it