Account Management » History » Revision 6
Revision 5 (Eric Vieillevigne, 05/12/2015 06:11 PM) → Revision 6/7 (Eric Vieillevigne, 09/01/2016 01:06 PM)
{{>toc}}
h1. Account Managment - _*acc*_ method
The Acc api allows to manage its own account, change the members profiles, create a family information as well as invite a member to join. This method does not allow to create
an account for a user which is provided by the logcreate function.
h2. Create a Family- _accfamily_
The method accfamily enables to create a new family. If the account already have a family, a FizApiUnattendedException shall be thrown. Note that to use this api, the user must
be logged with a valid session. During the creation of the family the logged user will be automatically the family founder.
The method returns a Long Familyid
By sending an HTTP request http://servername/api/acc/createfamily?name=lastname&role=Dad
*Parameters*:
|*Name*|*Type*|*Description*|
|name|String|Name of the family|
|role|String|Role of the family founder Mom,Dad,Daughter,Son,Unknown)|
|file|binary|Image of the Family|
*Response*:
<pre><code class="javascript">
{
"cn":"acccreatefamily",
"feed":"3266"
}
</code></pre>
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
*Error*:
|*Error Code*|*Type*|*Value*|*Description*|
|FizMediaQuotaExceededException|ex|601|Media Quota exceedded|
|FizAccountNotFoundInSessionException|un|501|Session is invalid|
|FizApiInvalidParameterException|un|502|Invalid |FizApiInvalidParameterException|un|502|invalid token|
|FizApiModelDoesNotExistException|un|503|Object does not exists|
|FizApiModelRightException|un|504|Right exception to use this method|
h2. Get Family Information- _accgetfamily_
The method accgetfamily enables a logged user retreive the information fo the family.
The method returns a Family List Ifamily
By sending an HTTP request http://servername/api/acc/getfamily?
*Parameters*:
No Parameter
*Response*:
<pre><code class="javascript">
{
"cn":"accgetfamily",
"feed":{
"name":"Familyname",
"family_id":"3323",
"members":[
{
"role":"Mom",
"account":{
"accountId":"3303",
"identifiers":[
{
"value":"test@gmail.com",
"validated":"true",
"type":"Email"
}
],
"name":"test@gmail.com"
},
"right":"SuperAdmin"
}
]
}
}
</code></pre>
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
*Error*:
|*Error Code*|*Type*|*Value*|*Description*|
|FizMediaQuotaExceededException|ex|601|Media Quota exceedded|
|FizAccountNotFoundInSessionException|un|501|Session is invalid|
|FizApiInvalidParameterException|un|502|Invalid |FizApiInvalidParameterException|un|502|invalid token|
|FizApiModelDoesNotExistException|un|503|Object does not exists|
|FizApiModelRightException|un|504|Right exception to use this method|
h2. Get logged Account- _accgetloggedaccount_
The method accgetloggedaccount returns contains all the AccountIdentifier(s) and all the family information attached to this account.
The returned account contains all the AccountIdentifier(s) and all the family information attached to this account
However, the validationToken shall _NOT_ be transmitted in the accountIdentifier(s) (do not annotate the field). It also contains an autologin token to enable the system to
log-in without having to resend the password (TBD later)
By sending an HTTP request http://servername/api/acc/getloggedaccount?
*Parameters*:
No Parameter
*Response*:
<pre><code class="javascript">
{
"cn":"accgetloggedaccount",
"feed":{
"accountId":"130",
"identifiers":[
{
"value":"test@facebook.com",
"validated":"true",
"type":"Email"
},{
"value":"htc@erioxyde.com",
"validated":"true",
"type":"Email"
},{
"value":"marge",
"validated":"true",
"type":"ExternalId"
},{
"value":"test2@gmail.com",
"validated":"true",
"type":"Email"
},{
"value":"test3@gmail.com",
"validated":"true",
"type":"Email"
}
],
"name":"marge"
}
}
</code></pre>
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
*Error*:
|*Error Code*|*Type*|*Value*|*Description*|
|FizMediaQuotaExceededException|ex|601|Media Quota exceedded|
|FizAccountNotFoundInSessionException|un|501|Session is invalid|
|FizApiInvalidParameterException|un|502|Invalid |FizApiInvalidParameterException|un|502|invalid token|
|FizApiModelDoesNotExistException|un|503|Object does not exists|
|FizApiModelRightException|un|504|Right exception to use this method|
h2. Set Family Information- _accsetprofile_
The method accsetprofile enables the profile of the current account (second page of registration process).
The method returns a Long.
By sending an HTTP request http://servername/api/api/acc/setprofile
*Parameters*:
|*Name*|*Type*|*Description*|
|accountId|String|Account of the profile to modify : if null it is yours, if not you have to be administrator to modify the account|
|pseudo|String|pseudo of the user|
|firstname|String|Firstname of the user|
|role|String|Role of the family founder Mom,Dad,Daughter,Son,Unknown|
|mobile|String|the mobile number (if null no change, if empty String will delete, else it store the value)|
|email|String|the email address (if null no change, if empty String will delete, else it store the value)|
|birthday|String|the email address (if null no change, if empty String will delete, else it store the value)|
|timezone|String|timezone of the user|
|file|binary|Image of the Family|
*Response*:
<pre><code class="javascript">
{
"cn":"accsetprofile",
"feed":"3266"
}
</code></pre>
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
*Error*:
|*Error Code*|*Type*|*Value*|*Description*|
|FizAccountAlreadyExistsException|ex|2|Already exists|
|FizCredentialInvalidException|ex|3|No right to update|
|FizMediaQuotaExceededException|ex|601|Media Quota exceedded|
|FizAccountNotFoundInSessionException|un|501|Session is invalid|
|FizApiInvalidParameterException|un|502|Invalid |FizApiInvalidParameterException|un|502|invalid token|
|FizApiModelDoesNotExistException|un|503|Object does not exists|
|FizApiModelRightException|un|504|Right exception to use this method|
h2. Update Family Account- _accupdatefamily_
The method accupdatefamily enables a logged client to update the family in case he has the proper administration right (Family Founder(SA) or Administrator).
The method returns an IFamily.
By sending an HTTP request http://servername/api/acc/setprofile
|*Name*|*Type*|*Description*|
|name|String|Name of the family - if null no update no update for this field|
|file|binary|Image of the Family - if null no update on the field|
*Response*:
{
"cn":"accupdatefamily",
"feed":{
"name":"",
"family_id":"144",
"pictureUri":"http:\/\/API server\/media\/144_9323?",
"members":[
{
"role":"Mom",
"account":{
"accountId":"130",
"identifiers":[
{
"value":"test@facebook.com",
"validated":"true",
"type":"Email"
},{
"value":"test@test.com",
"validated":"true",
"type":"Email"
},{
"value":"marge",
"validated":"true",
"type":"ExternalId"
},{
"value":"test1@gmail.com",
"validated":"true",
"type":"Email"
},{
"value":"test2@gmail.com",
"validated":"true",
"type":"Email"
}
],
...
</code></pre>
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
*Error*:
|*Error Code*|*Type*|*Value*|*Description*|
|FizMediaQuotaExceededException|ex|601|Media Quota exceedded|
|FizAccountNotFoundInSessionException|un|501|Session is invalid|
|FizApiInvalidParameterException|un|502|Invalid |FizApiInvalidParameterException|un|502|invalid token|
|FizApiModelDoesNotExistException|un|503|Object does not exists|
|FizApiModelRightException|un|504|Right exception to use this method|