Developer Center

Custom Views API

Last Updated: Oct 03, 2018 04:15PM CEST

URL

/api/users/{username}/views
/api/clients?viewfilter={customViewId}
/api/groups?viewfilter={customViewId}
/api/linesofcredit?viewfilter={customViewId}
/api/loans?viewfilter={customViewId}
/api/savings?viewfilter={customViewId}
/api/loans/transactions?viewfilter={customViewId}
/api/savings/transactions?viewfilter={customViewId}
/api/activities?viewfilter={customViewId}

Description

Allows you to retrieve custom views or entities filtered by custom views.

Methods

GET Custom Views

for Filter custom views by type. Available types:
  • CLIENTS
  • GROUPS
  • LINES_OF_CREDIT
  • LOANS
  • DEPOSITS
  • LOAN_TRANSACTIONS
  • DEPOSIT_TRANSACTIONS
  • SYSTEM_ACTIVITIES
resultType FULL_DETAILS - Returns all objects associated (custom fields, ID documents, etcetera).
BASIC - Returns a summary of the objects (default view).
SUMMARY - Returns an object with the count for the custom view (number of items) and the totals for all the custom view columns that accept totals.

Usage examples

// get all custom views available for user demo
GET /api/users/demo/views

// get all CLIENT type custom views available for user demo
GET /api/users/demo/views?for=CLIENTS

// get full details of a particular view
GET /api/loans?viewfilter=ff80808145ad199d0145d153f&resultType=FULL_DETAILS

// get summary details of a particular view
GET /api/loans?viewfilter=ff80808145ad199d0145d153f&resultType=SUMMARY

Samples responses

//basic full savings details of an active loan account
[
   {
      "encodedKey":"40288a134700d849014700d8725b000c",
      "filter":{
         "encodedKey":"40288a134700d849014700d872fc000e",
         "filterConstraints":[
            {
               "encodedKey":"40288a134700d849014700d872fd000f",
               "dataFieldType":"NATIVE",
               "dataItemType":"CLIENT",
               "dataType":"ENUM",
               "dataFieldValue":"CLIENT_STATE",
               "filterElement":"EQUALS",
               "value":"ACTIVE"
            }
         ]
      },
   },
   {
      "encodedKey":"40288a134700d849014700d8730e0025",
      "filter":{
         "encodedKey":"40288a134700d849014700d8730f0027",
         "filterConstraints":[
            {
               "encodedKey":"40288a134700d849014700d8730f0028",
               "dataFieldType":"NATIVE",
               "dataItemType":"GROUP",
               "dataType":"MONEY",
               "dataFieldValue":"LOANS_BALANCE",
               "filterElement":"MORE_THAN",
               "value":"0"
            }
         ]
      },
      "columnConfiguration":{
         "encodedKey":"40288a134700d849014700d8730e0026",
         "columns":[
            "GROUP_NAME",
            "ID",
            "CREDIT_OFFICER_NAME",
            "NUMBER_OF_MEMBERS",
            "LOANS_BALANCE",
            "DEPOSITS_BALANCE",
            "LOAN_CYCLE",
            "LAST_MODIFIED_DATE"
         ],
         "includeTotals":true,
         "nativeSortingDataField":"LAST_MODIFIED_DATE",
         "sortingOrder":"DESCENDING"
      },
      "customConfigurationInfo":{
         "encodedKey":"40288a134700d849014700d873100029",
         "name":"Active Loan Accounts",
         "shared":false,
         "dataViewType":"GROUP",
         "indexInList":-1,
         "creationDate":"2014-07-04T13:08:11+0000",
         "lastModifiedDate":"2014-07-04T13:08:11+0000"
      },
      //old role key
      "roleKeys":[ "40288a134700d849014700d8733csaz2"],
      //new role key
      "viewRights":{
         "encodedKey":"40288a045185e865015185e8aade001c",
         "isAccessibleByAllUsers":false,
         "roles":[
            "40288a134700d849014700d8733csaz2"
         ]
      }
   },
   {
      "encodedKey":"40288a134700d849014700d8731f003a",
      "filter":{
         "encodedKey":"40288a134700d849014700d87321003c",
         "filterConstraints":[
            {
               "encodedKey":"40288a134700d849014700d87321003d",
               "dataFieldType":"NATIVE",
               "dataItemType":"LOANS",
               "dataType":"ENUM",
               "dataFieldValue":"ACCOUNT_STATE",
               "filterElement":"EQUALS",
               "value":"ACTIVE"
            }
         ]
      },
      "columnConfiguration":{
         "encodedKey":"40288a134700d849014700d87320003b",
         "columns":[
            "RECIPIENT",
            "ACCOUNT_ID",
            "LOAN_NAME",
            "ACCOUNT_STATE",
            "LOAN_AMOUNT",
            "CREDIT_OFFICER_NAME",
            "PRINCIPAL_DUE",
            "INTEREST_DUE",
            "TOTAL_DUE",
            "TOTAL_PAID",
            "LAST_MODIFIED_DATE"
         ],
         "includeTotals":true,
         "nativeSortingDataField":"LAST_MODIFIED_DATE",
         "sortingOrder":"DESCENDING"
      },
      "customConfigurationInfo":{
         "encodedKey":"40288a134700d849014700d87322003e",
         "name":"Active",
         "shared":false,
         "dataViewType":"LOANS",
         "indexInList":-1,
         "creationDate":"2014-07-04T13:08:11+0000",
         "lastModifiedDate":"2014-07-04T13:08:11+0000"
      },
      //old role key
      "roleKeys":[ "40288a134700d849014700d8733csaz2"],
      //new role key
      "viewRights":{
         "encodedKey":"40288a045185e865015185e8aade001z",
         "isAccessibleByAllUsers":false,
         "roles":[
            "40288a134700d849014700d8733csaz2"
         ]
      }
   },
   {
      "encodedKey":"40288a134700d849014700d8733c0062",
      "filter":{
         "encodedKey":"40288a134700d849014700d8733d0064",
         "filterConstraints":[
            {
               "encodedKey":"40288a134700d849014700d8733e0065",
               "dataFieldType":"NATIVE",
               "dataItemType":"SAVINGS",
               "dataType":"ENUM",
               "dataFieldValue":"ACCOUNT_STATE",
               "filterElement":"EQUALS",
               "value":"PENDING_APPROVAL"
            }
         ]
      },
      "columnConfiguration":{
         "encodedKey":"40288a134700d849014700d8733c0063",
         "columns":[
            "RECIPIENT",
            "ACCOUNT_ID",
            "PRODUCT_NAME",
            "ACCOUNT_STATE",
            "CREDIT_OFFICER_NAME",
            "CREATION_DATE",
            "ACTIVATION_DATE",
            "MATURITY_DATE",
            "LAST_MODIFIED_DATE"
         ],
         "includeTotals":true,
         "nativeSortingDataField":"LAST_MODIFIED_DATE",
         "sortingOrder":"DESCENDING"
      },
      "customConfigurationInfo":{
         "encodedKey":"40288a134700d849014700d8733e0066",
         "name":"Pending Approval",
         "shared":true,
         "dataViewType":"SAVINGS",
         "indexInList":-1,
         "creationDate":"2014-07-04T13:08:11+0000",
         "lastModifiedDate":"2014-07-04T13:08:11+0000"
      },
      //old role key
      "roleKeys":[ ],
      //new role key
      "viewRights":{
         "encodedKey":"40288a045185e865015185e8aade0012",
         "isAccessibleByAllUsers":false,
         "roles":[ ]
      }
   },
   {
      "encodedKey":"40288a134700d849014700d8734c0076",
      "filter":{
         "encodedKey":"40288a134700d849014700d8734d0078",
         "filterConstraints":[ ]
      },
      "columnConfiguration":{
         "encodedKey":"40288a134700d849014700d8734c0077",
         "columns":[
            "ENTRY_DATE",
            "USER",
            "TRANSACTION_ID",
            "EVENT",
            "AMOUNT",
            "PARENT_ACCOUNT_ID",
            "PARENT_ACCOUNT",
            "PARENT_ACCOUNT_HOLDER",
            "TRANSACTION_DATE",
            "FEES_PAID",
            "INTEREST_PAID",
            "PENALTY_PAID",
            "PRINCIPAL_PAID"
         ],
         "includeTotals":true,
         "nativeSortingDataField":"ENTRY_DATE",
         "sortingOrder":"DESCENDING"
      },
      "customConfigurationInfo":{
         "encodedKey":"40288a134700d849014700d8734e0079",
         "name":"Loan Transactions",
         "shared":true,
         "dataViewType":"LOAN_TRANSACTIONS_LOOKUP",
         "indexInList":-1,
         "creationDate":"2014-07-04T13:08:11+0000",
         "lastModifiedDate":"2014-07-04T13:08:11+0000"
      },
      //old role key
      "roleKeys":[ ],
      //new role key
      "viewRights":{
         "encodedKey":"40288a045185e865015185e8aade0014",
         "isAccessibleByAllUsers":false,
         "roles":[ ]
      }
   },
   {
      "encodedKey":"40288a134700d849014700d8734f007a",
      "filter":{
         "encodedKey":"40288a134700d849014700d87350007c",
         "filterConstraints":[ ]
      },
      "columnConfiguration":{
         "encodedKey":"40288a134700d849014700d8734f007b",
         "columns":[
            "ENTRY_DATE",
            "USER",
            "TRANSACTION_ID",
            "EVENT",
            "AMOUNT",
            "PARENT_ACCOUNT_ID",
            "PARENT_ACCOUNT",
            "PARENT_ACCOUNT_HOLDER",
            "TRANSACTION_DATE",
            "FEES_PAID",
            "INTEREST_PAID",
            "PENALTY_PAID",
            "PRINCIPAL_PAID"
         ],
         "includeTotals":true,
         "nativeSortingDataField":"ENTRY_DATE",
         "sortingOrder":"DESCENDING"
      },
      "customConfigurationInfo":{
         "encodedKey":"40288a134700d849014700d87352007d",
         "name":"Deposit Transactions",
         "shared":true,
         "dataViewType":"SAVINGS_TRANSACTIONS_LOOKUP",
         "indexInList":-1,
         "creationDate":"2014-07-04T13:08:11+0000",
         "lastModifiedDate":"2014-07-04T13:08:11+0000"
      },
      //old role key
      "roleKeys":[ ],
      //new role key
      "viewRights":{
         "encodedKey":"40288a045185e865015185e8aade0016",
         "isAccessibleByAllUsers":false,
         "roles":[ ]
      }
   },
   {
      "encodedKey":"40288a1347014ddf01470167b4760016",
      "filter":{
         "encodedKey":"40288a1347014ddf01470167b4780019",
         "filterConstraints":[
         ]
      },
      "columnConfiguration":{
         "encodedKey":"40288a1347014ddf01470167b4770017",
         "columns":[
            "AFFECTED_CLIENT",
            "AFFECTED_ITEM",
            "ASSIGNED_CENTRE",
            "EVENT",
            "NOTES",
            "TRANSACTION_DATE",
            "USER"
         ],
         "includeTotals":false,
         "sortingOrder":"DESCENDING"
      },
      "customConfigurationInfo":{
         "encodedKey":"40288a1347014ddf01470167b4780018",
         "userKey":"40288a134700d849014700d853490004",
         "name":"System Activity",
         "shared":false,
         "dataViewType":"ACTIVITIES_LOOKUP",
         "indexInList":-1,
         "creationDate":"2014-07-04T12:44:39+0000",
         "lastModifiedDate":"2014-07-04T12:44:39+0000"
      },
      //old role key
      "roleKeys":[ ],
      //new role key
      "viewRights":{
         "encodedKey":"40288a045185e865015185e8aade0z1g",
         "isAccessibleByAllUsers":false,
         "roles":[ ]
      }
   }
]
Note: When getting a custom view, the roles that can see the view ("roleKeys") are now available in a different JSON object, "viewRights". If you're using the roles that can see a custom view, please update to the new JSON structure for role since the roleKeys array will not be available starting with Mambu 4.1

GET Entities Filtered by Custom View

viewfilter The custom view key. Requiered

Usage examples

//Get the first 3 clients defined by the custom view with ff80808145acd1f20145acd2774b0001 encoded key.
GET /api/clients?viewfilter=ff80808145acd1f20145acd2774b0001&limit=3

//Get the first 10 groups using custom view encoded key.
GET /api/groups?viewfilter=ff80808145acd1f20145acd2774bzx01&limit=10

//Get credit arrangements using custom view encoded key. Custom pagination is used
GET /api/linesofcredit?viewfilter=ff80808145ad199d0423t1c53bccsd3&limit=10&offset=15
//Get loans using custom view encoded key. Default pagination is used. GET /api/loans?viewfilter=ff80808145ad199d0145ad1c53fc000e //Get deposits using custom view encoded key. Default pagination is used. GET /api/savings?viewfilter=ff80808145ad199d0145acvxvc53fc000e //Get loan transactions using custom view encoded key. Custom pagination is used GET /api/loans/transactions?viewfilter=ff80808145ad199d0145ad1c5fds00e&limit=10&offset=15 //Get savings transactions using custom view encoded key. Default pagination is used GET /api/savings/transactions?viewfilter=ff80808145ad199d0423t1c53fcfss0e //Get system activities using custom view encoded key. Default pagination is used GET /api/activities?viewfilter=ff80808145ad199d0423t1c53bccsd3

Samples responses

//get the first client filtered by a custom view
[
   {
      "encodedKey":"40288a134700f486014700f6074200e6",
      "state":"ACTIVE",
      "id":"14",
      "creationDate":"2014-07-04T10:40:28+0000",
      "lastModifiedDate":"2014-07-07T15:20:08+0000",
      "activationDate":"2014-07-07T15:20:08+0000",
      "firstName":"Roland",
      "lastName":"Asfour",
      "homePhone":"051-624-111",
      "birthDate":"1978-07-15T10:40:29+0000",
      "gender":"FEMALE",
      "loanCycle":0,
      "groupLoanCycle":0,
      "clientLinesOfCredit":[

      ]
   }
]
//get the first loan transaction filtered by a custom view
[
   {
      "encodedKey":"40288a134711678e014711691f4c000b",
      "transactionId":31,
      "parentAccountKey":"40288a134711678e01471168f3510003",
      "type":"DISBURSMENT",
      "comment":"",
      "creationDate":"2014-07-07T15:20:07+0000",
      "entryDate":"2014-07-07T15:20:07+0000",
      "amount":"950",
      "principalPaid":"950",
      "interestPaid":"0",
      "deferredInterestAmount":"0",
      "feesPaid":"0",
      "penaltyPaid":"0",
      "taxOnInterestPaid":"0",
      "taxOnFeesAmount":"0",
      "taxOnPenaltyAmount":"0",
      "deferredTaxOnInterestAmount":"0",
      "balance":"950",
      "details":{
         "encodedKey":"40288a134711678e014711691f50000c",
         "internalTransfer":false
      },
      "userKey":"40288a134700d849014700d853490004",
      "loanPredefinedFeeAmounts":[

      ],
      "productTypeKey":"40288a134700f486014700f60e8d0336"
   }
]

//get the summary details of a custom view
{
   "summary":{
      "count":"2",
      "totals":[
         {
            "dataItemType":"CLIENT",
            "values":{
               "LOAN_AMOUNT":"1900",
               "PRINCIPAL_DUE":"0",
               "INTEREST_DUE":"0",
               "TOTAL_DUE":"0",
               "TOTAL_PAID":"0"
            },
            "customFieldValues":{
               "LOAN_AMOUNT":"1900",
               "PRINCIPAL_DUE":"0"
            }
         },
         {
            "dataItemType":"LOAN",
            "values":{
               "LOAN_AMOUNT":"1900",
               "PRINCIPAL_DUE":"0",
               "INTEREST_DUE":"0",
               "TOTAL_DUE":"0",
               "TOTAL_PAID":"0"
            }
         }
      ]
   }
}

support@mambu.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete