Hi! I used below code, but didn't get result from get api. After get save to database result api.
using Microsoft.AspNetCore.Mvc; namespace ThirdPartyAPI.Controllers; [Route("api/[controller]")] [ApiController] public class DataController : ControllerBase { private readonly HttpClient _httpClient; public DataController() { _httpClient = new HttpClient(); } [HttpGet] public async Task<IActionResult> GetData() { var apiUrl = "https://test.testprovider.tj:8454/test_app.cgi?ACTION=opercheck&ACCOUNT=992880088400&AMOUNT=300.00& CURRENCY=TJS&SETTLEMENT_CURR=TJS&OPER_ID=9765844330e3"; HttpResponseMessage response = await _httpClient.GetAsync(apiUrl); if (response.IsSuccessStatusCode) { string data = await response.Content.ReadAsStringAsync(); return Ok(data); } else { return StatusCode((int)response.StatusCode); } } }
Hi RPA,
Please let us know the data returned by the API url.
We can remotely check your code and resolve your issue if you want.
It will be chargable 500 rupees per 30 minutes.
You can cantact by emailing here webmaster@aspsnippets.com.
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.