Method: GetCustMsgsByMobile

Method Type: Post

This method will be called by your application to look up the message history of a mobile number from the store you request within your auth string with a maximum of 100 records returned at one time. CRM Text stores message history for around six months on production. Thereafter message history is archived and must be requested through your support channel. This method allows you to return recent customer message history from a search function within your application.

Remember that data in the CRM Text SMS API is archived after 6 months. We recommend that you store customer data on your side.

  Restrictions


  • We ask for and require that you send us Customer phone numbers as 10 digits only. (Example: 9995551234)
  • Note the date format requested in the parameters carefully as that is the only acceptable format.
  • A max record count of 200
  • Data is archived after 6 months by the CRM Text SMS API. Make sure you have a plan to store customer data on your side.

  Suggestions


  • Set your enddate one day ahead of the current date to get or include the present day's data. For example, if today's date is March 15th, 2015 set the enddate to '2015-03-16'. Use '2015-03-15' as the startdate.
  • Use this method to keep track of message history on your side.

Request Example

Get Opt-In Status for a Mobile Number:
https://restapi.crmtext.com/smapi/rest?method=getcustmsgsbymobile&phone_number=&startdate=&enddate=&startcount=&endcount=


Request Parameters

Name Required Value Description
phone_number Yes integer 10 digit mobile number. (Example: 9995551234)
startdate Yes string Format: "YYYY-MM-DD"
enddate Yes string Format: "YYYY-MM-DD"
startcount Yes string The start count of the number of messages. If there are 300 messages and you want messages starting after 100 this value will be 100.
msgcount Yes integer The number of messages that you want us to return in one transaction. The value here would be a number of 1-100. For example: "15".

XML Sample Successful Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<response op= "getcustmsgsbymobile" status= "200" message= "ok">
<msglist>
<message>
<msgID>999111222</msgID>
<message>John, your vehicle is due for service. Can I schedule an appt for you?</message>
<timestamp>2014-08-11 14:23:36</timestamp>
<delivered/>
<txnid>0987654321</txnid>
<msg_direction>MT</msg_direction>
<user_id>4321</user_id>
<customer>
<custId>1234567891011</custId>
<subacct>456</subacct>
<timestamp>2014-08-11 09:19:12</timestamp>
<optinsStatus>3</optinStatus>
<custName>John Queue</custName>
<custMobile>9993338888</custMobile>
</customer>
</message>
<message>
<msgID>999111223</msgID>
<message>Thanks for opting in John. Follow us on twitter @coupondeals.</message>
<timestamp>2014-08-11 14:25:21</timestamp>
<delivered/>
<txnid>0987654322</txnid>
<msg_direction>MT</msg_direction>
<user_id>4321<user_id>
<customer>
<custId>1234567891011</custId>
<subacct>456</subacct>
<timestamp>2014-08-11 09:19:12</timestamp>
<optinsStatus>3</optinStatus>
<custName>John Queue</custName>
<custMobile>9993338888</custMobile>
</customer>
</message>
</msglist>
</response>

XML Sample Error Response

1
2
<response op= "getcustmsgsbymobile" status= "4xx" message= "reason for Error">
</response>