api docs update

This commit is contained in:
John Woodlock
2012-05-29 02:08:03 +10:00
parent 6b3d8fa762
commit d127003d6d
2 changed files with 84 additions and 148 deletions
+77 -147
View File
@@ -393,30 +393,7 @@
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
<h3>Clients</h3> <h3>Clients</h3>
<p>Clients ...</p> <p>Clients are people and businesses that have applied (or may apply) to an MFI for loans.</p>
</div>
</div>
<div class="method-section">
<div class="method-description">
<h5>Attributes</h5>
<dl class="argument-list">
<dt>
id
</dt>
<dd>
string <span>jpw ipsum as an example of showing the (at least important) columns</span>
</dd>
<dt>
amount
</dt>
<dd>blah <span></span>
</dd>
<dd>blah</dd>
<dt>
card
</dt>
</dl>
</div> </div>
</div> </div>
@@ -424,46 +401,34 @@
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
<h4>List Clients</h4> <h4>List Clients</h4>
<p>Example Request: <p>Example Request: </p>
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/clients">https://localhost:8443/mifosng-provider/api/v1/clients</a> <a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/clients?pretty=true">https://localhost:8443/mifosng-provider/api/v1/clients?pretty=true</a>
</p> <br><br>
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/clients?pretty=true&fields=displayName,officeName,joinedDate">https://localhost:8443/mifosng-provider/api/v1/clients?pretty=true&fields=displayName,officeName,joinedDate</a>
</div> </div>
<div class="method-example"> <div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/clients</code> <code class="method-declaration">GET https://thedomainname/api/v1/clients</code>
<code class="method-response">{ <code class="method-response">[ {
"clients": [ "officeId" : 1,
{ "officeName" : "change super user",
"organisationId": 1, "id" : 2,
"organisationName": "Demo MFI", "firstname" : "Dennis",
"officeId": 2, "lastname" : "O'Meara",
"officeName": "sub branch 1", "displayName" : "Dennis O'Meara",
"id": 14, "externalId" : null,
"firstname": "Patrick", "joinedDate" : [ 2009, 1, 4 ],
"lastname": "Asare-Frimpong", "maxJoinedOnOffsetFromToday" : -1241
"displayName": "Patrick Asare-Frimpong", }, {
"externalId": null, "officeId" : 1,
"joinedDate": "2012-04-18", "officeName" : "change super user",
"allowedOffices": [], "id" : 4,
"maxJoinedOnOffsetFromToday": -34 "firstname" : "Jimmy",
}, "lastname" : "O'Meara",
... "displayName" : "Jimmy O'Meara",
... "externalId" : null,
{ "joinedDate" : [ 2009, 1, 11 ],
"organisationId": 1, "maxJoinedOnOffsetFromToday" : -1234
"organisationName": "Demo MFI", }...]
"officeId": 1,
"officeName": "Demo MFI Head Office",
"id": 17,
"firstname": "Fred",
"lastname": "Ziffle",
"displayName": "Fred Ziffle",
"externalId": null,
"joinedDate": "2012-04-21",
"allowedOffices": [],
"maxJoinedOnOffsetFromToday": -31
}
]
}
</code> </code>
</div> </div>
</div> </div>
@@ -479,46 +444,17 @@
<li class=normalli>Allowed Value Lists</li> <li class=normalli>Allowed Value Lists</li>
</ul> </ul>
</p> </p>
<p>Example Request: <p>Example Request: </p>
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/clients/template">https://localhost:8443/mifosng-provider/api/v1/clients/template</a> <a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/clients/template?pretty=true">https://localhost:8443/mifosng-provider/api/v1/clients/template?pretty=true</a>
</p>
</div> </div>
<div class="method-example"> <div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/clients/template</code> <code class="method-declaration">GET https://thedomainname/api/v1/clients/template</code>
<code class="method-response">{ <code class="method-response">{
"organisationId": 1, "joinedDate" : [ 2012, 5, 29 ],
"organisationName": null, "allowedOffices" : [ {
"officeId": 1, "id" : 1,
"officeName": null, "name" : "change super user"
"id": -1, } ]
"firstname": "",
"lastname": "",
"displayName": "",
"externalId": null,
"joinedDate": "2012-05-22",
"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": []
}
],
"maxJoinedOnOffsetFromToday": 0
} }
</code> </code>
</div> </div>
@@ -529,27 +465,25 @@
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
<h4>Retrieve a Client</h4> <h4>Retrieve a Client</h4>
<p>Returns client fields. It also returns allowed value lists which help build a maintenance User Interface. <p>Example Request: </p>
</p> <a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/clients/1?pretty=true">https://localhost:8443/mifosng-provider/api/v1/clients/1?pretty=true</a>
<p>Example Request: <br><br>
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/clients/1">https://localhost:8443/mifosng-provider/api/v1/clients/1</a> <a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/clients/1?pretty=true&template=true">https://localhost:8443/mifosng-provider/api/v1/clients/1?pretty=true&template=true</a>
</p> <br><br>
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/clients/1?pretty=true&fields=id,displayName,officeName">https://localhost:8443/mifosng-provider/api/v1/clients/1?pretty=true&fields=id,displayName,officeName</a>
</div> </div>
<div class="method-example"> <div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/clients/{clientId}</code> <code class="method-declaration">GET https://thedomainname/api/v1/clients/{clientId}</code>
<code class="method-response">{ <code class="method-response">{
"organisationId": 1, "officeId" : 1,
"organisationName": "Demo MFI", "officeName" : "change super user",
"officeId": 1, "id" : 1,
"officeName": "Demo MFI Head Office", "firstname" : "Patrick",
"id": 1, "lastname" : "O'Meara",
"firstname": "Patrick", "displayName" : "Patrick O'Meara",
"lastname": "O'Meara", "externalId" : null,
"displayName": "Patrick O'Meara", "joinedDate" : [ 2009, 1, 4 ],
"externalId": null, "maxJoinedOnOffsetFromToday" : -1241
"joinedDate": "2009-01-04",
"allowedOffices": [],
"maxJoinedOnOffsetFromToday": -1234
} }
</code> </code>
</div> </div>
@@ -2337,22 +2271,27 @@ Request Body:
<code class="method-declaration">POST https://thedomainname/api/v1/loanproducts</code> <code class="method-declaration">POST https://thedomainname/api/v1/loanproducts</code>
<code class="method-request">https://localhost:8443/mifosng-provider/api/v1/loanproducts <code class="method-request">https://localhost:8443/mifosng-provider/api/v1/loanproducts
Content-Type: application/json Content-Type: application/json
Request Body: Request Body:{
{ "name": "Newish kind of Loan",
"name": "New kind of Loan", "description": "A description not exceeding 500 characters.",
"description": "A description not exceeding 500 characters.", "externalId": "1077",
"currencyCode": "XOF", "locale": "en-us",
"digitsAfterDecimal": 0, "currencyCode": "XOF",
"principal": 100000, "digitsAfterDecimal": 0,
"inArrearsToleranceAmount": 1000, "principalFormatted": "100,000",
"numberOfRepayments": 1, "inArrearsToleranceAmountFormatted": "1,000",
"repaymentEvery": 1, "repaymentEvery": 1,
"repaymentFrequency": 2, "repaymentFrequency": 2,
"amortizationMethod": 1, "numberOfRepayments": 1,
"interestRatePerPeriod": 1.75, "interestRatePerPeriodFormatted": "1.75",
"interestRateFrequencyMethod": 2, "interestRateFrequencyMethod": 2,
"interestCalculationPeriodMethod": 1, "amortizationMethod": 1,
"interestMethod": 0 "interestMethod": 0 ,
"interestCalculationPeriodMethod": 1
}
</code>
<code class="method-response">{
"entityId": 9
} }
</code> </code>
</div> </div>
@@ -2368,21 +2307,12 @@ Request Body:
<code class="method-request">https://localhost:8443/mifosng-provider/api/v1/loanproducts/1 <code class="method-request">https://localhost:8443/mifosng-provider/api/v1/loanproducts/1
Content-Type: application/json Content-Type: application/json
Request Body: Request Body:
{ {
"name": "New kind of Loan updated", "name": "Loan name - updated"
"description": "An updated description not exceeding 500 characters.", }
"currencyCode": "XOF", </code>
"digitsAfterDecimal": 0, <code class="method-response">{
"principal": 100000, "entityId": 1
"inArrearsToleranceAmount": 1000,
"numberOfRepayments": 1,
"repaymentEvery": 1,
"repaymentFrequency": 2,
"amortizationMethod": 1,
"interestRatePerPeriod": 1.75,
"interestRateFrequencyMethod": 2,
"interestCalculationPeriodMethod": 1,
"interestMethod": 0
} }
</code> </code>
</div> </div>
@@ -3050,7 +2980,7 @@ No Request Body
<a id="users_create" name="users_create" class="old-syle-anchor">&nbsp;</a> <a id="users_create" name="users_create" class="old-syle-anchor">&nbsp;</a>
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
<h4>Create new user</h4> <h4>Create a User</h4>
<p>Adds new application user.</p> <p>Adds new application user.</p>
</div> </div>
<div class="method-example"> <div class="method-example">
@@ -3080,7 +3010,7 @@ Request body:
<a id="users_update" name="users_update" class="old-syle-anchor">&nbsp;</a> <a id="users_update" name="users_update" class="old-syle-anchor">&nbsp;</a>
<div class="method-section"> <div class="method-section">
<div class="method-description"> <div class="method-description">
<h4>Update existing user</h4> <h4>Update a User</h4>
</div> </div>
<div class="method-example"> <div class="method-example">
<code class="method-declaration">PUT https://thedomainname/api/v1/users/{userId)</code> <code class="method-declaration">PUT https://thedomainname/api/v1/users/{userId)</code>
+7 -1
View File
@@ -27,4 +27,10 @@ update: give hardtofigureout error msg when using equivalent to create parameter
delete: does delete (I delete super1), no 200 ok returned, "org.springframework.dao.InvalidDataAccessApiUsageException: attempt to create merge event with null entity; " if delete a non-existant user delete: does delete (I delete super1), no 200 ok returned, "org.springframework.dao.InvalidDataAccessApiUsageException: attempt to create merge event with null entity; " if delete a non-existant user
Loan Product Loan Product
List - interestRateCalculatedInPeriod is it usefult to show this field...also enums questionsor show only a few cos on loan template List - interestRateCalculatedInPeriod is it usefult to show this field...also enums questionsor show only a few cos on loan template
Create - get NullPointerException when creating using values in api doc (? about using principal or principal formatted or the right locale values)
Update - tried to update name (using api docs data) and got a NullPointerException
Clients
List - can't get client other than from office 1
template - only get office 1 in allowed offices