question

Lior Gerson avatar image
Lior Gerson asked Lior Gerson commented

JavaScript (Node) - How do i get messageStore list using multiple message types?

Hello,

I'm using ringcentral-ts in my node application.

Trying to get messageStore for SMS and VoiceMail only by ringCentral.account().extension(extentionId).messageStore().list(params)


In params, there is a property called messageType which defined as:


/**

* The type of the resulting messages. If not specified, all messages without message type filtering are returned. Multiple values are accepted

*/

messageType?: 'Fax' | 'SMS' | 'VoiceMail' | 'Pager' | 'Text';


My question is how do i actually query for multiple types?

(There is a compilation error if i'm trying to put multiple values for messageType)


Thanks!



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.

Phong Vu avatar image
Phong Vu answered

Simply put them in an array ["Fax", "SMS"] etc.

1 |3000

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

Lior Gerson avatar image
Lior Gerson answered Lior Gerson commented

Phong, thanks for your reply.

Unfortunately i can't use an array because of messageType definition:


2 comments
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

What SDK and language are you using? Looks like Java but not sure if you are using our SDK.

If you are using our SDK, here is the way to create the params

ListMessagesParameters parameters = new ListMessagesParameters();
parameters.messageType = new String[] {"VoiceMail", "Fax", "SMS};
...


0 Likes 0 ·
Lior Gerson avatar image Lior Gerson Phong Vu ♦♦ commented ·

I'm using RingCentral for Typescript - https://github.com/zengfenfei/ringcentral-ts/

0 Likes 0 ·

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