Custom Views and API v1
  • 31 Mar 2022
  • 6 Minutes To Read
  • Dark
    Light
  • PDF

Custom Views and API v1

  • Dark
    Light
  • PDF

Custom Views and API v1

Custom views are used to configure the Mambu UI, to quickly generate reports, and for data extraction with the Mambu v1 API.

This document provides a guide to using custom views for data extraction - that is, filtering GET request results with the Mambu v1 API. For general information on custom views, see our Custom Views article.

In API v2, a similar data extraction functionality is provided by filtering query results using search endpoints. For more information, see "Sorting and filtering with Search Endpoints" in the Pagination section of our API v2 Reference.

Operations

There are two general request types available related to custom views in API v1:

For all operations that require specifying a particular custom view, the custom view is identified by the custom view encoded key. You can retrieve the encoded key for a custom view by calling the get custom views for a specified user endpoint, specifying your own user name to limit results to custom views you have access to.

Get entities filtered by a specified custom view

In API v1, custom views can be useful for easily filtering query results to retrieve a specified subset of information. For example, if you set up a custom view to show all loans in arrears, then you easily generate a GET request for all loans, and filter the results with that custom view's encoded key. The API will then return all loans in arrears.

This operation may be used for any entity that has custom views available. See API operations below for more details.

If you wish, you may further filter query results using pagination parameters. For more information on pagination parameters, see Pagination in our API v1 Reference.

Please Note

When getting a custom view, the roles that can see the view ("roleKeys") are available in the "viewRights" JSON object. If you are using the roles that can see a custom view, please update to the new JSON structure, as the roleKeys array is deprecated.

GET queries with filtered results

Send a GET query to the following endpoints to return all relevant entities that match the specified custom view.

For example, a GET request to /api/clients?viewfilter=1234 will return all clients who are included in the custom view with encoded key 1234.

Entity Endpoint
clients /api/clients?viewfilter={customViewEncodedKey}
groups /api/groups?viewfilter={customViewEncodedKey}
lines of credit /api/linesofcredit?viewfilter={customViewEncodedKey}
loans /api/loans?viewfilter={customViewEncodedKey}
loan transactions /api/loans/transactions?viewfilter={customViewEncodedKey}
deposits /api/savings?viewfilter={customViewEncodedKey}
deposit transactions /api/savings/transactions?viewfilter={customViewEncodedKey}
system activities /api/activities?viewfilter={customViewEncodedKey}

For more detailed information on each specific endpoint, see the appropriate section of our API v1 Reference.

viewfilter query parameter (required)

All requests must include the required viewfilter path parameter, with a value set to the custom view encodedKey.

resultType query parameter (optional)

You may use the resultType query parameter to define what detail level you want to retrieve for your custom view results.

The following values are supported for the optional resultType query parameter:

Value Description
FULL_DETAILS Returns all associated objects, such as custom fields and ID documents.
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 custom view columns that accept totals.

Request examples

Get results with full details of a loan custom view

GET /api/loans?viewfilter=ff80808145ad199d0145d153f&resultType=FULL_DETAILS

Get results with summary details of a loan custom view

GET /api/loans?viewfilter=ff80808145ad199d0145d153f&resultType=SUMMARY

Get three results of a client custom view

Get the first three clients defined by the specified custom view.

GET /api/clients?viewfilter=ff80808145acd1f20145acd2774b0001&limit=3

Get results of a credit arrangement custom view with custom pagination

Get credit arrangements using the specified custom view, using custom pagination.

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

Response examples

The below is a response example for the following GET request:

GET /api/clients?viewfilter={customViewId}
[
    {
        "encodedKey": "8a19aad77801888d017801f0dd841c1d",
        "state": "ACTIVE",
        "id": "190955698",
        "creationDate": "2021-03-05T10:31:05+0000",
        "lastModifiedDate": "2021-11-18T09:19:13+0000",
        "approvedDate": "2021-03-05T10:31:05+0000",
        "activationDate": "2021-11-18T09:19:13+0000",
        "firstName": "John ",
        "lastName": "Smith ",
        "mobilePhone1": "0044 6471372644",
        "gender": "MALE",
        "notes": "This is our client.",
        "loanCycle": 0,
        "groupLoanCycle": 0,
        "preferredLanguage": "ENGLISH",
        "clientRole": {
            "encodedKey": "8a194df577c9c1300177cf333078007c"
        }
    },
    {
        "encodedKey": "8a19b9b77d6f89ce017d712371cb45c8",
        "state": "ACTIVE",
        "id": "711683516",
        "creationDate": "2021-11-30T13:58:08+0000",
        "lastModifiedDate": "2021-12-01T07:42:17+0000",
        "approvedDate": "2021-12-01T07:07:16+0000",
        "activationDate": "2021-12-01T07:42:17+0000",
        "firstName": "Mary ",
        "lastName": "Poppins",
        "notes": "",
        "loanCycle": 0,
        "groupLoanCycle": 0,
        "preferredLanguage": "ENGLISH",
        "clientRole": {
            "encodedKey": "8a194df577c9c1300177cf333078007c"
        }
    },
    {
        "encodedKey": "8a19d7c27c7da1c4017c82b698435703",
        "state": "ACTIVE",
        "id": "544142722",
        "creationDate": "2021-10-15T07:30:45+0000",
        "lastModifiedDate": "2022-02-23T11:00:17+0000",
        "approvedDate": "2021-10-15T07:30:45+0000",
        "activationDate": "2022-02-23T11:00:17+0000",
        "firstName": "Poppy",
        "lastName": "Smith",
        "notes": "",
        "assignedBranchKey": "8a19d2417886f5be01788732e92b01e6",
        "loanCycle": 0,
        "groupLoanCycle": 0,
        "preferredLanguage": "ENGLISH",
        "clientRole": {
            "encodedKey": "8a19c63f7c49441e017c4a05834b0bd3"
        }
    }
]

Get custom views for a specified user

You can retrieve all custom views or custom views of a specific type for a specific user.

API operations

Action Endpoint Description
GET /api/users/{username}/views Get custom views for a particular user.

for query parameter (optional)

You may use the for query parameter to define for which entity types you want to retrieve custom views. If the for query parameter is used, you may only retrieve custom views for one entity type at a time.

Parameter Values
for CLIENTS, GROUPS, LINES_OF_CREDIT, LOANS, DEPOSITS, LOAN_TRANSACTIONS, DEPOSIT_TRANSACTIONS, SYSTEM_ACTIVITIES

Get custom views request examples

Get all custom views available for a user

GET /api/users/{username}/views

Get all CLIENT type custom views available for a user

GET /api/users/{username}/views?for=CLIENTS

Response example

The below is a response example for the following GET request:

GET /api/users/{username}/views?for=CLIENTS
[
    {
        "encodedKey": "8a194df577c9c1300177cf3339630082",
        "filter": {
            "encodedKey": "8a194df577c9c1300177cf3339630084",
            "filterConstraints": [
                {
                    "encodedKey": "8a194df577c9c1300177cf3339630085",
                    "dataFieldType": "NATIVE",
                    "dataItemType": "CLIENT",
                    "dataType": "ENUM",
                    "dataFieldValue": "CLIENT_STATE",
                    "filterElement": "IN",
                    "value": "ACTIVE",
                    "linkingOperator": "AND",
                    "groupNumber": 10,
                    "index": 0
                }
            ]
        },
        "columnConfiguration": {
            "encodedKey": "8a194df577c9c1300177cf333aad0087",
            "fieldColumns": [
                {
                    "encodedKey": "8a19dab27be82f7c017bed8863c208d8",
                    "dataField": "FULL_NAME",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a19dab27be82f7c017bed8863c208d9",
                    "dataField": "ID",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a19dab27be82f7c017bed8863c208da",
                    "dataField": "CLIENT_STATE",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a19dab27be82f7c017bed8863c208db",
                    "dataField": "CREDIT_OFFICER_NAME",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a19dab27be82f7c017bed8863c208dc",
                    "dataField": "LOANS_BALANCE",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a19dab27be82f7c017bed8863c508dd",
                    "dataField": "DEPOSITS_BALANCE",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a19dab27be82f7c017bed8863c508de",
                    "dataField": "LAST_MODIFIED_DATE",
                    "dataItemType": "CLIENT"
                }
            ],
            "includeTotals": true,
            "includeTimestamp": false,
            "sortingOrder": "DESCENDING"
        },
        "customConfigurationInfo": {
            "encodedKey": "8a194df577c9c1300177cf3339630086",
            "name": "Active",
            "dataViewType": "CLIENT",
            "indexInList": -1,
            "creationDate": "2021-02-23T14:02:57+0000",
            "lastModifiedDate": "2021-09-16T07:35:44+0000"
        },
        "viewMode": "LIST",
        "parentMenuItemKey": "8a194df577c9c1300177cf3334e60080",
        "viewRights": {
            "encodedKey": "8a194df577c9c1300177cf3339630083",
            "isAccessibleByAllUsers": true,
            "roles": []
        }
    },
    {
        "encodedKey": "8a194df577c9c1300177cf333ab20090",
        "filter": {
            "encodedKey": "8a194df577c9c1300177cf333ab50092",
            "filterConstraints": [
                {
                    "encodedKey": "8a194df577c9c1300177cf333ab50093",
                    "dataFieldType": "NATIVE",
                    "dataItemType": "CLIENT",
                    "dataType": "ENUM",
                    "dataFieldValue": "CLIENT_STATE",
                    "filterElement": "EQUALS",
                    "value": "INACTIVE",
                    "linkingOperator": "AND",
                    "groupNumber": 0,
                    "index": 0
                }
            ]
        },
        "columnConfiguration": {
            "encodedKey": "8a194df577c9c1300177cf333ab50095",
            "fieldColumns": [
                {
                    "encodedKey": "8a194df577c9c1300177cf333ac40097",
                    "dataField": "FULL_NAME",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333ac40098",
                    "dataField": "ID",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333ac40099",
                    "dataField": "CLIENT_STATE",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333ac4009a",
                    "dataField": "CREDIT_OFFICER_NAME",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333acc009b",
                    "dataField": "TOTAL_BALANCE",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333acc009c",
                    "dataField": "PENDING_LOAN_AMOUNT",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333acc009d",
                    "dataField": "APPROVED_LOAN_AMOUNT",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333acc009e",
                    "dataField": "LAST_MODIFIED_DATE",
                    "dataItemType": "CLIENT"
                }
            ],
            "includeTotals": true,
            "includeTimestamp": false,
            "sortingColumn": {
                "encodedKey": "8a194df577c9c1300177cf333ac40096",
                "dataField": "LAST_MODIFIED_DATE",
                "dataItemType": "CLIENT"
            },
            "sortingOrder": "DESCENDING"
        },
        "customConfigurationInfo": {
            "encodedKey": "8a194df577c9c1300177cf333ab50094",
            "name": "Inactive",
            "dataViewType": "CLIENT",
            "indexInList": -1,
            "creationDate": "2021-02-23T14:02:57+0000",
            "lastModifiedDate": "2021-02-23T14:02:57+0000"
        },
        "viewMode": "LIST",
        "parentMenuItemKey": "8a194df577c9c1300177cf3334e60080",
        "viewRights": {
            "encodedKey": "8a194df577c9c1300177cf333ab50091",
            "isAccessibleByAllUsers": true,
            "roles": []
        }
    },
    {
        "encodedKey": "8a194df577c9c1300177cf333acc009f",
        "filter": {
            "encodedKey": "8a194df577c9c1300177cf333acf00a1",
            "filterConstraints": [
                {
                    "encodedKey": "8a194df577c9c1300177cf333acf00a2",
                    "dataFieldType": "NATIVE",
                    "dataItemType": "CLIENT",
                    "dataType": "ENUM",
                    "dataFieldValue": "CLIENT_STATE",
                    "filterElement": "EQUALS",
                    "value": "PENDING_APPROVAL",
                    "linkingOperator": "AND",
                    "groupNumber": 0,
                    "index": 0
                }
            ]
        },
        "columnConfiguration": {
            "encodedKey": "8a194df577c9c1300177cf333acf00a4",
            "fieldColumns": [
                {
                    "encodedKey": "8a194df577c9c1300177cf333ad900a6",
                    "dataField": "FULL_NAME",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333ad900a7",
                    "dataField": "ID",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333ad900a8",
                    "dataField": "CLIENT_STATE",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333ad900a9",
                    "dataField": "CREDIT_OFFICER_NAME",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333adc00aa",
                    "dataField": "CREATION_DATE",
                    "dataItemType": "CLIENT"
                },
                {
                    "encodedKey": "8a194df577c9c1300177cf333adc00ab",
                    "dataField": "LAST_MODIFIED_DATE",
                    "dataItemType": "CLIENT"
                }
            ],
            "includeTotals": true,
            "includeTimestamp": false,
            "sortingColumn": {
                "encodedKey": "8a194df577c9c1300177cf333ad900a5",
                "dataField": "LAST_MODIFIED_DATE",
                "dataItemType": "CLIENT"
            },
            "sortingOrder": "DESCENDING"
        },
        "customConfigurationInfo": {
            "encodedKey": "8a194df577c9c1300177cf333acf00a3",
            "name": "Pending Approval",
            "dataViewType": "CLIENT",
            "indexInList": -1,
            "creationDate": "2021-02-23T14:02:57+0000",
            "lastModifiedDate": "2021-02-23T14:02:57+0000"
        },
        "viewMode": "LIST",
        "parentMenuItemKey": "8a194df577c9c1300177cf3334e60080",
        "viewRights": {
            "encodedKey": "8a194df577c9c1300177cf333acf00a0",
            "isAccessibleByAllUsers": true,
            "roles": []
        }
    }
]

Was This Article Helpful?