diff --git a/APIFolder/api.htm b/APIFolder/api.htm index 361084388..3e488808c 100644 --- a/APIFolder/api.htm +++ b/APIFolder/api.htm @@ -65,7 +65,7 @@ is there a retrieve waive and an Adjust Waiver as well? - +
@@ -128,20 +128,13 @@

User Accounts

Users

@@ -418,232 +411,131 @@
- - + + + +  

Offices

-

Offices are used to model an MFIs structure. A hierarchial representation of offices is supported. - There will always be at least one office (which represents the MFI or an MFIs head office). - All subsequent offices added must have a parent office.

+

The Office and Branch hierarchy. +

- + +
+
+
Attributes
+
+
+ id +
+
+ string jpw ipsum as an example of showing the (at least important) columns +
+
+ amount +
+
blah +
+
blah
+
+ card +
+
+
+
+  
-

List Offices

+

List Offices (and Branches)

Example Request: - https://localhost:8443/mifosng-provider/api/v1/offices + http://localhost:8080/mifosng-provider/api/v1/offices

GET https://thedomainname/api/v1/offices - -{ - "offices": [ - { - "id": 1, - "name": "Demo MFI Head Office", - "externalId": "1", - "openingDate": "2009-01-01", - "hierarchy": ".", - "parentName": null, - "parentId": 0, - "allowedParents": [] - }, - { - "id": 2, - "name": "sub branch 1", - "externalId": "2", - "openingDate": "2012-01-02", - "hierarchy": ".2.", - "parentName": "Demo MFI Head Office", - "parentId": 1, - "allowedParents": [] - }, - { - "id": 3, - "name": "sub branch 2", - "externalId": "3", - "openingDate": "2012-03-01", - "hierarchy": ".3.", - "parentName": "Demo MFI Head Office", - "parentId": 1, - "allowedParents": [] - } - ] -} - + to be done +
- + +  

Retrieve Office Details Template

-

Returns a template that contains the office fields and allowed value lists. This is a convienence when building user intereface screens for client applications. +

Returns a template that contains the office fields and allowed value lists. This helps build a maintenance User Interface.

Example Request: - - https://localhost:8443/mifosng-provider/api/v1/offices/template - + http://localhost:8080/mifosng-provider/api/v1/offices/template

GET https://thedomainname/api/v1/offices/template - -{ - "id": null, - "name": null, - "externalId": null, - "openingDate": "2012-05-21", - "hierarchy": null, - "parentName": null, - "parentId": null, - "allowedParents": [ - { - "id": 1, - "name": "Demo MFI Head Office", - "externalId": "1", - "openingDate": "2009-01-01", - "hierarchy": ".", - "parentName": null, - "parentId": 0, - "allowedParents": [] - }, - { - "id": 2, - "name": "sub branch 1", - "externalId": "2", - "openingDate": "2012-01-02", - "hierarchy": ".2.", - "parentName": "Demo MFI Head Office", - "parentId": 1, - "allowedParents": [] - }, - { - "id": 3, - "name": "sub branch 2", - "externalId": "3", - "openingDate": "2012-03-01", - "hierarchy": ".3.", - "parentName": "Demo MFI Head Office", - "parentId": 1, - "allowedParents": [] - }, - { - "id": 4, - "name": "sub branch 3", - "externalId": null, - "openingDate": "2012-04-17", - "hierarchy": ".4.", - "parentName": "Demo MFI Head Office", - "parentId": 1, - "allowedParents": [] - } - ] -} - + to be done +
- + +  
-

Retrieve Office

-

Returns an office details if it exists.

+

Retrieve an Office

+

Returns office fields. It also returns allowed value lists which help build a maintenance User Interface. +

Example Request: - - https://localhost:8443/mifosng-provider/api/v1/offices/1 - + http://localhost:8080/mifosng-provider/api/v1/offices/1

- GET https://thedomainname/api/v1/offices/1 - -{ - "id": 1, - "name": "Demo MFI Head Office", - "externalId": "1", - "openingDate": "2009-01-01", - "hierarchy": ".", - "parentName": null, - "parentId": 0, - "allowedParents": [] -} - + GET https://thedomainname/api/v1/loanproducts/{officeId} + +
- + +  
-

Create Office

-

Create an office.

-

Example Request: - - https://localhost:8443/mifosng-provider/api/v1/offices - -

+

Create an Office

- POST https://thedomainname/api/v1/offices -POST https://localhost:8443/mifosng-provider/api/v1/offices -Content-Type: application/json -Request Body: -{ - "name": "Demo branch 9", - "externalId": "9", - "dateFormat": "dd MMMM yyyy", - "openingDateFormatted": "01 September 2011", - "parentId": 1 -} - - -{ - "entityId": 9 -} - + POST https://thedomainname/api/v1/office + http://localhost:8080/mifosng-provider/api/v1/office + + + Content-Type: application/json + Request Body: + new json here + + { "entityId": 2 } +
-  
-

Update Office

-

Update office details.

-

Example Request: - - https://localhost:8443/mifosng-provider/api/v1/offices/1 - -

+

Update an Office

- PUT https://thedomainname/api/v1/offices/1 -PUT https://localhost:8443/mifosng-provider/api/v1/offices/1 -Content-Type: application/json -Request Body: -{ - "name": "Demo branch 9 changed", - "externalId": "11", - "dateFormat": "dd MMMM yyyy", - "openingDateFormatted": "05 September 2011", - "parentId": 1 -} - - -{ - "entityId": 9 -} - + PUT https://thedomainname/api/v1/office/{officeId} + http://localhost:8080/mifosng-provider/api/v1/office/1 + + + Content-Type: application/json + Request Body: + new json here + + { "entityId": 2 } +
-
- + - -  
@@ -652,13 +544,57 @@ Request Body:

+ +
+
+
Attributes
+
+
+ id +
+
+ string jpw ipsum as an example of showing the (at least important) columns +
+
+ amount +
+
positive integer or zero +
+
Amount charged in cents
+
+ card +
+
+
hash
+
+ Hash describing the card used to make the charge +
+ +
+ inner object +
+
inner string inner span extra +
+
+
+
+ fingerprint +
+
string or something +
+
+
+
+ + +  

List Loan Products

Example Request: - https://localhost:8443/mifosng-provider/api/v1/loanproducts + http://localhost:8080/mifosng-provider/api/v1/loanproducts

@@ -711,6 +647,53 @@ Request Body: "interestFrequencyOptions": [], "interestRebateAllowed": false, "flexible": false + }, + { + "id": 2, + "name": "curr loan", + "description": "asdff", + "principalMoney": { + "currencyCode": "ETB", + "currencyDigitsAfterDecimal": 2, + "amount": 100000, + "defaultName": "Ethiopian Birr", + "nameCode": "currency.ETB", + "displaySymbol": null, + "zero": false, + "greaterThanZero": true, + "displaySymbolValue": "100000.00 null" + }, + "interestRatePerPeriod": 0, + "interestRatePeriod": 2, + "annualInterestRate": 0, + "interestMethod": 0, + "interestRateCalculatedInPeriod": 0, + "numberOfInterestFreePeriods": 0, + "repaidEvery": 1, + "repaymentPeriodFrequency": 2, + "numberOfRepayments": 5, + "amortizationMethod": 1, + "inArrearsTolerance": { + "currencyCode": "ETB", + "currencyDigitsAfterDecimal": 2, + "amount": 0, + "defaultName": "Ethiopian Birr", + "nameCode": "currency.ETB", + "displaySymbol": null, + "zero": true, + "greaterThanZero": false, + "displaySymbolValue": "0.00 null" + }, + "createdOn": "2012-04-15T00:00:00.000+10:00", + "lastModifedOn": "2012-04-15T00:00:00.000+10:00", + "possibleCurrencies": [], + "possibleAmortizationOptions": [], + "possibleInterestOptions": [], + "possibleInterestRateCalculatedInPeriodOptions": [], + "repaymentFrequencyOptions": [], + "interestFrequencyOptions": [], + "interestRebateAllowed": false, + "flexible": false } ] } @@ -718,6 +701,7 @@ Request Body:
+  
@@ -725,7 +709,7 @@ Request Body:

Returns a template that contains the loan product fields and allowed value lists. This helps build a maintenance User Interface.

Example Request: - https://localhost:8443/mifosng-provider/api/v1/loanproducts/template + http://localhost:8080/mifosng-provider/api/v1/loanproducts/template

@@ -847,6 +831,7 @@ Request Body:
+  
@@ -855,7 +840,7 @@ Request Body: JPW - includes validation values (might be ok or option), enum?

Example Request: - https://localhost:8443/mifosng-provider/api/v1/loanproducts/1 + http://localhost:8080/mifosng-provider/api/v1/loanproducts/1

@@ -976,7 +961,8 @@ Request Body:
- + +  
@@ -984,29 +970,17 @@ Request Body:
POST https://thedomainname/api/v1/loanproducts -https://localhost:8443/mifosng-provider/api/v1/loanproducts -Content-Type: application/json -Request Body: -{ - "name": "New kind of Loan", - "description": "A description not exceeding 500 characters.", - "currencyCode": "XOF", - "digitsAfterDecimal": 0, - "principal": 100000, - "inArrearsToleranceAmount": 1000, - "numberOfRepayments": 1, - "repaymentEvery": 1, - "repaymentFrequency": 2, - "amortizationMethod": 1, - "interestRatePerPeriod": 1.75, - "interestRateFrequencyMethod": 2, - "interestCalculationPeriodMethod": 1, - "interestMethod": 0 -} - + http://localhost:8080/mifosng-provider/api/v1/loanproducts + + + Content-Type: application/json + Request Body: + new loan product json here +
+  
@@ -1014,163 +988,18 @@ Request Body:
POST https://thedomainname/api/v1/loanproducts/{loanId} -https://localhost:8443/mifosng-provider/api/v1/loanproducts/1 -Content-Type: application/json -Request Body: -{ - "name": "New kind of Loan updated", - "description": "An updated description not exceeding 500 characters.", - "currencyCode": "XOF", - "digitsAfterDecimal": 0, - "principal": 100000, - "inArrearsToleranceAmount": 1000, - "numberOfRepayments": 1, - "repaymentEvery": 1, - "repaymentFrequency": 2, - "amortizationMethod": 1, - "interestRatePerPeriod": 1.75, - "interestRateFrequencyMethod": 2, - "interestCalculationPeriodMethod": 1, - "interestMethod": 0 -} - + http://localhost:8080/mifosng-provider/api/v1/loanproducts/1 + + + Content-Type: application/json + Request Body: + update loan product json here +
- - -   -
-
-

Configuration

-

Application related configuration like being able to select what currencies are permitted for use within the MFI.

-
-
- -   -
-
-

Retrieve currency configuration settings

-

Returns the list of selectedCurrencies that are allowed within the MFI and the list of currencies that are currently not selected.

-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/configurations/currency -

-
-
- GET https://thedomainname/api/v1/configurations/currency - -{ - "selectedCurrencyOptions": [ - { - "code": "KES", - "name": "Kenyan Shilling", - "decimalPlaces": 2, - "displaySymbol": "KSh", - "nameCode": "currency.KES", - "displayLabel": "Kenyan Shilling (KSh)" - }, - { - "code": "BND", - "name": "Brunei Dollar", - "decimalPlaces": 2, - "displaySymbol": "BND", - "nameCode": "currency.BND", - "displayLabel": "Brunei Dollar (BND)" - }, - { - "code": "LBP", - "name": "Lebanese Pound", - "decimalPlaces": 2, - "displaySymbol": "L£", - "nameCode": "currency.LBP", - "displayLabel": "Lebanese Pound (L£)" - }, - { - "code": "GHC", - "name": "Ghana Cedi", - "decimalPlaces": 2, - "displaySymbol": "GHC", - "nameCode": "currency.GHC", - "displayLabel": "Ghana Cedi (GHC)" - }, - { - "code": "USD", - "name": "US Dollar", - "decimalPlaces": 2, - "displaySymbol": "$", - "nameCode": "currency.USD", - "displayLabel": "US Dollar ($)" - }, - { - "code": "XOF", - "name": "CFA Franc BCEAO", - "decimalPlaces": 0, - "displaySymbol": "CFA", - "nameCode": "currency.XOF", - "displayLabel": "CFA Franc BCEAO (CFA)" - } - ], - "currencyOptions": [ - { - "code": "AED", - "name": "UAE Dirham", - "decimalPlaces": 2, - "displaySymbol": null, - "nameCode": "currency.AED", - "displayLabel": "UAE Dirham [AED]" - }, - { - "code": "AFN", - "name": "Afghanistan Afghani", - "decimalPlaces": 2, - "displaySymbol": null, - "nameCode": "currency.AFN", - "displayLabel": "Afghanistan Afghani [AFN]" - }, - ... - ... - { - "code": "ZMK", - "name": "Zambian Kwacha", - "decimalPlaces": 2, - "displaySymbol": null, - "nameCode": "currency.ZMK", - "displayLabel": "Zambian Kwacha [ZMK]" - }, - { - "code": "ZWD", - "name": "Zimbabwe Dollar", - "decimalPlaces": 2, - "displaySymbol": null, - "nameCode": "currency.ZWD", - "displayLabel": "Zimbabwe Dollar [ZWD]" - } - ] -} - -
-
- -   -
-
-

Update currency configuration settings

-

Update list of selectedCurrencies that are allowed within the MFI and the list of currencies that are currently not selected.

-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/configurations/currency -

-
-
- PUT https://thedomainname/api/v1/configurations/currency - -{ -"selectedItems": ["USD", "GBP"] -} - -
-
- - + +  
@@ -1394,6 +1223,12 @@ Request Body:
+ + + + + +  
@@ -1411,7 +1246,9 @@ Request Body:

- + + +  
@@ -1580,471 +1417,8 @@ Request Body:
- -   -
-
-

Authentication

-

An API capability to allowed client applications verify authentication details.

-
-
-   -
-
-

Verify authentication

-

Verifies that the credentials provided successfully authenticate and returns the set of permissions allowed by that user.

-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/authentication?username=super1&password=demo -

-
-
- POST https://thedomainname/api/v1/authentication?username=super1&password=demo -POST https://localhost:8443/mifosng-provider/api/v1/authentication?username=super1&password=demo -Content-Type: application/xml - - - -
-
- -   -
-
-

User account details

-

An API capability to allowed client applications expose functionality for users to update their account details and password.

-
-
- -   -
-
-

Retrieve current users account details

-

Will return user account details.

-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/useraccounts/current -

-
-
- GET https://thedomainname/api/v1/useraccounts/current -GET https://localhost:8443/mifosng-provider/api/v1/useraccounts/current - -{ - "id": 1, - "orgId": 1, - "officeId": 1, - "officeName": "Demo MFI Head Office", - "username": "mifos", - "firstname": "App hello", - "lastname": "Administrator", - "email": "demomfi@mifos.org", - "allowedOffices": [ - { - "id": 1, - "name": "Demo MFI Head Office", - "externalId": "1", - "openingDate": "2009-01-01", - "hierarchy": ".", - "parentName": null, - "parentId": 0, - "allowedParents": [] - }, - { - "id": 2, - "name": "sub branch 1", - "externalId": "2", - "openingDate": "2012-01-02", - "hierarchy": ".2.", - "parentName": "Demo MFI Head Office", - "parentId": 1, - "allowedParents": [] - } - ], - "availableRoles": [ - { - "id": 2, - "orgId": 1, - "name": "Field officer", - "description": "A field officer role allows the user to add client and loans and view reports but nothing else.", - "availablePermissions": [], - "selectedPermissions": [] - }, - { - "id": 3, - "orgId": 1, - "name": "Data Entry (Portfolio only)", - "description": "This role allows a user full permissions around client and loan functionality but nothing else.", - "availablePermissions": [], - "selectedPermissions": [] - }, - { - "id": 4, - "orgId": 1, - "name": "Credit Committe Member", - "description": "This role allows a user to approve reject or withdraw loans (with reporting).", - "availablePermissions": [], - "selectedPermissions": [] - }, - { - "id": 5, - "orgId": 1, - "name": "Manager", - "description": "This role allows a manager to do anything related to portfolio management and also view all reports.", - "availablePermissions": [], - "selectedPermissions": [] - } - ], - "selectedRoles": [ - { - "id": 1, - "orgId": 1, - "name": "Super user", - "description": "This role provides all application permissions.", - "availablePermissions": [], - "selectedPermissions": [ - { - "id": 1, - "orgId": 1, - "name": "User administration ALL", - "description": "An application user will have permission to execute all tasks related to user administration.", - "code": "USER_ADMINISTRATION_SUPER_USER_ROLE", - "groupType": 1 - }, - { - "id": 4, - "orgId": 1, - "name": "Reporting ALL", - "description": "An application user will have permission to execute and view all reports.", - "code": "REPORTING_SUPER_USER_ROLE", - "groupType": 4 - }, - { - "id": 3, - "orgId": 1, - "name": "Portfolio management ALL", - "description": "An application user will have permission to execute all tasks related to portfolio management.", - "code": "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE", - "groupType": 3 - }, - { - "id": 2, - "orgId": 1, - "name": "Organisation adminsitration ALL", - "description": "An application user will have permission to execute all tasks related to organisation administration.", - "code": "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE", - "groupType": 2 - } - ] - } - ] -} - -
-
- -   -
-
-

Update current users account details

-

Will update user account details.

-
-
- PUT https://thedomainname/api/v1/useraccounts/current -PUT https://localhost:8443/mifosng-provider/api/v1/useraccounts/current -Content-Type: application/json -Request body: -{ - "officeId": 1, - "username": "mifos", - "firstname": "App hello", - "lastname": "Administrator", - "email": "demomfi@mifos.org", - "selectedItems": ["1"] -} - - -{ - "entityId": 1 -} - -
-
- - -   -
-
-

Retrieve change password template details

-

Will details for change of password screen.

-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/useraccounts/current/password/template -

-
-
- GET https://thedomainname/api/v1/useraccounts/current/password/template -GET https://localhost:8443/mifosng-provider/api/v1/useraccounts/current/password/template - -{ - "password": null, - "passwordrepeat": null -} - -
-
- -   -
-
-

Update current users password

-

Will update users password.

-
-
- PUT https://thedomainname/api/v1/useraccounts/current/password -PUT https://localhost:8443/mifosng-provider/api/v1/useraccounts/current/password -Content-Type: application/json -Request body: -{ - "password": "demo", - "passwordrepeat": "demo" -} - - -{ - "entityId": 1 -} - -
-
- - -   -
-
-

Users

-

An API capability to support user administration.

-
-
- -   -
-
-

Retrieve list of users

-

Returns all users.

-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/users -

-
-
- GET https://thedomainname/api/v1/users -GET https://localhost:8443/mifosng-provider/api/v1/users - -{ - "users": [ - { - "id": 1, - "orgId": 1, - "officeId": 1, - "officeName": "Demo MFI Head Office", - "username": "mifos", - "firstname": "App hello", - "lastname": "Administrator", - "email": "demomfi@mifos.org", - "allowedOffices": [], - "availableRoles": [], - "selectedRoles": [] - }, - { - "id": 2, - "orgId": 1, - "officeId": 1, - "officeName": "Demo MFI Head Office", - "username": "super1", - "firstname": "super", - "lastname": "user", - "email": "fake@email.com", - "allowedOffices": [], - "availableRoles": [], - "selectedRoles": [] - } - ] -} - -
-
- -   -
-
-

Retrieve new user template details

-

Returns details for new user screen

-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/users/template -

-
-
- GET https://thedomainname/api/v1/users/template -GET https://localhost:8443/mifosng-provider/api/v1/users/template - -{ - "id": null, - "orgId": null, - "officeId": null, - "officeName": null, - "username": null, - "firstname": null, - "lastname": null, - "email": null, - "allowedOffices": [ - { - "id": 1, - "name": "Demo MFI Head Office", - "externalId": "1", - "openingDate": "2009-01-01", - "hierarchy": ".", - "parentName": null, - "parentId": 0, - "allowedParents": [] - }, - { - "id": 2, - "name": "sub branch 1", - "externalId": "2", - "openingDate": "2012-01-02", - "hierarchy": ".2.", - "parentName": "Demo MFI Head Office", - "parentId": 1, - "allowedParents": [] - } - ], - "availableRoles": [ - { - "id": 1, - "orgId": 1, - "name": "Super user", - "description": "This role provides all application permissions.", - "availablePermissions": [], - "selectedPermissions": [] - }, - { - "id": 2, - "orgId": 1, - "name": "Field officer", - "description": "A field officer role allows the user to add client and loans and view reports but nothing else.", - "availablePermissions": [], - "selectedPermissions": [] - } - ], - "selectedRoles": [] -} - -
-
- -   -
-
-

Retrieve existing user details

-

Returns details for existing application user

-

Example Request: - https://localhost:8443/mifosng-provider/api/v1/users/1 -

-
-
- GET https://thedomainname/api/v1/users/1 -GET https://localhost:8443/mifosng-provider/api/v1/users/1 - -{ - "id": 1, - "orgId": 1, - "officeId": 1, - "officeName": "Demo MFI Head Office", - "username": "mifos", - "firstname": "App hello", - "lastname": "Administrator", - "email": "demomfi@mifos.org", - "allowedOffices": [ - { - "id": 1, - "name": "Demo MFI Head Office", - "externalId": "1", - "openingDate": "2009-01-01", - "hierarchy": ".", - "parentName": null, - "parentId": 0, - "allowedParents": [] - }, - { - "id": 2, - "name": "sub branch 1", - "externalId": "2", - "openingDate": "2012-01-02", - "hierarchy": ".2.", - "parentName": "Demo MFI Head Office", - "parentId": 1, - "allowedParents": [] - } - ], - "availableRoles": [ - { - "id": 2, - "orgId": 1, - "name": "Field officer", - "description": "A field officer role allows the user to add client and loans and view reports but nothing else.", - "availablePermissions": [], - "selectedPermissions": [] - } - ], - "selectedRoles": [ - { - "id": 1, - "orgId": 1, - "name": "Super user", - "description": "This role provides all application permissions.", - "availablePermissions": [], - "selectedPermissions": [ - { - "id": 1, - "orgId": 1, - "name": "User administration ALL", - "description": "An application user will have permission to execute all tasks related to user administration.", - "code": "USER_ADMINISTRATION_SUPER_USER_ROLE", - "groupType": 1 - }, - { - "id": 4, - "orgId": 1, - "name": "Reporting ALL", - "description": "An application user will have permission to execute and view all reports.", - "code": "REPORTING_SUPER_USER_ROLE", - "groupType": 4 - }, - { - "id": 3, - "orgId": 1, - "name": "Portfolio management ALL", - "description": "An application user will have permission to execute all tasks related to portfolio management.", - "code": "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE", - "groupType": 3 - }, - { - "id": 2, - "orgId": 1, - "name": "Organisation adminsitration ALL", - "description": "An application user will have permission to execute all tasks related to organisation administration.", - "code": "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE", - "groupType": 2 - } - ] - } - ] -} - -
-
- - - diff --git a/APIFolder/apikeith.htm b/APIFolder/apikeith.htm new file mode 100644 index 000000000..361084388 --- /dev/null +++ b/APIFolder/apikeith.htm @@ -0,0 +1,2053 @@ + + + + + + Mifos X API Documentation + + + + +
+
+ +
+

API Navigation

+
+ + + + + + + + + +
+
+
+ + +
+   +
+
+

Mifos X API Documentation

+

+ The Mifox X API is organized around + REST. + Our API is designed to have predictable, resource-oriented + URLs, to use HTTP response codes to indicate API errors, and + to use built-in HTTP features, like HTTP authentication and + HTTP verbs, which can be understood by off-the-shelf HTTP + clients. JSON will be + returned in all responses from the API, including errors. +

+

+ Much of the presentation ideas here have been taken from the very good API reference (https://stripe.com/docs/api) +

+
+ +
+

API Endpoint

+ https://thedomainname/ +
Summary of Resource URL Patterns
+
    +
  • /api/v1/clients
  • +
  • /api/v1/clients/template
  • +
  • /api/v1/clients/{clientId}
  • +
  • /api/v1/clients/{clientId}/loans
  • +
  • /api/v1/clients/{clientId}/notes
  • +
  • /api/v1/clients/{clientId}/notes/{noteId}
  • + +
  • /api/v1/loans
  • +
  • /api/v1/loans/template
  • +
  • /api/v1/loans/{loanId}
  • +
  • /api/v1/loans/{loanId}/undo
  • +
  • /api/v1/loans/{loanId}/transactions/template
  • +
  • /api/v1/loans/{loanId}/transactions
  • +
  • /api/v1/loans/{loanId}/transactions/{repaymentId}
  • + +
  • /api/v1/offices
  • +
  • /api/v1/offices/template
  • +
  • /api/v1/offices/{officeId}
  • + +
  • /api/v1/loanproducts
  • +
  • /api/v1/loanproducts/template
  • +
  • /api/v1/loanproducts/{productId}
  • + +
  • /api/v1/configurations/currency
  • + +
  • /api/v1/additionalfields
  • +
  • /api/v1/additionalfields/{Type}/{Set}/{id}
  • + +
  • /api/v1/reports/{reportName}
  • + +
  • /api/v1/authentication
  • + +
  • /api/v1/useraccounts/current
  • +
  • /api/v1/useraccounts/current/password
  • +
  • /api/v1/useraccounts/current/password/template
  • + +
  • /api/v1/users
  • +
  • /api/v1/users/template
  • +
  • /api/v1/users/{userId}
  • + +
  • /api/v1/roles
  • +
  • /api/v1/roles/template
  • +
  • /api/v1/roles/{roleId}
  • + +
  • /api/v1/permissions
  • +
+
+
+ +   +
+
+

Authentication Overview

+

+ JPW: Keith, this needs to change to whatever is right after authentication has been added. Don't know if you will go with keys or passwords (I assume passwords)... but can you fix it so we have one user or one user per role that doesn't need a password or always has a password of 'password' so we can let ppl do stuff from the browser and/or REST plugins? We can talk about this. +

+

+ STRIPE content: You authenticate to the Mifos X API by providing one of + your API keys in the request. You can manage your API + keys from your + account. + You can have multiple API keys + active at one time. Your API keys carry many + privileges, so be sure to keep them secret! +

+ +

+ Authentication to the API occurs via + + HTTP Basic Auth. Provide your API key as the basic + auth username. You do not need to provide a password. +

+ +

+ All API requests must be made + over HTTPS. + Calls made over plain HTTP will fail. You must + authenticate for all requests. +

+
+
+ curl https://api.stripe.com/api/v1/charges \ + -u vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE: + +

+ JPW: We'll update this after... + curl uses the -u flag to pass basic auth + credentials (adding a colon after your API key will prevent + it from asking you for a password). + + A sample test API key has been provided in all + the examples on the page, so you can test out any example right away. + +

+
+
+ +   +
+
+

Errors

+

JPW:Need to update this + Stripe uses conventional HTTP response codes to indicate + success or failure of an API request. In general, + codes in the 2xx range indicate success, codes in the + 4xx range indicate an error that resulted from the + provided information (e.g. a required parameter was + missing, a charge failed, etc.), and codes in the 5xx + range indicate an error with Stripe's servers. +

+ +

+ Not all errors map cleanly onto HTTP response codes, + however. When a request is valid but does not complete + successfully (e.g. a card is declined), we return a 402 + error code. +

+ + +

+ All errors return JSON with a type (one of card_error, invalid_request_error, + or api_error) and message describing the particular problem. +

+ +
Attributes
+
+
type
+
+
The type of error returned (card_error, invalid_request_error, api_error) + Card errors are the most common type of error you should expect to handle. + They result when the user enters a card that can't be charged for some reason. + Invalid request errors arise when your request has invalid parameters. API + errors cover any other type of problem (e.g. a temporary problem with Stripe's servers) + and should turn up only very infrequently.
+ +
message
+
+
A user-friendly message describing the error
+ +
code
+
optional
+
For card errors, additional information + about the user-friendly message to display for this error (e.g. "Your + card was declined.")
+ +
param
+
optional
+
The parameter the error relates to if the + error is parameter-specific. You can use this to display a message near + the correct form field, for example.
+
+
+
+
HTTP Status Code Summary
+
    +
  • 200 OK - Everything worked as expected.
  • +
  • 400 Bad Request - Often missing a required parameter.
  • +
  • 401 Unauthorized - No valid API key provided.
  • +
  • 402 Request Failed - Parameters were valid but request failed.
  • +
  • 404 Not Found - The requested item doesn't exist.
  • +
  • 500, 502, 503, 504 Server errors - something went wrong on Stripe's end.
  • +
+
+ +
+
Errors
+ Invalid Request Errors + Type: invalid_request_error + + API Errors + Type: api_error + + Card Errors + Type: card_error + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeDetails
invalid_numberThe card number is invalid
incorrect_numberThe card number is incorrect
invalid_expiry_monthThe card's expiration month is invalid
invalid_expiry_yearThe card's expiration year is invalid
invalid_cvcThe card's security code is invalid
expired_cardThe card has expired
invalid_amountAn invalid amount was entered
incorrect_cvcThe card's security code is incorrect
card_declinedThe card was declined.
missingThere is no card on a customer that is being charged.
duplicate_transactionA transaction with identical amount and credit card information was submitted very recently.
processing_errorAn error occurred while processing the card.
+
+
+ + +   +
+
+

Offices

+

Offices are used to model an MFIs structure. A hierarchial representation of offices is supported. + There will always be at least one office (which represents the MFI or an MFIs head office). + All subsequent offices added must have a parent office.

+
+
+ +   +
+
+

List Offices

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/offices +

+
+
+ GET https://thedomainname/api/v1/offices + +{ + "offices": [ + { + "id": 1, + "name": "Demo MFI Head Office", + "externalId": "1", + "openingDate": "2009-01-01", + "hierarchy": ".", + "parentName": null, + "parentId": 0, + "allowedParents": [] + }, + { + "id": 2, + "name": "sub branch 1", + "externalId": "2", + "openingDate": "2012-01-02", + "hierarchy": ".2.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + }, + { + "id": 3, + "name": "sub branch 2", + "externalId": "3", + "openingDate": "2012-03-01", + "hierarchy": ".3.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + } + ] +} + +
+
+ +   +
+
+

Retrieve Office Details Template

+

Returns a template that contains the office fields and allowed value lists. This is a convienence when building user intereface screens for client applications. +

+

Example Request: + + https://localhost:8443/mifosng-provider/api/v1/offices/template + +

+
+
+ GET https://thedomainname/api/v1/offices/template + +{ + "id": null, + "name": null, + "externalId": null, + "openingDate": "2012-05-21", + "hierarchy": null, + "parentName": null, + "parentId": null, + "allowedParents": [ + { + "id": 1, + "name": "Demo MFI Head Office", + "externalId": "1", + "openingDate": "2009-01-01", + "hierarchy": ".", + "parentName": null, + "parentId": 0, + "allowedParents": [] + }, + { + "id": 2, + "name": "sub branch 1", + "externalId": "2", + "openingDate": "2012-01-02", + "hierarchy": ".2.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + }, + { + "id": 3, + "name": "sub branch 2", + "externalId": "3", + "openingDate": "2012-03-01", + "hierarchy": ".3.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + }, + { + "id": 4, + "name": "sub branch 3", + "externalId": null, + "openingDate": "2012-04-17", + "hierarchy": ".4.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + } + ] +} + +
+
+ +   +
+
+

Retrieve Office

+

Returns an office details if it exists.

+

Example Request: + + https://localhost:8443/mifosng-provider/api/v1/offices/1 + +

+
+
+ GET https://thedomainname/api/v1/offices/1 + +{ + "id": 1, + "name": "Demo MFI Head Office", + "externalId": "1", + "openingDate": "2009-01-01", + "hierarchy": ".", + "parentName": null, + "parentId": 0, + "allowedParents": [] +} + +
+
+ +   +
+
+

Create Office

+

Create an office.

+

Example Request: + + https://localhost:8443/mifosng-provider/api/v1/offices + +

+
+
+ POST https://thedomainname/api/v1/offices +POST https://localhost:8443/mifosng-provider/api/v1/offices +Content-Type: application/json +Request Body: +{ + "name": "Demo branch 9", + "externalId": "9", + "dateFormat": "dd MMMM yyyy", + "openingDateFormatted": "01 September 2011", + "parentId": 1 +} + + +{ + "entityId": 9 +} + +
+
+ +   +
+
+

Update Office

+

Update office details.

+

Example Request: + + https://localhost:8443/mifosng-provider/api/v1/offices/1 + +

+
+
+ PUT https://thedomainname/api/v1/offices/1 +PUT https://localhost:8443/mifosng-provider/api/v1/offices/1 +Content-Type: application/json +Request Body: +{ + "name": "Demo branch 9 changed", + "externalId": "11", + "dateFormat": "dd MMMM yyyy", + "openingDateFormatted": "05 September 2011", + "parentId": 1 +} + + +{ + "entityId": 9 +} + +
+
+ + + + +   +
+
+

Loan Products

+

A Loan product is a template that is used when creating a loan. Much of the template definition can be changed during loan creation. +

+
+
+ +   +
+
+

List Loan Products

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/loanproducts +

+
+
+ GET https://thedomainname/api/v1/loanproducts + { + "products": [ + { + "id": 1, + "name": "Agricultural Loan", + "description": "An agricultural loan given to farmers to help buy crop, stock and machinery. With an arrears tolerance setting of 1,000 CFA, loans are not marked as 'in arrears' or 'in bad standing' if the amount outstanding is less than this. Interest rate is described using monthly percentage rate (MPR) even though the loan typically lasts a year and requires one repayment (typically at time when farmer sells crop)", + "principalMoney": { + "currencyCode": "XOF", + "currencyDigitsAfterDecimal": 0, + "amount": 100000, + "defaultName": "CFA Franc BCEAO", + "nameCode": "currency.XOF", + "displaySymbol": "CFA", + "zero": false, + "greaterThanZero": true, + "displaySymbolValue": "100000 CFA" + }, + "interestRatePerPeriod": 1.75, + "interestRatePeriod": 2, + "annualInterestRate": 21, + "interestMethod": 0, + "interestRateCalculatedInPeriod": 0, + "numberOfInterestFreePeriods": 0, + "repaidEvery": 12, + "repaymentPeriodFrequency": 2, + "numberOfRepayments": 1, + "amortizationMethod": 1, + "inArrearsTolerance": { + "currencyCode": "XOF", + "currencyDigitsAfterDecimal": 0, + "amount": 1000, + "defaultName": "CFA Franc BCEAO", + "nameCode": "currency.XOF", + "displaySymbol": "CFA", + "zero": false, + "greaterThanZero": true, + "displaySymbolValue": "1000 CFA" + }, + "createdOn": "2012-04-12T00:00:00.000+10:00", + "lastModifedOn": "2012-04-12T00:00:00.000+10:00", + "possibleCurrencies": [], + "possibleAmortizationOptions": [], + "possibleInterestOptions": [], + "possibleInterestRateCalculatedInPeriodOptions": [], + "repaymentFrequencyOptions": [], + "interestFrequencyOptions": [], + "interestRebateAllowed": false, + "flexible": false + } + ] + } + +
+
+ +   +
+
+

Retrieve Loan Product Details Template

+

Returns a template that contains the loan product fields and allowed value lists. This helps build a maintenance User Interface. +

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/loanproducts/template +

+
+
+ GET https://thedomainname/api/v1/loanproducts/template + { + "id": null, + "name": null, + "description": null, + "principalMoney": { + "currencyCode": "XOF", + "currencyDigitsAfterDecimal": 0, + "amount": 0, + "defaultName": "CFA Franc BCEAO", + "nameCode": "currency.XOF", + "displaySymbol": "CFA", + "zero": true, + "greaterThanZero": false, + "displaySymbolValue": "0 CFA" + }, + "interestRatePerPeriod": 0, + "interestRatePeriod": 2, + "annualInterestRate": 0, + "interestMethod": 0, + "interestRateCalculatedInPeriod": 1, + "numberOfInterestFreePeriods": 0, + "repaidEvery": 1, + "repaymentPeriodFrequency": 2, + "numberOfRepayments": 0, + "amortizationMethod": 1, + "inArrearsTolerance": { + "currencyCode": "XOF", + "currencyDigitsAfterDecimal": 0, + "amount": 0, + "defaultName": "CFA Franc BCEAO", + "nameCode": "currency.XOF", + "displaySymbol": "CFA", + "zero": true, + "greaterThanZero": false, + "displaySymbolValue": "0 CFA" + }, + "createdOn": null, + "lastModifedOn": null, + "possibleCurrencies": [ + { + "code": "XOF", + "name": "CFA Franc BCEAO", + "decimalPlaces": 0, + "displaySymbol": "CFA", + "nameCode": "currency.XOF", + "displayLabel": "CFA Franc BCEAO (CFA)" + }, + { + "code": "ETB", + "name": "Ethiopian Birr", + "decimalPlaces": 2, + "displaySymbol": null, + "nameCode": "currency.ETB", + "displayLabel": "Ethiopian Birr [ETB]" + } + ], + "possibleAmortizationOptions": [ + { + "id": 1, + "value": "Equal installments" + }, + { + "id": 0, + "value": "Equal principle payments" + } + ], + "possibleInterestOptions": [ + { + "id": 0, + "value": "Declining Balance" + }, + { + "id": 1, + "value": "Flat" + } + ], + "possibleInterestRateCalculatedInPeriodOptions": [ + { + "id": 0, + "value": "Daily" + }, + { + "id": 1, + "value": "Same as repayment period" + } + ], + "repaymentFrequencyOptions": [ + { + "id": 0, + "value": "Days" + }, + { + "id": 1, + "value": "Weeks" + }, + { + "id": 2, + "value": "Months" + } + ], + "interestFrequencyOptions": [ + { + "id": 2, + "value": "Per month" + }, + { + "id": 3, + "value": "Per year" + } + ], + "interestRebateAllowed": false, + "flexible": false + } + +
+
+ +   +
+
+

Retrieve a Loan Product

+

Returns loan product fields. It also returns allowed value lists which help build a maintenance User Interface. + JPW - includes validation values (might be ok or option), enum? +

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/loanproducts/1 +

+
+
+ GET https://thedomainname/api/v1/loanproducts/{productId} + { + "id": 1, + "name": "Agricultural Loan", + "description": "An agricultural loan given to farmers to help buy crop, stock and machinery. With an arrears tolerance setting of 1,000 CFA, loans are not marked as 'in arrears' or 'in bad standing' if the amount outstanding is less than this. Interest rate is described using monthly percentage rate (MPR) even though the loan typically lasts a year and requires one repayment (typically at time when farmer sells crop)", + "principalMoney": { + "currencyCode": "XOF", + "currencyDigitsAfterDecimal": 0, + "amount": 100000, + "defaultName": "CFA Franc BCEAO", + "nameCode": "currency.XOF", + "displaySymbol": "CFA", + "zero": false, + "greaterThanZero": true, + "displaySymbolValue": "100000 CFA" + }, + "interestRatePerPeriod": 1.75, + "interestRatePeriod": 2, + "annualInterestRate": 21, + "interestMethod": 0, + "interestRateCalculatedInPeriod": 0, + "numberOfInterestFreePeriods": 0, + "repaidEvery": 12, + "repaymentPeriodFrequency": 2, + "numberOfRepayments": 1, + "amortizationMethod": 1, + "inArrearsTolerance": { + "currencyCode": "XOF", + "currencyDigitsAfterDecimal": 0, + "amount": 1000, + "defaultName": "CFA Franc BCEAO", + "nameCode": "currency.XOF", + "displaySymbol": "CFA", + "zero": false, + "greaterThanZero": true, + "displaySymbolValue": "1000 CFA" + }, + "createdOn": "2012-04-12T00:00:00.000+10:00", + "lastModifedOn": "2012-04-12T00:00:00.000+10:00", + "possibleCurrencies": [ + { + "code": "XOF", + "name": "CFA Franc BCEAO", + "decimalPlaces": 0, + "displaySymbol": "CFA", + "nameCode": "currency.XOF", + "displayLabel": "CFA Franc BCEAO (CFA)" + }, + { + "code": "ETB", + "name": "Ethiopian Birr", + "decimalPlaces": 2, + "displaySymbol": null, + "nameCode": "currency.ETB", + "displayLabel": "Ethiopian Birr [ETB]" + } + ], + "possibleAmortizationOptions": [ + { + "id": 1, + "value": "Equal installments" + }, + { + "id": 0, + "value": "Equal principle payments" + } + ], + "possibleInterestOptions": [ + { + "id": 0, + "value": "Declining Balance" + }, + { + "id": 1, + "value": "Flat" + } + ], + "possibleInterestRateCalculatedInPeriodOptions": [ + { + "id": 0, + "value": "Daily" + }, + { + "id": 1, + "value": "Same as repayment period" + } + ], + "repaymentFrequencyOptions": [ + { + "id": 0, + "value": "Days" + }, + { + "id": 1, + "value": "Weeks" + }, + { + "id": 2, + "value": "Months" + } + ], + "interestFrequencyOptions": [ + { + "id": 2, + "value": "Per month" + }, + { + "id": 3, + "value": "Per year" + } + ], + "interestRebateAllowed": false, + "flexible": false + } + +
+
+ +   +
+
+

Create a Loan Product

+
+
+ POST https://thedomainname/api/v1/loanproducts +https://localhost:8443/mifosng-provider/api/v1/loanproducts +Content-Type: application/json +Request Body: +{ + "name": "New kind of Loan", + "description": "A description not exceeding 500 characters.", + "currencyCode": "XOF", + "digitsAfterDecimal": 0, + "principal": 100000, + "inArrearsToleranceAmount": 1000, + "numberOfRepayments": 1, + "repaymentEvery": 1, + "repaymentFrequency": 2, + "amortizationMethod": 1, + "interestRatePerPeriod": 1.75, + "interestRateFrequencyMethod": 2, + "interestCalculationPeriodMethod": 1, + "interestMethod": 0 +} + +
+
+ +   +
+
+

Update a Loan Product

+
+
+ POST https://thedomainname/api/v1/loanproducts/{loanId} +https://localhost:8443/mifosng-provider/api/v1/loanproducts/1 +Content-Type: application/json +Request Body: +{ + "name": "New kind of Loan updated", + "description": "An updated description not exceeding 500 characters.", + "currencyCode": "XOF", + "digitsAfterDecimal": 0, + "principal": 100000, + "inArrearsToleranceAmount": 1000, + "numberOfRepayments": 1, + "repaymentEvery": 1, + "repaymentFrequency": 2, + "amortizationMethod": 1, + "interestRatePerPeriod": 1.75, + "interestRateFrequencyMethod": 2, + "interestCalculationPeriodMethod": 1, + "interestMethod": 0 +} + +
+
+ + + +   +
+
+

Configuration

+

Application related configuration like being able to select what currencies are permitted for use within the MFI.

+
+
+ +   +
+
+

Retrieve currency configuration settings

+

Returns the list of selectedCurrencies that are allowed within the MFI and the list of currencies that are currently not selected.

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/configurations/currency +

+
+
+ GET https://thedomainname/api/v1/configurations/currency + +{ + "selectedCurrencyOptions": [ + { + "code": "KES", + "name": "Kenyan Shilling", + "decimalPlaces": 2, + "displaySymbol": "KSh", + "nameCode": "currency.KES", + "displayLabel": "Kenyan Shilling (KSh)" + }, + { + "code": "BND", + "name": "Brunei Dollar", + "decimalPlaces": 2, + "displaySymbol": "BND", + "nameCode": "currency.BND", + "displayLabel": "Brunei Dollar (BND)" + }, + { + "code": "LBP", + "name": "Lebanese Pound", + "decimalPlaces": 2, + "displaySymbol": "L£", + "nameCode": "currency.LBP", + "displayLabel": "Lebanese Pound (L£)" + }, + { + "code": "GHC", + "name": "Ghana Cedi", + "decimalPlaces": 2, + "displaySymbol": "GHC", + "nameCode": "currency.GHC", + "displayLabel": "Ghana Cedi (GHC)" + }, + { + "code": "USD", + "name": "US Dollar", + "decimalPlaces": 2, + "displaySymbol": "$", + "nameCode": "currency.USD", + "displayLabel": "US Dollar ($)" + }, + { + "code": "XOF", + "name": "CFA Franc BCEAO", + "decimalPlaces": 0, + "displaySymbol": "CFA", + "nameCode": "currency.XOF", + "displayLabel": "CFA Franc BCEAO (CFA)" + } + ], + "currencyOptions": [ + { + "code": "AED", + "name": "UAE Dirham", + "decimalPlaces": 2, + "displaySymbol": null, + "nameCode": "currency.AED", + "displayLabel": "UAE Dirham [AED]" + }, + { + "code": "AFN", + "name": "Afghanistan Afghani", + "decimalPlaces": 2, + "displaySymbol": null, + "nameCode": "currency.AFN", + "displayLabel": "Afghanistan Afghani [AFN]" + }, + ... + ... + { + "code": "ZMK", + "name": "Zambian Kwacha", + "decimalPlaces": 2, + "displaySymbol": null, + "nameCode": "currency.ZMK", + "displayLabel": "Zambian Kwacha [ZMK]" + }, + { + "code": "ZWD", + "name": "Zimbabwe Dollar", + "decimalPlaces": 2, + "displaySymbol": null, + "nameCode": "currency.ZWD", + "displayLabel": "Zimbabwe Dollar [ZWD]" + } + ] +} + +
+
+ +   +
+
+

Update currency configuration settings

+

Update list of selectedCurrencies that are allowed within the MFI and the list of currencies that are currently not selected.

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/configurations/currency +

+
+
+ PUT https://thedomainname/api/v1/configurations/currency + +{ +"selectedItems": ["USD", "GBP"] +} + +
+
+ + +   +
+
+

Additional Fields

+

+ In Mifos X, any number of "Sets" of "Additional Fields" can be configured for a Mifos X database table ("Type"). +

+

For example, portfolio_client is the database table that holds client data. Typically, MFI's want more client related fields than is provided by Mifos X out-of-the-box. + The MFI might add a Set called "Additional Info" containing some fields that are typically input when creating a client. They might then add another Set called "Highly Improbable Info" containing some fields that are only input in exceptional circumstances. +

+

+ The additional fields resource allows you to retrieve and update any Additional Fields data that has been configured in Mifos X. +

+

+ The Mifos X Individual Lending client application uses a JQuery plugin called stretchydata which, itself, uses this additional fields resource to provide a pretty flexible additional fields User Interface (UI). Put a link to an example here. +

+
+
+ + +   +
+
+

List Additional Fields Sets

+

+ Lists the Sets of additional fields have been defined in Mifos X. +

+ +
Arguments
+
+
type
+
optional
+
The Additional Fields Type (Mifos X database table) to restrict the output to
+
+

Example Request: + http://localhost:8080/mifosng-provider/api/v1/additionalfields?type=portfolio_client +

+
+
+ GET https://thedomainname/api/v1/additionalfields + { + "additionalFieldsSets": [ + { + "id": 1, + "name": "Additional Information", + "type": "portfolio_client" + }, + { + "id": 9, + "name": "Highly Improbable Info", + "type": "portfolio_client" + } + ] + } + +
+
+ + +   +
+
+

Retrieve Additional Fields

+

+ Returns the Set of Additional Fields data for the ID provided. The ID is the id field of the Type table e.g. portfolio_client might have an id value of 4. The output is a JSON formatted "Generic Resultset". The Generic Resultset contains Column Heading as well as Data information. The Column Heading information may include allowed values (columnValues array). +

+

Example Request: + http://localhost:8080/mifosng-provider/api/v1/additionalfields/portfolio_client/Additional Information/2 +

+
+
+ GET https://thedomainname/api/v1/additionalfields/{type}/{set}/{id} + { + "columnHeaders": [ + { + "columnName": "Ethnic Group", + "columnType": "String", + "columnLength": 50, + "columnDisplayType": "List", + "columnValues": [ + "Bedouin", + "Berber", + "Italian", + "Miknasa", + "Mrazig", + "Other", + "Unknown" + ] + }, + { + "columnName": "Ethnic Group Other", + "columnType": "String", + "columnLength": 50, + "columnDisplayType": null, + "columnValues": [] + }, + { + "columnName": "Household Location", + "columnType": "String", + "columnLength": 50, + "columnDisplayType": "List", + "columnValues": [ + "East Sikkim", + "North Sikkim", + "South Sikkim", + "West Sikkim", + "Other" + ] + }, + { + "columnName": "Household Location Other", + "columnType": "String", + "columnLength": 50, + "columnDisplayType": null, + "columnValues": [] + }, + { + "columnName": "Religion", + "columnType": "String", + "columnLength": 50, + "columnDisplayType": "List", + "columnValues": [ + "Protestant", + "Catholic", + "Muslim", + "Animist", + "Atheist", + "Other", + "Unknown" + ] + }, + { + "columnName": "Religion Other", + "columnType": "String", + "columnLength": 50, + "columnDisplayType": null, + "columnValues": [] + }, + { + "columnName": "Knowledge of Person", + "columnType": "String", + "columnLength": 50, + "columnDisplayType": "List", + "columnValues": [ + "Staff member", + "Spouse of staff member", + "Son/daughter of staff member", + "Friend of staff member", + "Not known by any staff member", + "Other" + ] + }, + { + "columnName": "Gender", + "columnType": "String", + "columnLength": 10, + "columnDisplayType": "List", + "columnValues": [ + "Female", + "Male" + ] + }, + { + "columnName": "Whois", + "columnType": "Text", + "columnLength": 0, + "columnDisplayType": null, + "columnValues": [] + } + ], + "data": [ + { + "row": [ + "Berber", + null, + "East Sikkim", + null, + "Animist", + "jjjjjjj", + "Son/daughter of staff member", + "Female", + "its\r\nme of\r\ncourse\r\nyes\r\nend and the end of it all" + ] + } + ] + } + +
+
+   +
+
+

Update Additional Fields

+

+ Updates (or creates) the Set of Additional Fields data for the ID provided. The ID is the id field of the Type table e.g. portfolio_client might have an id value of 4. +

+
+
+ POST https://thedomainname/api/v1/additionalfields/{type}/{set}/{id} + http://localhost:8080/mifosng-provider/api/v1/additionalfields/portfolio_client/Additional Information/2 + + + Content-Type: application/json + Request Body: + { + "Ethnic_Group":"Berber", + "Ethnic_Group_Other":"", + "Household_Location":"East Sikkim", + "Household_Location_Other":"", + "Religion":"Animist", + "Religion_Other":"jjjjjjj", + "Knowledge_of_Person":"Son/daughter of staff member", + "Gender":"Female", + "Whois":"its\r\nme of\r\ncourse\r\nyes\r\nend and the end of it all" + } + + { + "entityId": 2 + } + +
+
+ +   +
+
+

Reports

+

+ The reports resource allows you to run and receive output from pre-defined Mifos X reports. The default output is a JSON formatted "Generic Resultset". The Generic Resultset contains Column Heading as well as Data information. However, you can export to CSV format by simply adding "&exportCSV=true" to the end of your URI. +

+

+ If Pentaho reports have been pre-defined, they can also be run through this resource. Pentaho reports can return HTML, PDF or CSV formats. +

+ +

Add examples showing links to client listing report producing json, then csv, then a pentaho report producing html, pdf, csv

+

+ The Mifos X Individual Lending client application uses a JQuery plugin called stretchyreporting which, itself, uses this reports resource to provide a pretty flexible reporting User Interface (UI). Put a link to an example here. +

+
+
+ +   +
+
+

List Reports

+

+ Lists all reports and their parameters. If a report has more than one parameter it will be listed the same number of times as it has parameters. +

+ +
Arguments
+
+
exportCSV
+
optional, The only valid value is 'true'. If any other value is provided the argument will be ignored
+
Output will be delivered as a CSV file instead of JSON.
+
+

Example Request: + http://localhost:8080/mifosng-provider/api/v1/reports +

+
+
+ GET https://thedomainname/api/v1/reports + { + "columnHeaders": [ + { + "columnName": "report_id", + "columnType": "INT", + "columnLength": null, + "columnDisplayType": null, + "columnValues": [] + }, + { + "columnName": "report_name", + "columnType": "VARCHAR", + "columnLength": null, + "columnDisplayType": null, + "columnValues": [] + }, + { + "columnName": "report_type", + "columnType": "VARCHAR", + "columnLength": null, + "columnDisplayType": null, + "columnValues": [] + }, + ... more "columnHeaders" entries + ], + "data": [ + { + "row": [ + "29", + "Client Listing", + "Table", + null, + null, + "5", + null, + "selectOfficeId" + ] + }, + { + "row": [ + "42", + "Client Listing - Additional and Unlikely", + "Table", + null, + null, + "5", + null, + "selectOfficeId" + ] + }, + { + "row": [ + "30", + "Client Loans Listing", + "Table", + null, + null, + "5", + null, + "selectOfficeId" + ] + }, + ... more "Row" entries + ] + } +
+
+ + + +   +
+
+

Running a Report

+

+ Runs a report and returns the report output. +

+
Arguments
+
+
R_'parameter names' ...
+
optional, No defaults
+
The number and names of the parameters depend on the specific report and how it has been configured. R_officeId is an example parameter name.
+
Note: the prefix R_ stands for Reporting
+
parameterType
+
optional, The only valid value is 'true'. If any other value is provided the argument will be ignored
+
Determines whether the request looks in the list of reports or the list of parameters for its data.
+
exportCSV
+
optional, The only valid value is 'true'. If any other value is provided the argument will be ignored
+
Output will be delivered as a CSV file instead of JSON. Doesn't apply to Pentaho reports.
+
+

Example Request: + http://localhost:8080/mifosng-provider/api/v1/reports/Client%20Listing?R_officeId=1 +

+
+
+ GET https://thedomainname/api/v1/reports/{reportName} + { + "columnHeaders": [ + { + "columnName": "Office/Branch", + "columnType": "VARCHAR", + "columnLength": null, + "columnDisplayType": null, + "columnValues": [] + }, + { + "columnName": "Name", + "columnType": "VARCHAR", + "columnLength": null, + "columnDisplayType": null, + "columnValues": [] + }, + { + "columnName": "Joining Date", + "columnType": "DATE", + "columnLength": null, + "columnDisplayType": null, + "columnValues": [] + } + ], + "data": [ + { + "row": [ + "Demo MFI Head Office", + "O'Meara, Patrick", + "2009-01-04" + ] + }, + { + "row": [ + "Demo MFI Head Office", + "O'Meara, Dennis", + "2009-01-04" + ] + }, + { + "row": [ + "Demo MFI Head Office", + "Smith, John", + "2009-01-11" + ] + }, + ... more "row" entries + ] + } +
+
+ + +   +
+
+

Authentication

+

An API capability to allowed client applications verify authentication details.

+
+
+ +   +
+
+

Verify authentication

+

Verifies that the credentials provided successfully authenticate and returns the set of permissions allowed by that user.

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/authentication?username=super1&password=demo +

+
+
+ POST https://thedomainname/api/v1/authentication?username=super1&password=demo +POST https://localhost:8443/mifosng-provider/api/v1/authentication?username=super1&password=demo +Content-Type: application/xml + + + +
+
+ + +   +
+
+

User account details

+

An API capability to allowed client applications expose functionality for users to update their account details and password.

+
+
+ +   +
+
+

Retrieve current users account details

+

Will return user account details.

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/useraccounts/current +

+
+
+ GET https://thedomainname/api/v1/useraccounts/current +GET https://localhost:8443/mifosng-provider/api/v1/useraccounts/current + +{ + "id": 1, + "orgId": 1, + "officeId": 1, + "officeName": "Demo MFI Head Office", + "username": "mifos", + "firstname": "App hello", + "lastname": "Administrator", + "email": "demomfi@mifos.org", + "allowedOffices": [ + { + "id": 1, + "name": "Demo MFI Head Office", + "externalId": "1", + "openingDate": "2009-01-01", + "hierarchy": ".", + "parentName": null, + "parentId": 0, + "allowedParents": [] + }, + { + "id": 2, + "name": "sub branch 1", + "externalId": "2", + "openingDate": "2012-01-02", + "hierarchy": ".2.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + } + ], + "availableRoles": [ + { + "id": 2, + "orgId": 1, + "name": "Field officer", + "description": "A field officer role allows the user to add client and loans and view reports but nothing else.", + "availablePermissions": [], + "selectedPermissions": [] + }, + { + "id": 3, + "orgId": 1, + "name": "Data Entry (Portfolio only)", + "description": "This role allows a user full permissions around client and loan functionality but nothing else.", + "availablePermissions": [], + "selectedPermissions": [] + }, + { + "id": 4, + "orgId": 1, + "name": "Credit Committe Member", + "description": "This role allows a user to approve reject or withdraw loans (with reporting).", + "availablePermissions": [], + "selectedPermissions": [] + }, + { + "id": 5, + "orgId": 1, + "name": "Manager", + "description": "This role allows a manager to do anything related to portfolio management and also view all reports.", + "availablePermissions": [], + "selectedPermissions": [] + } + ], + "selectedRoles": [ + { + "id": 1, + "orgId": 1, + "name": "Super user", + "description": "This role provides all application permissions.", + "availablePermissions": [], + "selectedPermissions": [ + { + "id": 1, + "orgId": 1, + "name": "User administration ALL", + "description": "An application user will have permission to execute all tasks related to user administration.", + "code": "USER_ADMINISTRATION_SUPER_USER_ROLE", + "groupType": 1 + }, + { + "id": 4, + "orgId": 1, + "name": "Reporting ALL", + "description": "An application user will have permission to execute and view all reports.", + "code": "REPORTING_SUPER_USER_ROLE", + "groupType": 4 + }, + { + "id": 3, + "orgId": 1, + "name": "Portfolio management ALL", + "description": "An application user will have permission to execute all tasks related to portfolio management.", + "code": "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE", + "groupType": 3 + }, + { + "id": 2, + "orgId": 1, + "name": "Organisation adminsitration ALL", + "description": "An application user will have permission to execute all tasks related to organisation administration.", + "code": "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE", + "groupType": 2 + } + ] + } + ] +} + +
+
+ +   +
+
+

Update current users account details

+

Will update user account details.

+
+
+ PUT https://thedomainname/api/v1/useraccounts/current +PUT https://localhost:8443/mifosng-provider/api/v1/useraccounts/current +Content-Type: application/json +Request body: +{ + "officeId": 1, + "username": "mifos", + "firstname": "App hello", + "lastname": "Administrator", + "email": "demomfi@mifos.org", + "selectedItems": ["1"] +} + + +{ + "entityId": 1 +} + +
+
+ + +   +
+
+

Retrieve change password template details

+

Will details for change of password screen.

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/useraccounts/current/password/template +

+
+
+ GET https://thedomainname/api/v1/useraccounts/current/password/template +GET https://localhost:8443/mifosng-provider/api/v1/useraccounts/current/password/template + +{ + "password": null, + "passwordrepeat": null +} + +
+
+ +   +
+
+

Update current users password

+

Will update users password.

+
+
+ PUT https://thedomainname/api/v1/useraccounts/current/password +PUT https://localhost:8443/mifosng-provider/api/v1/useraccounts/current/password +Content-Type: application/json +Request body: +{ + "password": "demo", + "passwordrepeat": "demo" +} + + +{ + "entityId": 1 +} + +
+
+ + +   +
+
+

Users

+

An API capability to support user administration.

+
+
+ +   +
+
+

Retrieve list of users

+

Returns all users.

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/users +

+
+
+ GET https://thedomainname/api/v1/users +GET https://localhost:8443/mifosng-provider/api/v1/users + +{ + "users": [ + { + "id": 1, + "orgId": 1, + "officeId": 1, + "officeName": "Demo MFI Head Office", + "username": "mifos", + "firstname": "App hello", + "lastname": "Administrator", + "email": "demomfi@mifos.org", + "allowedOffices": [], + "availableRoles": [], + "selectedRoles": [] + }, + { + "id": 2, + "orgId": 1, + "officeId": 1, + "officeName": "Demo MFI Head Office", + "username": "super1", + "firstname": "super", + "lastname": "user", + "email": "fake@email.com", + "allowedOffices": [], + "availableRoles": [], + "selectedRoles": [] + } + ] +} + +
+
+ +   +
+
+

Retrieve new user template details

+

Returns details for new user screen

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/users/template +

+
+
+ GET https://thedomainname/api/v1/users/template +GET https://localhost:8443/mifosng-provider/api/v1/users/template + +{ + "id": null, + "orgId": null, + "officeId": null, + "officeName": null, + "username": null, + "firstname": null, + "lastname": null, + "email": null, + "allowedOffices": [ + { + "id": 1, + "name": "Demo MFI Head Office", + "externalId": "1", + "openingDate": "2009-01-01", + "hierarchy": ".", + "parentName": null, + "parentId": 0, + "allowedParents": [] + }, + { + "id": 2, + "name": "sub branch 1", + "externalId": "2", + "openingDate": "2012-01-02", + "hierarchy": ".2.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + } + ], + "availableRoles": [ + { + "id": 1, + "orgId": 1, + "name": "Super user", + "description": "This role provides all application permissions.", + "availablePermissions": [], + "selectedPermissions": [] + }, + { + "id": 2, + "orgId": 1, + "name": "Field officer", + "description": "A field officer role allows the user to add client and loans and view reports but nothing else.", + "availablePermissions": [], + "selectedPermissions": [] + } + ], + "selectedRoles": [] +} + +
+
+ +   +
+
+

Retrieve existing user details

+

Returns details for existing application user

+

Example Request: + https://localhost:8443/mifosng-provider/api/v1/users/1 +

+
+
+ GET https://thedomainname/api/v1/users/1 +GET https://localhost:8443/mifosng-provider/api/v1/users/1 + +{ + "id": 1, + "orgId": 1, + "officeId": 1, + "officeName": "Demo MFI Head Office", + "username": "mifos", + "firstname": "App hello", + "lastname": "Administrator", + "email": "demomfi@mifos.org", + "allowedOffices": [ + { + "id": 1, + "name": "Demo MFI Head Office", + "externalId": "1", + "openingDate": "2009-01-01", + "hierarchy": ".", + "parentName": null, + "parentId": 0, + "allowedParents": [] + }, + { + "id": 2, + "name": "sub branch 1", + "externalId": "2", + "openingDate": "2012-01-02", + "hierarchy": ".2.", + "parentName": "Demo MFI Head Office", + "parentId": 1, + "allowedParents": [] + } + ], + "availableRoles": [ + { + "id": 2, + "orgId": 1, + "name": "Field officer", + "description": "A field officer role allows the user to add client and loans and view reports but nothing else.", + "availablePermissions": [], + "selectedPermissions": [] + } + ], + "selectedRoles": [ + { + "id": 1, + "orgId": 1, + "name": "Super user", + "description": "This role provides all application permissions.", + "availablePermissions": [], + "selectedPermissions": [ + { + "id": 1, + "orgId": 1, + "name": "User administration ALL", + "description": "An application user will have permission to execute all tasks related to user administration.", + "code": "USER_ADMINISTRATION_SUPER_USER_ROLE", + "groupType": 1 + }, + { + "id": 4, + "orgId": 1, + "name": "Reporting ALL", + "description": "An application user will have permission to execute and view all reports.", + "code": "REPORTING_SUPER_USER_ROLE", + "groupType": 4 + }, + { + "id": 3, + "orgId": 1, + "name": "Portfolio management ALL", + "description": "An application user will have permission to execute all tasks related to portfolio management.", + "code": "PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE", + "groupType": 3 + }, + { + "id": 2, + "orgId": 1, + "name": "Organisation adminsitration ALL", + "description": "An application user will have permission to execute all tasks related to organisation administration.", + "code": "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE", + "groupType": 2 + } + ] + } + ] +} + +
+
+ + + + +
+
+ + + \ No newline at end of file