Ejemplo n.º 1
0
        public async Task <SAResponseData> NewCall(string endPoint, SiebelRequestNewCallModel model)
        {
            string              stringPayload = System.Text.Json.JsonSerializer.Serialize(new { InteractionId = model.InteractionId, Direction = model.Direction.ToString(), CallerId = model.CallerId, CalledId = model.CalledId, UserId = model.UserId });
            StringContent       httpContent   = new StringContent(stringPayload, Encoding.UTF8, "application/json");
            HttpResponseMessage response      = await _client.PostAsync(endPoint, httpContent);

            string responseContent = await response.Content.ReadAsStringAsync();

            SAResponseData responseModel = System.Text.Json.JsonSerializer.Deserialize <SAResponseData>(responseContent);

            return(responseModel);
        }
Ejemplo n.º 2
0
        public async Task <SAResponseData> GetCustomers(string endPoint, string userId)
        {
            string              stringPayload = System.Text.Json.JsonSerializer.Serialize(new { UserId = userId });
            StringContent       httpContent   = new StringContent(stringPayload, Encoding.UTF8, "application/json");
            HttpResponseMessage response      = await _client.PostAsync(endPoint, httpContent);

            string responseContent = await response.Content.ReadAsStringAsync();

            SAResponseData responseModel = System.Text.Json.JsonSerializer.Deserialize <SAResponseData>(responseContent);

            return(responseModel);
        }