Project

General

Profile

Account Management » History » Version 3

Eric Vieillevigne, 05/12/2015 06:10 PM

1 2 Eric Vieillevigne
{{>toc}}
2 1 Eric Vieillevigne
3 2 Eric Vieillevigne
h1. Account Managment - _*acc*_ method
4
5 1 Eric Vieillevigne
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 
6
7
an account for a user which is provided by the logcreate function.
8
9
h2. Create a Family- _accfamily_
10
11
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 
12
13
be logged with a valid session. During the creation of the family the logged user will be automatically the family founder.
14
15
16
The method returns a Long Familyid
17
18 2 Eric Vieillevigne
By sending an HTTP request http://servername/api/acc/createfamily?name=lastname&role=Dad
19 1 Eric Vieillevigne
20
*Parameters*:
21
22
|*Name*|*Type*|*Description*|
23
|name|String|Name of the family|
24
|role|String|Role of the family founder Mom,Dad,Daughter,Son,Unknown)|
25
|file|binary|Image of the Family|
26
27
*Response*:
28
<pre><code class="javascript">
29
{
30
  "cn":"acccreatefamily",
31
  "feed":"3266"
32
}
33
        
34
</code></pre>
35
36
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
37
38
*Error*:
39
40
|*Error Code*|*Type*|*Value*|*Description*|
41
|FizMediaQuotaExceededException|ex|601|Media Quota exceedded|
42
|FizAccountNotFoundInSessionException|un|501|Session is invalid|
43
|FizApiInvalidParameterException|un|502|invalid token|
44
|FizApiModelDoesNotExistException|un|503|Object does not exists|
45
|FizApiModelRightException|un|504|Right exception to use this method|
46
47
h2. Get Family Information- _accgetfamily_
48
49
The method accgetfamily enables a logged user retreive the information fo the family.
50
51
The method returns a Family List Ifamily
52
53 3 Eric Vieillevigne
By sending an HTTP request http://servername/api/acc/getfamily?
54 1 Eric Vieillevigne
55
*Parameters*:
56
57
No Parameter
58
59
*Response*:
60
<pre><code class="javascript">
61
{
62
  "cn":"accgetfamily",
63
  "feed":{
64 2 Eric Vieillevigne
    "name":"Familyname",
65 1 Eric Vieillevigne
    "family_id":"3323",
66
    "members":[
67
      {
68
        "role":"Mom",
69
        "account":{
70
          "accountId":"3303",
71
          "identifiers":[
72
            {
73 2 Eric Vieillevigne
              "value":"test@gmail.com",
74 1 Eric Vieillevigne
              "validated":"true",
75
              "type":"Email"
76
            }
77
          ],
78 2 Eric Vieillevigne
          "name":"test@gmail.com"
79 1 Eric Vieillevigne
        },
80
        "right":"SuperAdmin"
81
      }
82
    ]
83
  }
84
}    
85
</code></pre>
86
87
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
88
89
*Error*:
90
91
|*Error Code*|*Type*|*Value*|*Description*|
92
|FizMediaQuotaExceededException|ex|601|Media Quota exceedded|
93
|FizAccountNotFoundInSessionException|un|501|Session is invalid|
94
|FizApiInvalidParameterException|un|502|invalid token|
95
|FizApiModelDoesNotExistException|un|503|Object does not exists|
96
|FizApiModelRightException|un|504|Right exception to use this method|
97
98
h2. Get logged Account- _accgetloggedaccount_
99
100
The method accgetloggedaccount returns contains all the AccountIdentifier(s) and all the family information attached to this account.
101
102
The returned account contains all the AccountIdentifier(s) and all the family information attached to this account
103
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 
104
105
log-in without having to resend the password (TBD later)
106
107 2 Eric Vieillevigne
By sending an HTTP request http://servername/api/acc/getloggedaccount?
108 1 Eric Vieillevigne
109
*Parameters*:
110
111
No Parameter
112
113
*Response*:
114
<pre><code class="javascript">
115
{
116
  "cn":"accgetloggedaccount",
117
  "feed":{
118
    "accountId":"130",
119
    "identifiers":[
120
      {
121 2 Eric Vieillevigne
        "value":"test@facebook.com",
122 1 Eric Vieillevigne
        "validated":"true",
123
        "type":"Email"
124
      },{
125
        "value":"htc@erioxyde.com",
126
        "validated":"true",
127
        "type":"Email"
128
      },{
129
        "value":"marge",
130
        "validated":"true",
131
        "type":"ExternalId"
132
      },{
133 2 Eric Vieillevigne
        "value":"test2@gmail.com",
134 1 Eric Vieillevigne
        "validated":"true",
135
        "type":"Email"
136
      },{
137 2 Eric Vieillevigne
        "value":"test3@gmail.com",
138 1 Eric Vieillevigne
        "validated":"true",
139
        "type":"Email"
140
      }
141
    ],
142
    "name":"marge"
143
  }
144
}   
145
</code></pre>
146
147
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
148
149
*Error*:
150
151
|*Error Code*|*Type*|*Value*|*Description*|
152
|FizMediaQuotaExceededException|ex|601|Media Quota exceedded|
153
|FizAccountNotFoundInSessionException|un|501|Session is invalid|
154
|FizApiInvalidParameterException|un|502|invalid token|
155
|FizApiModelDoesNotExistException|un|503|Object does not exists|
156
|FizApiModelRightException|un|504|Right exception to use this method|
157
158
159
h2. Set Family Information- _accsetprofile_
160
161
The method accsetprofile enables the profile of the current account (second page of registration process).
162
163
The method returns a Long.
164
165
By sending an HTTP request http://www.familywall.com/preprod/apiapi/api/acc/setprofile
166
167
*Parameters*:
168
|*Name*|*Type*|*Description*|
169
|accountId|String|Account of the profile to modify : if null it is yours, if not you have to be administrator to modify the account|
170
|pseudo|String|pseudo of the user|
171
|firstname|String|Firstname of the user|
172
|role|String|Role of the family founder Mom,Dad,Daughter,Son,Unknown|
173
|mobile|String|the mobile number (if null no change, if empty String will delete, else it store the value)|
174
|email|String|the email address (if null no change, if empty String will delete, else it store the value)|
175
|birthday|String|the email address (if null no change, if empty String will delete, else it store the value)|
176
|timezone|String|timezone of the user|
177
|file|binary|Image of the Family|
178
179
*Response*:
180
<pre><code class="javascript">
181
{
182
  "cn":"accsetprofile",
183
  "feed":"3266"
184
}
185
      
186
</code></pre>
187
188
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
189
190
*Error*:
191
192
|*Error Code*|*Type*|*Value*|*Description*|
193
|FizAccountAlreadyExistsException|ex|2|Already exists|
194
|FizCredentialInvalidException|ex|3|No right to update|
195
|FizMediaQuotaExceededException|ex|601|Media Quota exceedded|
196
|FizAccountNotFoundInSessionException|un|501|Session is invalid|
197
|FizApiInvalidParameterException|un|502|invalid token|
198
|FizApiModelDoesNotExistException|un|503|Object does not exists|
199
|FizApiModelRightException|un|504|Right exception to use this method|
200
201
202
h2. Update Family Account- _accupdatefamily_
203
204
The method accupdatefamily enables a logged client to update the family in case he has the proper administration right (Family Founder(SA) or Administrator).
205
206
The method returns an IFamily.
207
208 2 Eric Vieillevigne
By sending an HTTP request http://servername/api/acc/setprofile
209 1 Eric Vieillevigne
210
|*Name*|*Type*|*Description*|
211
|name|String|Name of the family - if null no update no update for this field|
212
|file|binary|Image of the Family - if null no update on the field|
213
214
*Response*:
215
{
216
  "cn":"accupdatefamily",
217
  "feed":{
218
    "name":"",
219
    "family_id":"144",
220
    "pictureUri":"http:\/\/API server\/media\/144_9323?",
221
    "members":[
222
      {
223
        "role":"Mom",
224
        "account":{
225
          "accountId":"130",
226
          "identifiers":[
227
            {
228 2 Eric Vieillevigne
              "value":"test@facebook.com",
229 1 Eric Vieillevigne
              "validated":"true",
230
              "type":"Email"
231
            },{
232
              "value":"htc@erioxyde.com",
233
              "validated":"true",
234
              "type":"Email"
235
            },{
236
              "value":"marge",
237
              "validated":"true",
238
              "type":"ExternalId"
239
            },{
240 2 Eric Vieillevigne
              "value":"test1@gmail.com",
241 1 Eric Vieillevigne
              "validated":"true",
242
              "type":"Email"
243
            },{
244 2 Eric Vieillevigne
              "value":"test2@gmail.com",
245 1 Eric Vieillevigne
              "validated":"true",
246
              "type":"Email"
247
            }
248
          ],
249
...
250
      
251
</code></pre>
252
253
In case, the method encounter any error, the response is an exeception with specific parameters detailed below.
254
255
*Error*:
256
257
|*Error Code*|*Type*|*Value*|*Description*|
258
|FizMediaQuotaExceededException|ex|601|Media Quota exceedded|
259
|FizAccountNotFoundInSessionException|un|501|Session is invalid|
260
|FizApiInvalidParameterException|un|502|invalid token|
261
|FizApiModelDoesNotExistException|un|503|Object does not exists|
262
|FizApiModelRightException|un|504|Right exception to use this method|