{
"timeStamp":"2021-05-12 07:17:42",
"message":"Full authentication is required to access this resource",
"path":"/countries/US",
"errorCode":"INVALID_TOKEN",
"infoLink":null,
"details":[
]
}
{
"timeStamp":"2021-05-12 07:15:00",
"message":"Country not found and/or not currently supported",
"path":"/countries/PKGG",
"errorCode":"COUNTRY_NOT_SUPPORTED",
"infoLink":null,
"details":[
]
}
using System;
using System.Threading.Tasks;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;
namespace WebAPIClient {
class Program {
static async Task Main(string[] args) {
await ApiCall();
}
private static async Task ApiCall() {
var message = new HttpRequestMessage(HttpMethod.Get, "https://topups.reloadly.com/countries/PK");
message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");
using
var httpClient = new HttpClient();
var response = await httpClient.SendAsync(message);
var responseBody = await response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject < dynamic > (responseBody);
Console.WriteLine(result);
}
}
}