public async Task<int> RunAsync(string[] remainingArguments) { if (String.IsNullOrWhiteSpace(clientId)) { Console.Write("Client ID: "); clientId = Console.ReadLine(); } if (String.IsNullOrWhiteSpace(clientSecret)) { Console.Write("Client Secret: "); clientSecret = Console.ReadLine(); } var info = await APIInfo.GetFromRemote(baseUrl, ApiArea.Integrations); var authApi = new AuthorizationApi(baseUrl, clientId, clientSecret); var authorization = authApi.GetApiClientAccessToken(new string[] { "Trusted.Experiences" }); var factory = new TrustedApiFactory(info, authorization.AccessToken); var api = factory.GetExperiencesApi(); var experiences = new List<ExperienceModel>(); var result = await api.GetExperiences(); experiences.AddRange(result); foreach (var experience in experiences) { Console.WriteLine("{1} ({0})", experience.ID, experience.Title ); } return 0; }
protected async Task<TrustedApiFactory> GetFactory() { var info = await CareerHubApiInfo.GetStudentsInfo(); var factory = new TrustedApiFactory(info, this.AccessToken); return factory; }