Object definition
public class ReqObject
{
public int ClientID { get; set; }
public int BatchID { get; set; }
public int DisburseRefID { get; set; }
}
Payload data
ReqObject reqPayload = new ReqObject();
reqPayload.ClientID = 10050;
reqPayload.BatchID = 1000;
reqPayload.DisburseRefID = 1002;
string PayloadJson = JsonConvert.SerializeObject(reqPayload);
StringContent EncodedJson = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
using (HttpClient client = new HttpClient())
{
string PublicKey = "{Your public key}";
string PrivateKey = "{Your private key}";
string ApiEndpoint = "https://sandbox.api.igsend.co.uk/services/disbursementstatus";
client.BaseAddress = new Uri(ApiEndpoint);
var auth = string.Format("{0}:{1}", PublicKey, PrivateKey);
var encoded = Convert.ToBase64String(Encoding.ASCII.GetBytes(auth));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", encoded);
HttpResponseMessage response = await client.PostAsync(ApiEndpoint, EncodedJson);
}
If you develop in another code, which may be useful to other customers, we would love to include further examples here. You can submit your example code to