REST APIs Overview
  • Updated on 22 Nov 2019
  • 1 minute to read
  • Print
  • Share
  • Dark
    Light

REST APIs Overview

  • Print
  • Share
  • Dark
    Light

Being RESTful

The Mambu API follows the Representational state transfer (REST) standard allowing resources (accounts, client, etc) to be standard with a standard set of GET, POST, PUT, DELETE, PATCH HTTP requests.
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/


Posting Data

API requests that post data can either use url-encoding or json 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

The following two example shows the two methods for posting data. Note that for some requests, much more information can be posted using the json input that is available with url-encoding but all url-encoded requests are supported with their json equivalents.

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?