REST APIs Overview
  • Updated on 11 Mar 2020
  • 2 minutes to read
  • Print
  • Share
  • Dark
    Light

REST APIs Overview

  • Print
  • Share
  • Dark
    Light

Being RESTful

The Mambu API follows the Representational state transfer (REST) architectural style allowing resources (accounts, clients, etc) to be viewed, added and modified by a standard set of HTTP methods; GET, POST, PUT, PATCH and DELETE.

Communication with Mambu follows the REST architecture constraints including being stateless & cacheable.

All responses are returned as JSON objects .


Endpoints

Mambu tenants can exist either in a multi-tenanted environment with all tenants having access at their own sub-domain or within a dedicated environment.

To make a request to a tenant use the pattern <tenantId>.mambu.com/api/ or <tenantId>.mambucloud.com/api/ if on a shared, cloud environment.

The tenant domain will generally be the same as the one used for accessing the Mambu user interferace and can also be retrieved by visiting MyMambu and opening the Dashboard tab, where you will also find the domain for your sandbox instance, if this has been activated. See here for more information on working with MyMambu.


Posting Data

API requests that post data can either use url-encoded query paramters or a json body to enter data. The content-type header must be set to "application/json" for the json request.

Please be Aware
GET requests should always use url-encoding to make sure any special characters are properly escaped.

The following examples show the two methods for posting data. Note that for some requests, much more information can be posted using the json input than is available with query parameters.

curl -d "type=APPROVAL" https://user:pword@test.mambu.com/api/loans/4028329c3ad6c515013ad6d0f6e40006/transactions   

Using JSON:

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{ "type": "APPROVAL"} https://user:pword@test.mambu.com/api/loans/4028329c3ad6c515013ad6d0f6e40006/transactions`

Example

The follow example makes a request using the username user, the password pword to the tenant demo to retrieve all repayments for loan account abc

https://user:pword@demo.mambu.com/api/loans/abc/repayments

And returns a response such as:

[ 
    {    
        "encodedKey": "402832b4380a2d8801380a9cac860010",
        "parentAccountKey": "402832b4380a2d8801380a9cac41000f",
        "dueDate": "2012-07-28T00:00:00+0200",
        "principalDue": "190",
        "principalPaid": "0",
        "interestDue": "25.45",
        "interestPaid": "0",
        "state": "PENDING" 
    },
    {
        "encodedKey": "402832b4380a2d8801380a9cac870011",
        "parentAccountKey": "402832b4380a2d8801380a9cac41000f",
        "dueDate": "2012-08-28T00:00:00+0200",
        "principalDue": "190",
        "principalPaid": "0",
        "interestDue": "26.29",
        "interestPaid": "0",
        "state": "PENDING"
    }
]

Ask the Mambu Community

If you have a question about how anything works or have come across something you haven't seen explained here, get in touch with our community of fellow users and Mambuvians where someone will lend a hand.

Ask a question about our REST APIs

* If you don't already have an account you will be prompted to create one when you first visit the site.

Was this article helpful?