Project

General

Profile

Provisioning Management » History » Version 20

jerome bonnet, 09/17/2015 02:22 PM

1 1 Eric Vieillevigne
{{>toc}}
2
3 18 Eric Vieillevigne
h1. Provisioning Management - _*prov*_ Method
4 2 Eric Vieillevigne
5
Provisionning Management allows a thirdParty Application to create, update, delete an account of FamilyWall, Set the member profile right, set member premium type and select/update the services enable for such user. 
6
7
h2. Search User - _provsearch_
8
9
This method returns the accountId of a Valid user by Identifiers (email, login or MSISDN)
10
11 4 Eric Vieillevigne
By sending an HTTP request http://devserver/api/prov/search?identifier=test@gmail.com
12 2 Eric Vieillevigne
13
*Parameters*:
14
15
|*Name*|*Type*|*Description*|
16 20 jerome bonnet
|identifier|String|value of identifier to search for|
17
|Type|Enum|Email,Msisdn,Login|
18 2 Eric Vieillevigne
19
*Response*:
20
<pre><code class="javascript">
21
{
22
  "a01":{
23
    "r":{
24
      "r":"12345"
25
    },
26
    "cn":"provsearch"
27
  }
28
}
29
</code></pre>
30
The Method response is a *Long* which represents the _AccountId_ of the account searched. 
31
32
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
33
34 1 Eric Vieillevigne
*Error*:
35 2 Eric Vieillevigne
36
|*Error Code*|*Type*|*Value*|*Description*|
37 20 jerome bonnet
|FizApiAccIdentifierInvalidException |Ex|21|identifier wrong format|
38
|FizAccountNotFoundException |Ex|1|account not found|
39 3 Eric Vieillevigne
40 5 Eric Vieillevigne
h2. Create Family - _provcreatefamily_
41 3 Eric Vieillevigne
42 19 jerome bonnet
This method create a family with a founder member. A family cannot exist without at least one member, therefore founderId parameter is mandatory.
43 3 Eric Vieillevigne
44
By sending an HTTP request http://devserver/api/prov/createfamily
45
46 1 Eric Vieillevigne
*Parameters*:
47 3 Eric Vieillevigne
48
|*Name*|*Type*|*Description*|
49 1 Eric Vieillevigne
|FamilyName|String|Name of the Family|
50 19 jerome bonnet
|FamilyImage|file|Binary file of Family image (optional)|
51 20 jerome bonnet
|founderId|Long|account id of the founder of this family|
52 1 Eric Vieillevigne
53 19 jerome bonnet
*Response*:
54
<pre><code class="javascript">
55
{
56
    a00 : {
57
        r : {
58
            r : {
59
                coverDefault :  false,
60
                family_id :  61,
61
                pictureDefault :  false,
62
                metaId :  family/61,
63
                members : [
64
                    {
65
                        familyId :  family/61,
66
                        joinDate :  2014-01-03T13:43:09.000Z,
67
                        role :  Dad,
68
                        metaId :  familymember/42_61,
69
                        isFirstFamily :  true,
70
                        lastLoginDate :  2015-09-16T14:46:10.000Z,
71
                        right :  SuperAdmin,
72
                        account : {
73
                            accountId :  42,
74
                            deleted :  false,
75
                            identifiers : [
76
                                {
77
                                    validated :  false,
78
                                    id :  63,
79
                                    type :  Login,
80
                                    value :  homersimpsontest
81
                                }
82
                            ],
83
                            name :  founder,
84
                            lastLoginDate :  2015-09-16T16:05:15.000Z,
85
                            creationDate :  2014-01-03T13:43:06.000Z,
86
                            termsChecked :  true
87
                        }
88
                    }
89
                ],
90
                name :  Simpson12,
91
                pictureUri :  http://localhost:8080/media/61_20ck56bl_43?,
92
                coverUri :  http://localhost:8080/media/61_8cz2k3bk_3222?
93
            }
94
        },
95
        cn :  provcreatefamily
96
}
97
</code></pre>
98
The Method response is the created family.
99 1 Eric Vieillevigne
100
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
101 19 jerome bonnet
102
*Error*:
103
104
|*Error Code*|*Type*|*Value*|*Description*|
105
|AFizApiUnattendedException|Ex|21|Unknown exception|
106 20 jerome bonnet
|FizAccountNotFoundException |Ex|1|account not found|
107 19 jerome bonnet
108
h2. Create Family - _provfoundfamily_
109
110
This method create both a user and a family. Because a family cannot exist without a founder and an account must be in at least one family, in order to avoid the chicken-and-egg problem, this api allows to create both objects at the same time.
111
112
By sending an HTTP request http://devserver/api/prov/createfamily
113
114
*Parameters*:
115
116
|*Name*|*Type*|*Description*|
117
|FamilyName|String|Name of the Family|
118
|FamilyImage|file|Binary file of Family image (optional)|
119 20 jerome bonnet
|Type|Enum|Email,Msisdn,Login|
120 19 jerome bonnet
|Identifier|String|User Identifier Email or MSISDN depending on the type|
121
|Firstname|String|User First Name|
122
|Locale|String|Country Code International as 2 letters language code as ISO 639  and 2 letters country code as ISO 3166 separated by an underscore or a dash.|
123
|Picture|file|Binary file of picture for the user (optional)|
124
125 1 Eric Vieillevigne
*Response*:
126
<pre><code class="javascript">
127
{
128 19 jerome bonnet
    a00 : {
129
        r : {
130
            r : {
131
                coverDefault :  false,
132
                family_id :  61,
133
                pictureDefault :  false,
134
                metaId :  family/61,
135
                members : [
136
                    {
137
                        familyId :  family/61,
138
                        joinDate :  2014-01-03T13:43:09.000Z,
139
                        role :  Dad,
140
                        metaId :  familymember/42_61,
141
                        isFirstFamily :  true,
142
                        lastLoginDate :  2015-09-16T14:46:10.000Z,
143
                        right :  SuperAdmin,
144
                        account : {
145
                            accountId :  42,
146
                            deleted :  false,
147
                            identifiers : [
148
                                {
149
                                    validated :  false,
150
                                    id :  63,
151
                                    type :  Login,
152
                                    value :  homersimpsontest
153
                                }
154
                            ],
155
                            name :  founder,
156
                            lastLoginDate :  2015-09-16T16:05:15.000Z,
157
                            creationDate :  2014-01-03T13:43:06.000Z,
158
                            termsChecked :  true
159
                        }
160
                    }
161
                ],
162
                name :  Simpson12,
163
                pictureUri :  http://localhost:8080/media/61_20ck56bl_43?,
164
                coverUri :  http://localhost:8080/media/61_8cz2k3bk_3222?
165
            }
166
        },
167
        cn :  provfoundfamily
168 1 Eric Vieillevigne
}
169
</code></pre>
170
171
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
172
173
*Error*:
174
175
|*Error Code*|*Type*|*Value*|*Description*|
176
|AFizApiUnattendedException|Ex|21|Unknown exception|
177
178
h2. Update Family - _provupdatefamily_
179
180 19 jerome bonnet
This method update a family to change the name or picture of a family.
181 1 Eric Vieillevigne
182
By sending an HTTP request http://devserver/api/prov/updatefamily?familyId=12345
183
184
*Parameters*:
185
186
|*Name*|*Type*|*Description*|
187
188
|FamilyName|String|Name of the Family|
189
|familyId|Long|Family Id |
190
|FamilyImage|file|Binary file of Family image|
191
192
*Response*:
193
<pre><code class="javascript">
194
{
195 19 jerome bonnet
    a00 : {
196
        r : {
197
            r : {
198
                coverDefault :  false,
199
                family_id :  61,
200
                pictureDefault :  false,
201
                metaId :  family/61,
202
                members : [
203
                    {
204
                        familyId :  family/61,
205
                        joinDate :  2014-01-03T13:43:09.000Z,
206
                        role :  Dad,
207
                        metaId :  familymember/42_61,
208
                        isFirstFamily :  true,
209
                        lastLoginDate :  2015-09-16T14:46:10.000Z,
210
                        right :  SuperAdmin,
211
                        account : {
212
                            accountId :  42,
213
                            deleted :  false,
214
                            identifiers : [
215
                                {
216
                                    validated :  false,
217
                                    id :  63,
218
                                    type :  Login,
219
                                    value :  homersimpsontest
220
                                }
221
                            ],
222
                            name :  founder,
223
                            lastLoginDate :  2015-09-16T16:05:15.000Z,
224
                            creationDate :  2014-01-03T13:43:06.000Z,
225
                            termsChecked :  true
226
                        }
227
                    }
228
                ],
229
                name :  Simpson12,
230
                pictureUri :  http://localhost:8080/media/61_20ck56bl_43?,
231
                coverUri :  http://localhost:8080/media/61_8cz2k3bk_3222?
232
            }
233
        },
234
        cn :  provupdatefamily
235 1 Eric Vieillevigne
}
236 17 jerome bonnet
</code></pre>
237 19 jerome bonnet
The Method response is the updated family. 
238 17 jerome bonnet
239
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
240
241
*Error*:
242
243
|*Error Code*|*Type*|*Value*|*Description*|
244
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
245
246
247
h2. Delete Family - _provdeletefamily_
248
249 19 jerome bonnet
This method remove a family and all his contents. If the family have members, they are removed from the family. If, as a result from this operation, some members are left without a family, they are deleted, too.
250 17 jerome bonnet
251
By sending an HTTP request http://devserver/api/prov/deletefamily?familyId=12345
252
253
*Parameters*:
254
255 1 Eric Vieillevigne
|*Name*|*Type*|*Description*|
256
257
|familyId|Long|Family Id |
258 17 jerome bonnet
259
260
*Response*:
261
<pre><code class="javascript">
262 1 Eric Vieillevigne
{
263
  "a01":{
264
    "r":{
265
      "r":"true"
266
    },
267 19 jerome bonnet
    "cn":"provdeletefamily"
268 1 Eric Vieillevigne
  }
269
}
270
</code></pre>
271
The Method response is true when the operation is successful. 
272
273
In case the method encounter any error, the response is an exception with specific parameters detailed below.
274
275
*Error*:
276
277
|*Error Code*|*Type*|*Value*|*Description*|
278 17 jerome bonnet
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
279
280
281
h2. Create Account - _provcreateaccount_
282
283 1 Eric Vieillevigne
This method create a member for a family and set the member type (member=(0),adminsitrator=(1),founder=(2)). Note that after this method, the user receive an invitation email or an SMS with link to complete the account creation.
284 17 jerome bonnet
285 20 jerome bonnet
By sending an HTTP request http://devserver/api/prov/createaccount?type=Email&identifier=test@gmail.com
286 1 Eric Vieillevigne
&accountType=2&locale=FR&familyId=12345&UserName=myFirstName&Locale=fr
287
288
*Parameters*:
289
290 17 jerome bonnet
|*Name*|*Type*|*Description*|
291 10 Eric Vieillevigne
|familyId|Long|Family Id where the member shall be added|
292 20 jerome bonnet
|Type|Enum|Email,Msisdn,Login|
293 17 jerome bonnet
|Identifier|String|User Identifier Email or MSISDN depending on the type|
294 10 Eric Vieillevigne
|UserName|String|User First Name|
295 19 jerome bonnet
|Locale|String|Country Code International as 2 letters language code as ISO 639  and 2 letters country code as ISO 3166 separated by an underscore or a dash.|
296 20 jerome bonnet
|AccountType|Enum|Account Type (None,Admin,SuperAdmin) None=normal member, Admin=administrator, SuperAdmin= founder|
297 19 jerome bonnet
|Picture|file|Binary file of picture for the user (optional)|
298 17 jerome bonnet
299 10 Eric Vieillevigne
*Response*:
300
<pre><code class="javascript">
301
{
302
  "a01":{
303 17 jerome bonnet
    "r":{
304 19 jerome bonnet
      "r": {
305
				accountId :  42,
306
				deleted :  false,
307
				identifiers : [
308
					{
309
						validated :  false,
310
						id :  63,
311
						type :  Login,
312
						value :  homersimpsontest
313
					}
314
				],
315
				name :  founder,
316
				lastLoginDate :  2015-09-16T16:05:15.000Z,
317
				creationDate :  2014-01-03T13:43:06.000Z,
318
				termsChecked :  true
319
			}
320 1 Eric Vieillevigne
    },
321
    "cn":"provcreateaccount"
322
  }
323
}
324
</code></pre>
325
The Method response is a *Long* which represents the _AccountId_ of the account created. 
326
327
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
328
329
*Error*:
330
331
|*Error Code*|*Type*|*Value*|*Description*|
332
|FizFamilyDoesNotExistException|Ex|510|Family Id Does not Exists|
333 19 jerome bonnet
|FizAccountAlreadyExistsException |Ex|2|Account Identifier already exists|
334 1 Eric Vieillevigne
|FizFounderAlreadyExistsException |Ex|ccc|Founder already exists|
335
|AFizInvalidIdentifierException|Ex|21|Identifier has an invalid format|
336 17 jerome bonnet
|AFizInvalidEmailException|Ex|17|Email has an invalid format|
337
|AFizInvalidMSISDNException|Ex|22|MSISDN has an invalid format|
338 1 Eric Vieillevigne
339 17 jerome bonnet
h2. Update Account - _provupdateaccount_
340
341
This method update a member for a family and set the member type (member=(0),administrator=(1),founder=(2)). 
342
343 20 jerome bonnet
By sending an HTTP request http://devserver/api/prov/updateaccount?locale=FR&UserName=myNewFirstName&Locale=fr&accountId=123455
344 17 jerome bonnet
345
*Parameters*:
346
347
|*Name*|*Type*|*Description*|
348
|accountId|Long|Account Id of the modified account|
349
|UserName|String|User First Name|
350
|Locale|String|Country Code International Two letters|
351 20 jerome bonnet
|Picture|file|Binary file of picture for the user (optional)|
352 17 jerome bonnet
353
354
*Response*:
355
<pre><code class="javascript">
356
{
357
  "a01":{
358 1 Eric Vieillevigne
    "r":{
359 19 jerome bonnet
      "r": {
360
                            accountId :  42,
361
                            deleted :  false,
362
                            identifiers : [
363
                                {
364
                                    validated :  false,
365
                                    id :  63,
366
                                    type :  Login,
367
                                    value :  homersimpsontest
368
                                }
369
                            ],
370
                            name :  founder,
371
                            lastLoginDate :  2015-09-16T16:05:15.000Z,
372
                            creationDate :  2014-01-03T13:43:06.000Z,
373
                            termsChecked :  true
374
                        }
375 17 jerome bonnet
    },
376
    "cn":"provupdateaccount"
377
  }
378
}
379
</code></pre>
380
The Method response is a *Long* which represents the _AccountId_ of the account updated. 
381
382
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
383
384
*Error*:
385
386
|*Error Code*|*Type*|*Value*|*Description*|
387
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
388
|FizAccountAlreadyExistsException |Ex|2|Account Identifier already exists|
389
|FizFounderAlreadyExistsException |Ex|15|Founder already exists|
390
|AFizInvalidIdentifierException|Ex|21|Identifier has an invalid format|
391
|AFizInvalidEmailException|Ex|17|Email has an invalid format|
392
|AFizInvalidMSISDNException|Ex|22|MSISDN has an invalid format|
393
394
h2. Add Account to family- _provaddaccount2family_
395
396
This method add an existing account to a family and set the member type (member=(0),administrator=(1),founder=(2)). 
397
398
By sending an HTTP request http://devserver/api/prov/addaccount2family?accountId=123455&familyId=333445
399
400
*Parameters*:
401
402
|*Name*|*Type*|*Description*|
403
|accountId|Long|Family Id where the member shall added|
404
|familyId|Long|Family Id where the member shall be added|
405 19 jerome bonnet
|AccountType|Long|Account Type (None,Admin,SuperAdmin) None=normal member, Admin=administrator, SuperAdmin= founder|
406 17 jerome bonnet
407
*Response*:
408
<pre><code class="javascript">
409
{
410
  "a01":{
411
    "r":{
412
      "r":"true"
413
    },
414
    "cn":"provupdateaccount"
415 1 Eric Vieillevigne
  }
416 17 jerome bonnet
}
417
</code></pre>
418
The Method response is true when the operation is successful. 
419
420
In case the method encounter any error, the response is an exception with specific parameters detailed below.
421
422
*Error*:
423
424 1 Eric Vieillevigne
|*Error Code*|*Type*|*Value*|*Description*|
425
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
426
|FizFounderAlreadyExistsException |Ex|15|Founder already exists|
427
428
h2. Remove Account from family- _provremoveaccount2family_
429
430 17 jerome bonnet
This method remove an existing account from a family. 
431 1 Eric Vieillevigne
432 17 jerome bonnet
By sending an HTTP request http://devserver/api/prov/removeaccount2family?accountId=123455&familyId=333445
433
434
*Parameters*:
435
436
|*Name*|*Type*|*Description*|
437
|accountId|Long|Family Id where the member shall added|
438
|familyId|Long|Family Id where the member shall be added|
439
440
*Response*:
441
<pre><code class="javascript">
442
{
443
  "a01":{
444
    "r":{
445 1 Eric Vieillevigne
      "r":"true"
446
    },
447
    "cn":"provupdateaccount"
448
  }
449
}
450
</code></pre>
451
The Method response is true when the operation is successful. 
452
453
In case the method encounter any error, the response is an exception with specific parameters detailed below.
454
455 17 jerome bonnet
*Error*:
456
457
|*Error Code*|*Type*|*Value*|*Description*|
458 1 Eric Vieillevigne
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
459
|FizFounderAlreadyExistsException |Ex|15|Founder already exists|
460 17 jerome bonnet
461
h2. Delete Account _provdeleteaccount_
462
463 19 jerome bonnet
This method delete an existing account. It will be removed from all his families beforehand. Families without remaining members are definitively deleted.
464 17 jerome bonnet
465
By sending an HTTP request http://devserver/api/prov/deleteaccount?accountId=123455
466
467
*Parameters*:
468
469
|*Name*|*Type*|*Description*|
470
|accountId|Long|Family Id where the member shall added|
471
472
*Response*:
473
<pre><code class="javascript">
474
{
475
  "a01":{
476
    "r":{
477
      "r":"true"
478
    },
479
    "cn":"provupdateaccount"
480
  }
481
}
482
</code></pre>
483
The Method response is true when the operation is successful. 
484
485
In case the method encounter any error, the response is an exception with specific parameters detailed below.
486
487
*Error*:
488
489
|*Error Code*|*Type*|*Value*|*Description*|
490
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
491
|FizAccountDoesNotExistException  |Un|507|Account is not found|
492
493
494
h2. get Account information _provgetaccount_
495
496
This method returns the information about an existing account, mainly the family he has subscribed to.
497
498
By sending an HTTP request http://devserver/api/prov/getaccount?accountId=123455
499
500
*Parameters*:
501
502
|*Name*|*Type*|*Description*|
503 19 jerome bonnet
|accountId|Long|Account Id where the member shall added|
504 17 jerome bonnet
505
*Response*:
506
<pre><code class="javascript">
507 19 jerome bonnet
<pre><code class="javascript">
508 17 jerome bonnet
{
509 19 jerome bonnet
  "a01":{
510
    "r":{
511 17 jerome bonnet
      "r": {
512 19 jerome bonnet
				accountId :  42,
513
				deleted :  false,
514
				identifiers : [
515
					{
516
						validated :  false,
517
						id :  63,
518
						type :  Login,
519
						value :  homersimpsontest
520
					}
521 17 jerome bonnet
				],
522 19 jerome bonnet
				name :  founder,
523
				lastLoginDate :  2015-09-16T16:05:15.000Z,
524
				creationDate :  2014-01-03T13:43:06.000Z,
525
				termsChecked :  true
526
			}
527 17 jerome bonnet
    },
528 19 jerome bonnet
    "cn":"provcreateaccount"
529 17 jerome bonnet
  }
530 19 jerome bonnet
}
531 17 jerome bonnet
</code></pre>
532
533
In case the method encounter any error, the response is an exception with specific parameters detailed below.
534
535 1 Eric Vieillevigne
*Error*:
536
537
|*Error Code*|*Type*|*Value*|*Description*|
538
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
539
|FizAccountDoesNotExistException  |Un|507|Account is not found|