public async Task <string> SendQueryRequestAsync(string message, string language     = "uk",
                                                         CancellationToken cancellationToken = default)
        {
            var model = new SendQueryRequest
            {
                Language = language,
                Query    = message
            };

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Add("Authorization", $"Bearer {_dialogflowApiOptions.Token}");

                var content  = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8);
                var response = await client.PostAsync(_dialogflowApiOptions.Url, content, cancellationToken);

                var parsedResponse =
                    JsonConvert.DeserializeObject <SendQueryResponse>(await response.Content.ReadAsStringAsync());

                return(parsedResponse.Result.Fulfillment.Speech);
            }
        }
 public virtual SendQueryResponse SendQuery([FromBody] SendQueryRequest request)
 {
     try
     {
         _utilityApiProxy.SendQuery(CultureCode, new SendQueryDto
         {
             FirstName = request.FirstName,
             LastName  = request.LastName,
             Email     = request.Email,
             Telephone = request.Telephone,
             Subject   = request.Subject,
             Content   = request.Content
         });
         return(new SendQueryResponse {
             Code = ResponseCode.Success
         });
     }
     catch (QueryNotSentException ex)
     {
         return(new SendQueryResponse {
             Code = ResponseCode.QueryNotSent, ErrorMessage = ex.Message
         });
     }
 }