static void Main(string[] args)
{
try {
string provider_key = "YOUR_PROVIDER_KEY";
string app_id = "APP_ID_OF_THE_USER";
Api _3ScaleAPI = new Api("http://su1.3scale.net", provider_key);
AuthorizeResponse resp = _3ScaleAPI.authorize(app_id);
print(resp);
Console.WriteLine("Done authorize...");
System.Collections.Hashtable transactions = new System.Collections.Hashtable();
System.Collections.Hashtable transaction = null;
System.Collections.Hashtable usage = null;
transaction = new System.Collections.Hashtable();
transaction.Add("app_id",app_id);
transaction.Add("timestamp", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss K"));
usage = new System.Collections.Hashtable();
usage.Add("hits", 10);
transaction.Add("usage",usage);
transactions.Add("0", transaction);
transaction = new System.Collections.Hashtable();
transaction.Add("app_id", app_id);
transaction.Add("timestamp", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss K"));
usage = new System.Collections.Hashtable();
usage.Add("hits", 1);
transaction.Add("usage", usage);
transactions.Add("1", transaction);
_3ScaleAPI.report(transactions);
Console.WriteLine("Done report...");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
string s = Console.ReadLine();
}