From cf465cb052cb8cbca8798b795a97f4a45fe5c60c Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Tue, 22 May 2012 00:26:07 +0100 Subject: [PATCH] update futher api docs around user accounts. --- APIFolder/api.htm | 395 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 384 insertions(+), 11 deletions(-) diff --git a/APIFolder/api.htm b/APIFolder/api.htm index 8a57a7ac7..a4ac3b228 100644 --- a/APIFolder/api.htm +++ b/APIFolder/api.htm @@ -128,7 +128,10 @@

User Accounts

@@ -1031,7 +1034,139 @@ Request Body:
- + +   +
+
+

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"] +} + +
+
+ +  
@@ -1255,12 +1390,6 @@ Request Body:
- - - - - -  
@@ -1278,9 +1407,7 @@ Request Body:

- - - +  
@@ -1449,8 +1576,254 @@ 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 +} + +
+
+ + + + + + + + + + + +