public static TradovateSubscription AssignPracticeTradovatePlan(User newUser, string membershipPlan) { var feesApi = new FeesApi(); var availablePlans = feesApi.GetAllTradovateSubscriptionPlans(); foreach (var plan in availablePlans) { Console.WriteLine(plan); } var organizationPlans = availablePlans.Where(x => x.OrganizationId != null); var practicePlan = organizationPlans.First(x => x.Name == membershipPlan); var usersApi = new UsersApi(); var response = usersApi.AddTradovateSubscription(new AddTradovateSubscription(TradovateSubscriptionPlanId: practicePlan.Id, UserId: newUser.Id)); Console.WriteLine(response); return(response.TradovateSubscription); }
private static void RestApiExample() { // Via REST API Console.WriteLine("CALLING SERVICES VIA REST API"); Configuration.Default = new Configuration(new ApiClient(DemoUrl)); Configuration.Default.ApiKey.Add("Authorization", AccessToken); Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer"); var account = Accounting.GetAccount(MyUserId); Accounting.ShowAccountActivities(account); var feesApi = new FeesApi(); var availablePlans = feesApi.GetAllTradovateSubscriptionPlans(); foreach (var plan in availablePlans) { Console.WriteLine(plan); } }