You can keep a small cache in your program to remember the message IDs. Then you can filter out duplicate by message id.
Or you can call sync messages:
https://github.com/ringcentral/RingCentral.Net/blob/master/samples.md#sync-messagesSync token can make sure you can get all and no duplicates:
https://github.com/ringcentral/RingCentral.Net/blob/master/RingCentral.Net/Definitions/SyncMessagesP...
Thanks Tyler! Is it intended behavior for messageType and direction parameters to throw invalid parameter errors with message sync when using a syncToken? Not a huge deal because I can just filter it after the API returns values, more curious. I'm able to reproduce this behavior using the tool on the ringcentral site here:
https://developer.ringcentral.com/api-reference#SMS-and-MMS-syncMessagesEdit: Perhaps I'm misunderstanding, but this is the response behavior I'm getting with the following endpoint. The 'test' values are the outgoing message values. I'm updating the syncToken value each time with the last value returned.
/account/~/extension/~/message-sync?syncToken=TOKENVALUE&syncType=ISync[[12:18:32.280]] [log] syncToken: AQEAAAAAAwAAAWk_pNlQBgAAAPoFAAABaUAN85ATAAgAAAAADtmLVAkBCgEZAAABaUAOUU2HPQIg
[[12:18:32.488]] [log] test 67
[[12:18:32.489]] [log] test 68
[[12:18:52.310]] [log] syncToken: AQEAAAAAAwAAAWk_pNlQBgAAAPoFAAABaUAOq8gTAAgAAAAADtmLVAkBCgEZAAABaUAOwpUSXZIb
[[12:18:52.680]] [log] test 67
[[12:18:52.684]] [log] test 68
[[12:18:52.686]] [log] test 69
[[12:19:12.254]] [log] syncToken: AQEAAAAAAwAAAWk_pNlQBgAAAPoFAAABaUAO_vITAAgAAAAADtmLVAkBCgEZAAABaUAPFJ09c8LN
[[12:19:12.487]] [log] test 69
[[12:19:12.490]] [log] test 70