update futher api docs around user accounts.

This commit is contained in:
Keith Woodlock
2012-05-22 00:47:32 +01:00
parent cf465cb052
commit 54062c8919
+227 -6
View File
@@ -137,7 +137,11 @@
<div class="toc-section">
<h4><a href="#users">Users</a></h4>
<ul>
<li><a href="#tbd">tbd</a></li>
<li><a href="#users_list">List users</a></li>
<li><a href="#users_template">Retrieve new user template</a></li>
<li><a href="#users_retrieve">Retrieve existing user</a></li>
<li><a href="#users_create">Create new user</a></li>
<li><a href="#users_update">Update existing user</a></li>
</ul>
</div>
<div class="toc-section">
@@ -1813,14 +1817,231 @@ Request body:
</div>
</div>
<!-- start of users api docs -->
<a id="users" name="users" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h3>Users</h3>
<p>An API capability to support user administration.</p>
</div>
</div>
<a id="users_list" name="users_list" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Retrieve list of users</h4>
<p>Returns all users.</p>
<p>Example Request:
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/users">https://localhost:8443/mifosng-provider/api/v1/users</a>
</p>
</div>
<div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/users</code>
<code class="method-request">GET https://localhost:8443/mifosng-provider/api/v1/users</code>
<code class="method-response">
{
"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": []
}
]
}
</code>
</div>
</div>
<a id="users_template" name="users_template" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Retrieve new user template details</h4>
<p>Returns details for new user screen</p>
<p>Example Request:
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/users/template">https://localhost:8443/mifosng-provider/api/v1/users/template</a>
</p>
</div>
<div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/users/template</code>
<code class="method-request">GET https://localhost:8443/mifosng-provider/api/v1/users/template</code>
<code class="method-response">
{
"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": []
}
</code>
</div>
</div>
<a id="users_retrieve" name="users_retrieve" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Retrieve existing user details</h4>
<p>Returns details for existing application user</p>
<p>Example Request:
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/users/1">https://localhost:8443/mifosng-provider/api/v1/users/1</a>
</p>
</div>
<div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/users/1</code>
<code class="method-request">GET https://localhost:8443/mifosng-provider/api/v1/users/1</code>
<code class="method-response">
{
"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
}
]
}
]
}
</code>
</div>
</div>