API Authentication
Partners will be provided with a unique API key that acts as an authentication mechanism for API calls.
This API key must be included in the request header named APIKEY
for every API call, ensuring secure and authorized access to the Kindly API endpoints.
Authenticate requests
- Python
- C#
- JavaScript
import requests
url = base_url + "/PartnerServices/GetDonationDetails?fromDate=2020-01-01&toDate=2030-01-01"
try:
response = requests.get(url, headers={ "APIKEY": "valid token" })
# Valid API key
assert response.status_code == 200
except Exception as e:
pass
using System;
using System.Net.Http;
class Program
{
static void Main()
{
string url = $"{base_url}/PartnerServices/GetDonationDetails?fromDate=2020-01-01&toDate=2030-01-01";
try
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("APIKEY", "valid token");
HttpResponseMessage response = client.GetAsync(url).Result;
// Valid API key
System.Diagnostics.Debug.Assert(response.StatusCode == System.Net.HttpStatusCode.OK);
}
}
catch (Exception e) { }
}
}
const https = require('https');
const url = `${base_url}/PartnerServices/GetDonationDetails?fromDate=2020-01-01&toDate=2030-01-01`;
const options = {
headers: {
'APIKEY': 'valid token'
}
};
https.get(url, options, (response) => {
// Valid API key
console.assert(response.statusCode === 200);
});