public async Task Post(AddSyncTarget request)
        {
            var config = PluginConfiguration.Configuration;
            var userToken = await GetUserToken(request);

            var syncAccount = new OneDriveSyncAccount
            {
                Id = Guid.NewGuid().ToString(),
                Name = WebUtility.UrlDecode(request.Name),
                EnableForEveryone = request.EnableForEveryone,
                UserIds = request.UserIds,
                RefreshToken = userToken.RefreshToken
            };

            if (!string.IsNullOrEmpty(request.Id))
            {
                syncAccount.Id = request.Id;
            }
            else
            {
                request.Id = syncAccount.Id;
            }

            PluginConfiguration.Configuration.SyncAccounts.Add(syncAccount);

            try
            {
                syncAccount.FolderId = await GetOrCreateFolder(request, userToken);
                Plugin.Instance.SaveConfiguration();
            }
            catch
            {
                PluginConfiguration.Configuration.SyncAccounts.Remove(syncAccount);
            }
        }
        private async Task<string> GetOrCreateFolder(AddSyncTarget request, UserToken userToken)
        {
            var config = PluginConfiguration.Configuration;

            var client = new Client(new SyncTarget { Id = request.Id, Name = request.Name });

            try
            {
                return (await client.GetFolder(Constants.OneDriveFolderName)).Id;
            }
            catch (OneDriveBaseException ex)
            {
                if (ex.Code != "itemNotFound")
                {
                    throw ex;
                }
            }
            
            return (await client.CreateFolder(Constants.OneDriveFolderName, null)).Id;
        }
        private async Task<UserToken> GetUserToken(AddSyncTarget request)
        {
            var config = PluginConfiguration.Configuration;

            var client = new Client(new SyncTarget { Id = request.Id, Name = request.Name });
            return await client.GetAccessTokensAsync(request.Code);
        }