public async Task <GenerateUserAuthorizationUrlResponse> GenerateUserAuthorizationUrlAsync(long companyId) { try { OAuth2Api oAuth = new OAuth2Api(); string url = oAuth.GenerateUserAuthorizationUrl(OAuthEnvironment.PRODUCTION, new string[] { "https://api.ebay.com/oauth/api_scope/sell.inventory" }, companyId.ToString()); return(await Task.FromResult <GenerateUserAuthorizationUrlResponse>(new GenerateUserAuthorizationUrlResponse { IsSuccess = true, URL = url })); } catch (Exception ex) { telemetryClient.TrackException(ex); return(new GenerateUserAuthorizationUrlResponse { IsSuccess = false, ErrorMessage = ex.Message }); } }