From c14a46a167e1f0cd3533faccfbc4d81e014aa1c8 Mon Sep 17 00:00:00 2001 From: John Woodlock Date: Mon, 28 May 2012 12:26:51 +1000 Subject: [PATCH] api docs update --- APIFolder/api.htm | 276 ++++++++++---------------------- APIFolder/docUpdateComments.txt | 4 + 2 files changed, 91 insertions(+), 189 deletions(-) diff --git a/APIFolder/api.htm b/APIFolder/api.htm index a23753a92..59e68e5eb 100644 --- a/APIFolder/api.htm +++ b/APIFolder/api.htm @@ -115,8 +115,8 @@ /v1/loans/{loanId}/transactions/templateRetrieve Loan Repayment/Loan Waiver Template /v1/offices/templateRetrieve Office Details Template /v1/loanproducts/templateRetrieve Loan Product Details Template - /v1/users/templateRetrieve new user template - /v1/roles/templateRetrieve new role template + /v1/users/templateRetrieve User Details Template + /v1/roles/templateRetrieve Role Details Template @@ -2944,7 +2944,7 @@ Request Body:

Authenticates the credentials provided and returns the set of permissions allowed.

- POST https://thedomainname/api/v1/authentication?username={userName}&password={password} + POST https://thedomainname/api/v1/authentication?username={username}&password={password} POST https://localhost:8443/mifosng-provider/api/v1/authentication?username=super1&password=demo Content-Type: application/json No Request Body @@ -2978,45 +2978,30 @@ No Request Body
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": [] - } - ] -} +[ { + "id" : 6, + "officeId" : 1, + "officeName" : "change super user", + "username" : "committee1", + "firstname" : "Committee", + "lastname" : "Member", + "email" : "fake@email.com" +}, { + "id" : 5, + "officeId" : 1, + "officeName" : "change super user", + "username" : "dataentry1", + "firstname" : "Data Entry", + "lastname" : "User", + "email" : "fake@email.com" +}...]
@@ -3024,66 +3009,36 @@ No Request Body  
-

Retrieve new user template details

-

Returns details for new user screen

-

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

+

Retrieve User Details Template

+

This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: +

    +
  • Field Defaults
  • +
  • Allowed Value Lists
  • +
+

+

Example Request:

+ https://localhost:8443/mifosng-provider/api/v1/users/template?pretty=true
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": [] +{ + "allowedOffices" : [ { + "id" : 1, + "name" : "change super user" + } ], + "availableRoles" : [ { + "id" : 1, + "name" : "Super user", + "description" : "This role provides all application permissions.", + "availablePermissions" : [ ], + "selectedPermissions" : [ ] + }, { + "id" : 2, + "name" : "Field officer", + "description" : "A field officer role allows the user to add client and loans and view reports but nothing else.", + "availablePermissions" : [ ], + "selectedPermissions" : [ ] + }...] }
@@ -3092,100 +3047,43 @@ No Request Body  
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 - } - ] - } - ] +{ + "id" : 1, + "officeId" : 1, + "officeName" : "change super user", + "username" : "mifos", + "firstname" : "App", + "lastname" : "Administrator", + "email" : "demomfi@mifos.org", + "selectedRoles" : [ { + "id" : 1, + "name" : "Super user", + "description" : "This role provides all application permissions.", + "availablePermissions" : [ ], + "selectedPermissions" : [ { + "id" : 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, + "name" : "Reporting ALL", + "description" : "An application user will have permission to execute and view all reports.", + "code" : "REPORTING_SUPER_USER_ROLE", + "groupType" : 4 + }...] + } ] }
@@ -3760,8 +3658,8 @@ Request body: /v1/loans/{loanId}/transactions/templateRetrieve Loan Repayment/Loan Waiver Template /v1/offices/templateRetrieve Office Details Template /v1/loanproducts/templateRetrieve Loan Product Details Template - /v1/users/templateRetrieve new user template - /v1/roles/templateRetrieve new role template + /v1/users/templateRetrieve User Details Template + /v1/roles/templateRetrieve Role Details Template
diff --git a/APIFolder/docUpdateComments.txt b/APIFolder/docUpdateComments.txt index 05ef45c97..d502e01aa 100644 --- a/APIFolder/docUpdateComments.txt +++ b/APIFolder/docUpdateComments.txt @@ -16,3 +16,7 @@ Note that openingData is passed as openingDateFormatted and a dateFormat is prov hierarchy update results in exception (prob solved by using unrecognized parameter exception) +Users +template: allowedOffices (only id 1 came back)... does allowedOffices and available Roles depending on requested permissions? +Retrieve a user: selectedRoles- possible json prob availablePermissions is blank... is it always? +