Hello everyone. Was doing some testing for our chat app using Ringcentral.NET and the online API explorer. The syncType enum of "ISync" for the path "https://platform.devtest.ringcentral.com/restapi/v1.0/account/accountId/extension/extensionId/message-sync" is bugged and will always generate an error. Since the default type of sync is FSync, this makes it impossible to use incremental sync with the Messages Sync API. As we can't do incremental sync using the API, we are going back to the Message Store API paths for messages. Please fix the bug or let other developers know that it is broken.
Message Store API - Sync Messages is bugged for ISync.
The "ISync" requires a syncToken. So, first you have to use the "FSync", get the response and parse the syncInfo to get the "syncToken" to be used with "ISync"
// first read var syncMessagesParameters = new SyncMessagesParameters(); syncMessagesParameters.dateFrom = "2020-03-01T18:07:52.534Z"; syncMessagesParameters.dateTo = "2020-05-31T18:07:52.534Z"; var response = await rcsdk.Restapi().Account().Extension().MessageSync().Get(syncMessagesParameters); Console.WriteLine(JsonConvert.SerializeObject(response)); // second read: parse the response to get the syncToken var syncMessagesParameters = new SyncMessagesParameters(); syncMessagesParameters.syncType = new string[] { "ISync" }; syncMessagesParameters.syncToken = "paste the sync token here"; var response = await rcsdk.Restapi().Account().Extension().MessageSync().Get(syncMessagesParameters); Console.WriteLine(JsonConvert.SerializeObject(response));
For your reference, please read this blog. It is not in C# but it gives you guidance of using the message store sync API.
Hey Phong, I just tested it with the procedure. Turns out that for some reason, the app wasn't accepting older FSync tokens. Is there an expiration for sync tokens? That will probably explain the results.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.