Developer Center

Attachments API

Last Updated: Oct 04, 2018 08:42AM CEST




Allows you to get, post or delete attachments.


GET Attachments

Allows retrieving a list of documents descriptions based on the owner id/key or allows retrieving the content of a document encoded with base64 based on the document id/key. The list of document descriptions can be paginated

Usage examples

//get documents for client with id 1
GET /api/clients/1/documents?offset=0&limit=5

//get paginated  documents for client with id 1
GET /api/clients/1/documents

//get documents for client with encoded key 8a13732d44cd56800144cf0311550077 
GET /api/clients/8a13732d44cd56800144cf0311550077/documents

//get documents for group with id 2
GET /api/groups/2/documents

//get documents for a loan account with id 3
GET /api/loans/3/documents

//get documents for a savings account with id 2344
GET /api/savings/2344/documents

//get documents for a loan product with id LDP
GET /api/loanProducts/LDP/documents

//get documents for a savings product with id SDP
GET /api/savingsProducts/SDP/documents

//get documents for branch with id b123
GET /api/branches/b123/documents

//get documents for centre with id c123
GET /api/centres/c123/documents

//get documents for user with username demo
GET /api/users/demo/documents

//get document content encoded in base64 for document with id 10
GET /api/documents/10

//get document content encoded in base64 for document with encoded key 8a13732d44bde36e0144bfc1e74100a9 
GET /api/documents/8a13732d44bde36e0144bfc1e74100a9

Samples responses:

//response containing the list of documents for a client
    "userName":"Max Power"
    "userName":"Max Power"

//response containing the document content encoded in base64
Note: Mambu returns tne content of the attachment as a Base64 string with quotes. In order to decode in pieces, these quotes would need to stripped first. 

POST Attachments

Allow for POST attachments to a client or account. The request should include a JSON encoding of the data being pushed which includes within it the documentHolderType and documentHolderKey (eg CLIENT) as well as the base64 encoded document body.


documentHolderKey The attachment holder encoded key. Required
documentHolderType The attachment holder type. Required. Possible values:
  • USER
name The attachment file name(maximum 256 characters). Maximum one extension must be provided in the name(could be none). If the extension is provided it must match with the one provided in the type parameter.Required.
Some special characters are not allowed in the filename, these are:
/ < > | : & ? * [ ] # \ " '
type The attachment file extension type(example doc). Required.
Allowed extensions:
documentContent Base64 encoded document body(maximum 15 MB size). Required

Usage examples

//POST a document with the file name "client_information" for a client with encoded key 40288a0c3e3cfb4e013e3d00bb9c00df
    " documentContent":"[base64encodedString]"

//POST a image with the file name "john_photo" for a USER with encoded key 40288a0c3e3cfb4e013e3d00bbzxcvs
    " documentContent":"[base64encodedString]"

Samples responses:

//response for posting a document for a CLIENT that also includes a generated document id and encoded key

DELETE attachments

Allows the deletion of attachments based attachment id/encoded key

Usage example

//delete attachment with id 1
DELETE /api/documents/1

//delete attachment with encoded key 8aa0f78f444f763601444f7fb89e0001
DELETE /api/documents/8aa0f78f444f763601444f7fb89e0001


A success return code will be returned when the deletion is successful.
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found