Project

General

Profile

Account Management » History » Version 1

Eric Vieillevigne, 05/12/2015 01:18 PM

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