public IActionResult GetAllTimeCategoryPercentages(string user, string apikey)
 {
     if (!api.validAPIKey(apikey))
     {
         return(new UnauthorizedObjectResult("Invalid API key"));
     }
     return(api.serveJson(ans.getJSON(ans.getAllTimeCategoryBreakdown(user))));
 }
 public IActionResult GetByID(long TID, string apiKey)
 {
     if (!api.validAPIKey(apiKey))
     {
         return(new UnauthorizedObjectResult("Invalid API key"));
     }
     if (TID < 1)
     {
         return(BadRequest("Invalid TID"));
     }
     return(api.serveJson(ts.getJSON(ts.getUsingID(TID))));
 }
示例#3
0
 public IActionResult GetSGByID(long SGID, string apiKey)
 {
     if (!api.validAPIKey(apiKey))
     {
         return(new UnauthorizedObjectResult("Invalid API key"));
     }
     if (SGID < 1)
     {
         return(BadRequest("Invalid SGID specified"));
     }
     return(api.serveJson(sgs.getJSON(sgs.getUsingID(SGID))));
 }
 public IActionResult GetByID(long SID, string apiKey)
 {
     if (!api.validAPIKey(apiKey))
     {
         return(new UnauthorizedResult());
     }
     if (SID < 1)
     {
         return(BadRequest());
     }
     return(api.serveJson(subservice.getJSON(subservice.getUsingID(SID))));
 }
示例#5
0
 public IActionResult getReceipts(long accID, string apiKey)
 {
     if (!api.validAPIKey(apiKey))
     {
         return(new UnauthorizedObjectResult("Invalid API key"));
     }
     if (accID < 1)
     {
         return(BadRequest("Invalid Account ID"));
     }
     return(api.serveJson(uas.getReceiptsFromAccount(accID)));
 }
示例#6
0
 public IActionResult getTransactions(long accID, string apiKey)
 {
     if (!api.validAPIKey(apiKey))
     {
         return(new UnauthorizedObjectResult("Invalid API key"));
     }
     return(api.serveJson(uas.getTransactionsFromAccount(accID)));
 }