diff --git a/APIFolder/api.htm b/APIFolder/api.htm index 1d871d976..33dbfb721 100644 --- a/APIFolder/api.htm +++ b/APIFolder/api.htm @@ -120,10 +120,9 @@ var jqxhr = $.ajax({
Example Request: - https://localhost:8443/mifosng-provider/api/v1/clients/1/loans +
+ An example of how a loan portfolio summary can be provided. This one contains quite a bit of redundant data (like the counts) and is requested
+ in a specific use case of the Individual Lending User Interface.
+ However, it is quite reasonable to add resources like this to simplify User Interface development.
Example Request:
+ https://localhost:8443/mifosng-provider/api/v1/clients/1/loans?pretty=true +GET https://thedomainname/api/v1/clients/{clientId}/loans
{
- "pendingApprovalLoans": [],
- "awaitingDisbursalLoans": [
- {
- "id": 17,
- "externalId": null,
- "loanProductId": 1,
- "loanProductName": "Agricultural Loan",
- "loanStatusId": 200,
- "pendingApproval": false,
- "waitingForDisbursal": true,
- "open": false,
- "closed": false,
- "lifeCycleStatusText": "Approved",
- "lifeCycleStatusDate": null
- }
- ],
- "openLoans": [],
- "closedLoans": [
- {
- "id": 1,
- "externalId": null,
- "loanProductId": 1,
- "loanProductName": "Agricultural Loan",
- "loanStatusId": 600,
- "pendingApproval": false,
- "waitingForDisbursal": false,
- "open": false,
- "closed": true,
- "lifeCycleStatusText": "Closed",
- "lifeCycleStatusDate": null
- }
- ],
- "anyLoanCount": 2,
- "pendingApprovalLoanCount": 0,
- "awaitingDisbursalLoanCount": 1,
- "activeLoanCount": 0,
- "closedLoanCount": 1
+ "pendingApprovalLoans" : [ ],
+ "awaitingDisbursalLoans" : [ {
+ "id" : 17,
+ "externalId" : null,
+ "loanProductId" : 1,
+ "loanProductName" : "Agricultural Loan",
+ "loanStatusId" : 200,
+ "pendingApproval" : false,
+ "waitingForDisbursal" : true,
+ "open" : false,
+ "closed" : false,
+ "lifeCycleStatusText" : "Approved",
+ "lifeCycleStatusDate" : null
+ } ],
+ "openLoans" : [ ],
+ "closedLoans" : [ {
+ "id" : 1,
+ "externalId" : null,
+ "loanProductId" : 1,
+ "loanProductName" : "Agricultural Loan",
+ "loanStatusId" : 600,
+ "pendingApproval" : false,
+ "waitingForDisbursal" : false,
+ "open" : false,
+ "closed" : true,
+ "lifeCycleStatusText" : "Closed",
+ "lifeCycleStatusDate" : null
+ } ],
+ "anyLoanCount" : 2,
+ "pendingApprovalLoanCount" : 0,
+ "awaitingDisbursalLoanCount" : 1,
+ "activeLoanCount" : 0,
+ "closedLoanCount" : 1
}
Example Request: - https://localhost:8443/mifosng-provider/api/v1/clients/2/notes +
+ Note: Notes are returned in descending createOn order.
+Example Request:
+ https://localhost:8443/mifosng-provider/api/v1/clients/2/notes?pretty=true +GET https://thedomainname/api/v1/clients/{clientId}/notes
-{
- "notes": [
- {
- "id": 20,
- "clientId": 2,
- "loanId": 0,
- "loanTransactionId": 0,
- "noteTypeId": 100,
- "note": "This is an extra note!",
- "createdById": 2,
- "createdByUsername": "super1",
- "createdOn": "2012-04-22T13:50:25.000+01:00",
- "updatedById": 2,
- "updatedByUsername": "super1",
- "updatedOn": "2012-04-22T13:50:25.000+01:00"
- },
- {
- "id": 16,
- "clientId": 2,
- "loanId": 0,
- "loanTransactionId": 0,
- "noteTypeId": 100,
- "note": "loan only 1/2 amount expected\r\nyes",
- "createdById": 2,
- "createdByUsername": "super1",
- "createdOn": "2012-04-18T15:15:04.000+01:00",
- "updatedById": 2,
- "updatedByUsername": "super1",
- "updatedOn": "2012-04-23T09:38:13.000+01:00"
- }
- ]
-}
+[ {
+ "id" : 20,
+ "clientId" : 2,
+ "loanId" : null,
+ "loanTransactionId" : null,
+ "noteTypeId" : 100,
+ "note" : "This is an extra note!",
+ "createdById" : 2,
+ "createdByUsername" : "super1",
+ "createdOn" : 1335066625000,
+ "updatedById" : 2,
+ "updatedByUsername" : "super1",
+ "updatedOn" : 1335066625000
+}, {
+ "id" : 16,
+ "clientId" : 2,
+ "loanId" : null,
+ "loanTransactionId" : null,
+ "noteTypeId" : 100,
+ "note" : "loan only 1/2 amount expected\r\nyes",
+ "createdById" : 2,
+ "createdByUsername" : "super1",
+ "createdOn" : 1334726104000,
+ "updatedById" : 2,
+ "updatedByUsername" : "super1",
+ "updatedOn" : 1335137893000
+} ]
{ "entityId": 40}
+{
+ "entityId": 40
+}
+
Example Request: - https://localhost:8443/mifosng-provider/api/v1/clients/1/notes/40 -
+Example Request:
+ https://localhost:8443/mifosng-provider/api/v1/clients/2/notes/20?pretty=true +GET https://thedomainname/api/v1/clients/{clientId}/notes/{noteId}
{
- "id": 40,
- "clientId": 2,
- "loanId": 0,
- "loanTransactionId": 0,
- "noteTypeId": 100,
- "note": "a note about the client",
- "createdById": 1,
- "createdByUsername": "mifos",
- "createdOn": "2012-05-22T21:40:05.000+01:00",
- "updatedById": 1,
- "updatedByUsername": "mifos",
- "updatedOn": "2012-05-22T21:40:05.000+01:00"
+ "id" : 20,
+ "clientId" : 2,
+ "loanId" : null,
+ "loanTransactionId" : null,
+ "noteTypeId" : 100,
+ "note" : "This is an extra note!",
+ "createdById" : 2,
+ "createdByUsername" : "super1",
+ "createdOn" : 1335066625000,
+ "updatedById" : 2,
+ "updatedByUsername" : "super1",
+ "updatedOn" : 1335066625000
}
PUT https://thedomainname/api/v1/clients/{clientId}/notes/{noteId}
-PUT https://localhost:8443/mifosng-provider/api/v1/clients/1/notes/40
+PUT https://localhost:8443/mifosng-provider/api/v1/clients/2/notes/20
Content-Type: application/json
Request Body:
{
-"note": "an updated note about the client"
+"note": "and here the note is updated nicely."
+}
+
+{
+ "entityId": 20
}
- {"entityId": 40}
POST https://thedomainname/api/v1/loans/{loanId}/undo
- https://localhost:8443/mifosng-provider/api/v1/loans/1/undo
-
-
- Content-Type: application/json
- Request Body:
- new json here
-
- {
- "entityId": 2
-}
-
-