question

lowerym97 avatar image
lowerym97 asked benjamin-dean answered

Query for messages based on datetime

While working with RC through the API we currently do an update availability to 'Deleted' (with this call RestClient.put faxi["uri"],{:readStatus => 'Read', :availability => 'Deleted'}.to_json,{:Authorization => bearer,:content_type => :json, :accept => :json})


This cause messages to follow the 5 day purge life cycle.


After being Deleted for a certain time (by default, 5 days) the system erases message data (attachments) and automatically switches its availability to Purged. Purged messages cannot be restored but their metadata is stored in the system for some time (by default, 5 days). After that all information about such messages is physically removed from the system.


so that we can keep messages in RC for any trouble shooting that may need to take place.



which would be great other then the fact that there seems to be a 200 message limitation on inboxes. when we have 200 faxes in an inbox we get partial pages sometimes on new inbound messages.


given that some of our users do excess this 200 messages inbound before old messages can be cleaned up from the 5 day life cycle and that RC does not offer a way to increase the 200 limit or change the default from 5 days (which why would you call it a default if its not something that can be changed?) we need to write our own cron to clean up messages more frequently to prevent receiving partial faxes



Currently i can do something similar to this to get inbound messages


'https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store?messageType=Fax&readStatus=Read&direction=Inbound'


What i am wondering is how can i go about finding all messages that meet the following cirtieral and exceed a selected age (ex 1,2,3 dates) is it possible to do something like this?


'https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store?messageType=Fax&readStatus=Read&direction=Inbound&creationTime>2015-10-20T00:00:00.000Z'




Also is there anything on the road map for users to be able to change the purge default on their profile?


or a fix for the partial page inbound when inbox message count = 200?








rest api
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

benjamin-dean avatar image
benjamin-dean answered
You can use dateTo and dateFrom parameters while requesting message list to obtain a list of messages which are based on a beginning and ending time range. You can see the full Message API options here:  http://ringcentral.github.io/api-explorer/#!/Messaging/v1_0_account__accountId__extension__extension...

Our current plans do not include adding the ability for users to modify the purge default on their profile or to increase the inbox message count beyond 200.

It isn't prudent to use RingCentral's inboxes as your database of record, instead you should be pulling that data into your own message stores and keeping your inbox clean (that's why the 200 message limit is in place).
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys