var content = new StringContent("{\r\n "phone_number": "+91**",\r\n "task": "Say Hello Anubhav How are you",\r\n "voice" : "maya"\r\n}", null, "application/json");
request.Content = content;
var content = new StringContent("{\r\n "phone_number": "+91**",\r\n "task": "Say Hello Anubhav How are you",\r\n "voice" : "maya"\r\n}", null, "application/json");
@ZZZZZZZZZZZZZZZZZZZZZZZZZ Sir i'm calling an URL inside my API there i was giving hardcoded value of phone number and task as you can see i want to modify this code such that on my swagger i can manually put any phone number or task there in my swagger
var content = new StringContent("{\r\n "phone_number": "+91**",\r\n "task": "Say Hello Anubhav How are you",\r\n "voice" : "maya"\r\n}", null, "application/json");
request.Content = content;
var response = await _httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var responseContent = await response.Content.ReadAsStringAsync();
// Deserialize the response content into a CallerId object
var callerId = JsonConvert.DeserializeObject<CallerId>(responseContent);
// Save the CallerId object to the database
_context.callerid.Add(callerId);
await _context.SaveChangesAsync();
}
public async Task CallThirdPartyApiAsync(string phoneNumber)
{
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.bland.ai/v1/calls");
var content = new StringContent("{\r\n "phone_number": "+91**",\r\n "task": "Say Hello Anubhav How are you",\r\n "voice" : "maya"\r\n}", null, "application/json");
request.Content = content;
var response = await _httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var responseContent = await response.Content.ReadAsStringAsync();
// Deserialize the response content into a CallerId object
var callerId = JsonConvert.DeserializeObject<CallerId>(responseContent);