diff --git a/APIFolder/api.htm b/APIFolder/api.htm index c455629b7..b3a49dcd4 100644 --- a/APIFolder/api.htm +++ b/APIFolder/api.htm @@ -419,67 +419,173 @@
The Office and Branch hierarchy. -
+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.
Example Request: - http://localhost:8080/mifosng-provider/api/v1/offices + https://localhost:8443/mifosng-provider/api/v1/offices
GET https://thedomainname/api/v1/offices
- to be done
-
+
+{
+ "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": []
+ }
+ ]
+}
+
Returns a template that contains the office fields and allowed value lists. This helps build a maintenance User Interface. +
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: - http://localhost:8080/mifosng-provider/api/v1/offices/template + + https://localhost:8443/mifosng-provider/api/v1/offices/template +
GET https://thedomainname/api/v1/offices/template
- to be done
-
+
+{
+ "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": []
+ }
+ ]
+}
+
+ 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": []
+}
+