public async Task Trigger() { // Get bearer token (signin) var accessToken = await _apiCallService.GetAccessTokenWithCredentials(); // Subscribe to webhook var returnModel = await _apiCallService.CallSubscribtion(accessToken.AccesToken); // Send test message to receive controller returnModel = await _apiCallService.CallTest(accessToken.AccesToken); }
public void RequestToApiFlow1() { Console.WriteLine("Request flow 1: -> Get Accestoken with credentials -> Request with obtained AccessToken\r\n"); var tokenResult = Execute(() => (T)_ApiCallService.GetAccessTokenWithCredentials().Result); if (tokenResult != null) { Console.WriteLine(tokenResult?.GetData()); Console.WriteLine("Api two leg result:\r\n"); var twoLegResult = Execute(() => (T)_ApiCallService.CallApi2Legs(tokenResult.GetAccesToken()).Result); Console.WriteLine(twoLegResult?.GetData()); RequestToApiFlow2(tokenResult?.GetRefreshToken()); } else { Exit(); } }