Project

General

Profile

Actions

Account Management » History » Revision 4

« Previous | Revision 4/7 (diff) | Next »
Eric Vieillevigne, 05/12/2015 06:11 PM


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.

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:

{
  "cn":"acccreatefamily",
  "feed":"3266" 
}

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 token
FizApiModelDoesNotExistException un 503 Object does not exists
FizApiModelRightException un 504 Right exception to use this method

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:

{
  "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" 
      }
    ]
  }
}    

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 token
FizApiModelDoesNotExistException un 503 Object does not exists
FizApiModelRightException un 504 Right exception to use this method

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:

{
  "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" 
  }
}   

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 token
FizApiModelDoesNotExistException un 503 Object does not exists
FizApiModelRightException un 504 Right exception to use this method

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:

{
  "cn":"accsetprofile",
  "feed":"3266" 
}

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 token
FizApiModelDoesNotExistException un 503 Object does not exists
FizApiModelRightException un 504 Right exception to use this method

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":"",
"validated":"true",
"type":"Email"
},{
"value":"",
"validated":"true",
"type":"Email"
},{
"value":"marge",
"validated":"true",
"type":"ExternalId"
},{
"value":"",
"validated":"true",
"type":"Email"
},{
"value":"",
"validated":"true",
"type":"Email"
}
],
...

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 token
FizApiModelDoesNotExistException un 503 Object does not exists
FizApiModelRightException un 504 Right exception to use this method

Updated by Eric Vieillevigne over 10 years ago · 4 revisions