{"_id":"58fdfbb6eed0651b00f82e48","version":{"_id":"558d9c33beb7c719007f631c","project":"558d9c32beb7c719007f6319","__v":19,"createdAt":"2015-06-26T18:38:43.154Z","releaseDate":"2015-06-26T18:38:43.153Z","categories":["558d9c33beb7c719007f631d","558db0bc7afc102f008ed863","558db0d07afc102f008ed864","558db3c84cd25f0d00b7ecb2","558dbace7afc102f008ed894","558dbd104cd25f0d00b7ecca","558dbd4c4cd25f0d00b7eccb","559d3e858639bd21008e90a6","55bb8ca5a8400c2d00873e70","58fdfb438fbd2819000db9eb","590829c7ade4172d006a87b8","59082a11beedcf0f00235d87","5908bd2cba2afd23007d6d12","5908d1f64f544425002b6aae","591e5e9e2c1b1f0f000fa4e5","5a283434aba91f002834ea86","5a69fe5cde745d002c936c66","5a81e6ef761cf300127317f8","5a81e7d63b1e120012bed5a1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":0,"parentDoc":null,"user":"58cadf93d223510f005d27db","githubsync":"","category":{"_id":"58fdfb438fbd2819000db9eb","__v":0,"version":"558d9c33beb7c719007f631c","project":"558d9c32beb7c719007f6319","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-04-24T13:18:59.649Z","from_sync":false,"order":3,"slug":"sms-apis","title":"SMS APIs"},"project":"558d9c32beb7c719007f6319","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-04-24T13:20:54.726Z","link_external":false,"link_url":"","sync_unique":"","hidden":true,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"[block:api-header]\n{\n  \"title\": \"Use the SMS Get Messages API to retrieve multiple SMS messages\"\n}\n[/block]\nThe SMS Get Messages API is used to retrieve multiple SMS message sent to/from a specific DialogTech SMS enabled tracking number over a date range\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Base URL for SMS Get Messages\",\n  \"body\": \"https://secure.dialogtech.com/ibp_api.php\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Parameter List\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Accepts\",\n    \"h-3\": \"Max Length\",\n    \"h-4\": \"Notes\",\n    \"h-5\": \"Usage\",\n    \"0-0\": \"action\",\n    \"0-1\": \"Yes\",\n    \"0-2\": \"String: **sms.get_messages**\",\n    \"0-3\": \"n/a\",\n    \"0-4\": \"Only accepts **sms.get_messages** to retrieve multiple SMS Messages\",\n    \"0-5\": \"Defines the API Call as \\\"SMS Get Messages\\\" type\",\n    \"1-0\": \"access_key\",\n    \"1-1\": \"Yes\",\n    \"1-2\": \"String\",\n    \"1-3\": \"n/a\",\n    \"2-0\": \"secret_access_key\",\n    \"2-1\": \"Yes\",\n    \"2-2\": \"String\",\n    \"2-3\": \"n/a\",\n    \"1-4\": \"Access Key from the Key Manager within a DialogTech account\",\n    \"1-5\": \"Credentials used for access to the API for a particular DialogTech account\",\n    \"2-5\": \"Credentials used for access to the API for a particular DialogTech account\",\n    \"2-4\": \"Secret Access Key from the Key Manager within a DialogTech account\",\n    \"5-0\": \"number\",\n    \"5-1\": \"No\",\n    \"5-2\": \"String: Unformatted Phone Number\",\n    \"5-3\": \"n/a\",\n    \"5-4\": \"SMS enabled DialogTech tracking number\",\n    \"5-5\": \"Filters the response to only include SMS records where the tracking number matches the `number` provided\",\n    \"3-0\": \"start_date\",\n    \"4-0\": \"end_date\",\n    \"3-1\": \"Yes\",\n    \"4-1\": \"Yes\",\n    \"3-2\": \"Date\",\n    \"3-4\": \"Date format should be YYYYMMDD\",\n    \"4-4\": \"Date format should be YYYYMMDD\",\n    \"3-3\": \"8\",\n    \"4-3\": \"8\",\n    \"4-2\": \"Date\",\n    \"3-5\": \"Defines the end of the date-range for records to be returned from\",\n    \"4-5\": \"Defines the end of the date-range for records to be returned from\"\n  },\n  \"cols\": 6,\n  \"rows\": 6\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Using this API\"\n}\n[/block]\nThese code examples are meant to show a basic method of accessing DialogTech's IVR Report API.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n  /*\\n    SMS Send Message EX:\\n    This example will send an SMS with\\n    the text 'Thank you for calling.'\\n    to a predefined number and echo the\\n    verbatim XML response.\\n  */\\n\\n  // Create cURL resource\\n  $ch = curl_init(); \\n  $baseuri = \\\"https://secure.dialogtech.com/ibp_api.php?\\\";\\n\\n  // API Specific Static Parameters\\n  $action = \\\"sms.get_messages\\\";\\n\\n  // Required User Parameters To Request the API\\n  $access_key = \\\"foo\\\";\\n  $secret_access_key = \\\"bar\\\";\\n  $start_date = \\\"20170101\\\";\\n  $end_date = \\\"20170101\\\";\\n\\n  // Construct the full URL\\n  $full_url = $baseuri . \\\"&action=\\\" . $action .\\n    \\\"&access_key=\\\" . $access_key .\\n    \\\"&secret_access_key=\\\" . $secret_access_key .\\n    \\\"&start_date=\\\" . $start_date .\\n    \\\"&end_date=\\\" . $end_date;\\n\\n\\n  // Set the URL\\n  curl_setopt($ch, CURLOPT_URL, $full_url);\\n\\n  // Sets the return options of the cURL to return the actual result from the curl request, and FALSE on failure\\n  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\\n\\n  // Sets the $output variable to the result of the curl\\n  $output = curl_exec($ch);\\n\\n  // Close curl resource to free up system resources\\n  curl_close($ch);\\n\\n  // Echo the XML response to the page\\n  echo $output;\\n?>\",\n      \"language\": \"text\",\n      \"name\": \"PHP Example\"\n    },\n    {\n      \"code\": \"curl -X \\\"\\\"\",\n      \"language\": \"text\",\n      \"name\": \"cURL\"\n    }\n  ]\n}\n[/block]\n**Example Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<!DOCTYPE response [\\n<!ELEMENT response (result,result_description,data)>\\n<!ELEMENT result (#PCDATA)>\\n<!ELEMENT result_description (#PCDATA)>\\n<!ELEMENT data (messages)>\\n<!ELEMENT messages (inbound+,outbound+)>\\n<!ELEMENT inbound (message+)>\\n<!ELEMENT message (msg_id, to, from, message, date)>\\n<!ELEMENT msg_id (#PCDATA)>\\n<!ELEMENT to (#PCDATA)>\\n<!ELEMENT from (#PCDATA)>\\n<!ELEMENT message (#PCDATA)>\\n<!ELEMENT date (#PCDATA)>\\n<!ELEMENT outbound (message+)>\\n<!ELEMENT message (msg_id, to, from, message, date)>\\n<!ELEMENT msg_id (#PCDATA)>\\n<!ELEMENT to (#PCDATA)>\\n<!ELEMENT from (#PCDATA)>\\n<!ELEMENT message (#PCDATA)>\\n<!ELEMENT date (#PCDATA)>\\n]>\\n<response>\\n    <result>success</result>\\n    <result_description>[3] Message(s) Returned</result_description>\\n    <messages>\\n        <inbound>\\n            <message>\\n                <msg_id>177931295</msg_id>\\n                <to>5554443210</to>\\n                <from>5554443210</from>\\n                <message><![CDATA[Hi. I'm looking for a product ID for a blue left-handed widget.]]></message>\\n                <date>2017-01-01 09:30:00</date>\\n            </message>\\n        </inbound>\\n        <outbound>\\n            <message>\\n                <msg_id>131086044</msg_id>\\n                <to>5554443210</to>\\n                <from>5554443210</from>\\n                <message><![CDATA[Hi! Thanks for contacting us. We are looking pulling information now and we will send it shortly.]]></message>\\n                <date>2017-01-01 09:30:01</date>\\n            </message>\\n            <message>\\n                <msg_id>133185904</msg_id>\\n                <to>5554443210</to>\\n                <from>5554443210</from>\\n                <message><![CDATA[Thanks again for taking my call. As we discussed, the product you're interested in is number 012345. Happy New Year!]]></message>\\n                <date>2017-01-01 10:07:31</date>\\n            </message>\\n    </messages>\\n</response>\",\n      \"language\": \"xml\",\n      \"name\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"API to retrieve multiple SMS messages","slug":"sms-get-messages","type":"basic","title":"Get Messages"}

Get Messages

API to retrieve multiple SMS messages

Use the SMS Get Messages API to retrieve multiple SMS messages

The SMS Get Messages API is used to retrieve multiple SMS message sent to/from a specific DialogTech SMS enabled tracking number over a date range

Base URL for SMS Get Messages

https://secure.dialogtech.com/ibp_api.php

Parameter List

Parameter
Required
Accepts
Max Length
Notes
Usage

action

Yes

String: sms.get_messages

n/a

Only accepts sms.get_messages to retrieve multiple SMS Messages

Defines the API Call as "SMS Get Messages" type

access_key

Yes

String

n/a

Access Key from the Key Manager within a DialogTech account

Credentials used for access to the API for a particular DialogTech account

secret_access_key

Yes

String

n/a

Secret Access Key from the Key Manager within a DialogTech account

Credentials used for access to the API for a particular DialogTech account

start_date

Yes

Date

8

Date format should be YYYYMMDD

Defines the end of the date-range for records to be returned from

end_date

Yes

Date

8

Date format should be YYYYMMDD

Defines the end of the date-range for records to be returned from

number

No

String: Unformatted Phone Number

n/a

SMS enabled DialogTech tracking number

Filters the response to only include SMS records where the tracking number matches the number provided

Using this API

These code examples are meant to show a basic method of accessing DialogTech's IVR Report API.

<?php
  /*
    SMS Send Message EX:
    This example will send an SMS with
    the text 'Thank you for calling.'
    to a predefined number and echo the
    verbatim XML response.
  */

  // Create cURL resource
  $ch = curl_init(); 
  $baseuri = "https://secure.dialogtech.com/ibp_api.php?";

  // API Specific Static Parameters
  $action = "sms.get_messages";

  // Required User Parameters To Request the API
  $access_key = "foo";
  $secret_access_key = "bar";
  $start_date = "20170101";
  $end_date = "20170101";

  // Construct the full URL
  $full_url = $baseuri . "&action=" . $action .
    "&access_key=" . $access_key .
    "&secret_access_key=" . $secret_access_key .
    "&start_date=" . $start_date .
    "&end_date=" . $end_date;


  // Set the URL
  curl_setopt($ch, CURLOPT_URL, $full_url);

  // Sets the return options of the cURL to return the actual result from the curl request, and FALSE on failure
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

  // Sets the $output variable to the result of the curl
  $output = curl_exec($ch);

  // Close curl resource to free up system resources
  curl_close($ch);

  // Echo the XML response to the page
  echo $output;
?>
curl -X ""

Example Response

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE response [
<!ELEMENT response (result,result_description,data)>
<!ELEMENT result (#PCDATA)>
<!ELEMENT result_description (#PCDATA)>
<!ELEMENT data (messages)>
<!ELEMENT messages (inbound+,outbound+)>
<!ELEMENT inbound (message+)>
<!ELEMENT message (msg_id, to, from, message, date)>
<!ELEMENT msg_id (#PCDATA)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT message (#PCDATA)>
<!ELEMENT date (#PCDATA)>
<!ELEMENT outbound (message+)>
<!ELEMENT message (msg_id, to, from, message, date)>
<!ELEMENT msg_id (#PCDATA)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT message (#PCDATA)>
<!ELEMENT date (#PCDATA)>
]>
<response>
    <result>success</result>
    <result_description>[3] Message(s) Returned</result_description>
    <messages>
        <inbound>
            <message>
                <msg_id>177931295</msg_id>
                <to>5554443210</to>
                <from>5554443210</from>
                <message><![CDATA[Hi. I'm looking for a product ID for a blue left-handed widget.]]></message>
                <date>2017-01-01 09:30:00</date>
            </message>
        </inbound>
        <outbound>
            <message>
                <msg_id>131086044</msg_id>
                <to>5554443210</to>
                <from>5554443210</from>
                <message><![CDATA[Hi! Thanks for contacting us. We are looking pulling information now and we will send it shortly.]]></message>
                <date>2017-01-01 09:30:01</date>
            </message>
            <message>
                <msg_id>133185904</msg_id>
                <to>5554443210</to>
                <from>5554443210</from>
                <message><![CDATA[Thanks again for taking my call. As we discussed, the product you're interested in is number 012345. Happy New Year!]]></message>
                <date>2017-01-01 10:07:31</date>
            </message>
    </messages>
</response>