Project

General

Profile

Provisioning Management » History » Version 21

jerome bonnet, 09/17/2015 02:34 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 21 jerome bonnet
|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 21 jerome bonnet
|FizAccountAlreadyExistsException |Ex|2|Account Identifier already exists|
178
|AFizInvalidIdentifierException|Ex|21|Identifier has an invalid format|
179
|AFizInvalidEmailException|Ex|17|Email has an invalid format|
180
|AFizInvalidMSISDNException|Ex|22|MSISDN has an invalid format|
181 1 Eric Vieillevigne
182
h2. Update Family - _provupdatefamily_
183
184 19 jerome bonnet
This method update a family to change the name or picture of a family.
185 1 Eric Vieillevigne
186
By sending an HTTP request http://devserver/api/prov/updatefamily?familyId=12345
187
188
*Parameters*:
189
190
|*Name*|*Type*|*Description*|
191
192
|FamilyName|String|Name of the Family|
193
|familyId|Long|Family Id |
194
|FamilyImage|file|Binary file of Family image|
195
196
*Response*:
197
<pre><code class="javascript">
198
{
199 19 jerome bonnet
    a00 : {
200
        r : {
201
            r : {
202
                coverDefault :  false,
203
                family_id :  61,
204
                pictureDefault :  false,
205
                metaId :  family/61,
206
                members : [
207
                    {
208
                        familyId :  family/61,
209
                        joinDate :  2014-01-03T13:43:09.000Z,
210
                        role :  Dad,
211
                        metaId :  familymember/42_61,
212
                        isFirstFamily :  true,
213
                        lastLoginDate :  2015-09-16T14:46:10.000Z,
214
                        right :  SuperAdmin,
215
                        account : {
216
                            accountId :  42,
217
                            deleted :  false,
218
                            identifiers : [
219
                                {
220
                                    validated :  false,
221
                                    id :  63,
222
                                    type :  Login,
223
                                    value :  homersimpsontest
224
                                }
225
                            ],
226
                            name :  founder,
227
                            lastLoginDate :  2015-09-16T16:05:15.000Z,
228
                            creationDate :  2014-01-03T13:43:06.000Z,
229
                            termsChecked :  true
230
                        }
231
                    }
232
                ],
233
                name :  Simpson12,
234
                pictureUri :  http://localhost:8080/media/61_20ck56bl_43?,
235
                coverUri :  http://localhost:8080/media/61_8cz2k3bk_3222?
236
            }
237
        },
238
        cn :  provupdatefamily
239 1 Eric Vieillevigne
}
240 17 jerome bonnet
</code></pre>
241 19 jerome bonnet
The Method response is the updated family. 
242 17 jerome bonnet
243
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
244
245
*Error*:
246 1 Eric Vieillevigne
247 17 jerome bonnet
|*Error Code*|*Type*|*Value*|*Description*|
248 21 jerome bonnet
|FizFamilyDoesNotExistException|Ex|510|Family Id Does not Exists|
249 17 jerome bonnet
250
251
h2. Delete Family - _provdeletefamily_
252
253 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.
254 17 jerome bonnet
255
By sending an HTTP request http://devserver/api/prov/deletefamily?familyId=12345
256
257
*Parameters*:
258
259 1 Eric Vieillevigne
|*Name*|*Type*|*Description*|
260
261
|familyId|Long|Family Id |
262 17 jerome bonnet
263
264
*Response*:
265
<pre><code class="javascript">
266 1 Eric Vieillevigne
{
267
  "a01":{
268
    "r":{
269
      "r":"true"
270
    },
271 19 jerome bonnet
    "cn":"provdeletefamily"
272 1 Eric Vieillevigne
  }
273
}
274
</code></pre>
275
The Method response is true when the operation is successful. 
276
277
In case the method encounter any error, the response is an exception with specific parameters detailed below.
278
279
*Error*:
280
281
|*Error Code*|*Type*|*Value*|*Description*|
282 21 jerome bonnet
|FizFamilyDoesNotExistException|Ex|510|Family Id Does not Exists|
283 17 jerome bonnet
284
285
h2. Create Account - _provcreateaccount_
286
287 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.
288 17 jerome bonnet
289 20 jerome bonnet
By sending an HTTP request http://devserver/api/prov/createaccount?type=Email&identifier=test@gmail.com
290 1 Eric Vieillevigne
&accountType=2&locale=FR&familyId=12345&UserName=myFirstName&Locale=fr
291
292
*Parameters*:
293 17 jerome bonnet
294 10 Eric Vieillevigne
|*Name*|*Type*|*Description*|
295 20 jerome bonnet
|familyId|Long|Family Id where the member shall be added|
296 1 Eric Vieillevigne
|Type|Enum|Email,Msisdn,Login|
297 17 jerome bonnet
|Identifier|String|User Identifier Email or MSISDN depending on the type|
298 10 Eric Vieillevigne
|UserName|String|User First Name|
299 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.|
300 21 jerome bonnet
|AccountType|Enum|Account Type (None,Admin,SuperAdmin) None=normal member, Admin=administrator|
301 19 jerome bonnet
|Picture|file|Binary file of picture for the user (optional)|
302 17 jerome bonnet
303 10 Eric Vieillevigne
*Response*:
304
<pre><code class="javascript">
305
{
306
  "a01":{
307 17 jerome bonnet
    "r":{
308 19 jerome bonnet
      "r": {
309
				accountId :  42,
310
				deleted :  false,
311
				identifiers : [
312
					{
313
						validated :  false,
314
						id :  63,
315
						type :  Login,
316
						value :  homersimpsontest
317
					}
318
				],
319
				name :  founder,
320
				lastLoginDate :  2015-09-16T16:05:15.000Z,
321
				creationDate :  2014-01-03T13:43:06.000Z,
322
				termsChecked :  true
323
			}
324 1 Eric Vieillevigne
    },
325
    "cn":"provcreateaccount"
326
  }
327
}
328
</code></pre>
329
The Method response is a *Long* which represents the _AccountId_ of the account created. 
330
331
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
332
333
*Error*:
334
335
|*Error Code*|*Type*|*Value*|*Description*|
336 19 jerome bonnet
|FizFamilyDoesNotExistException|Ex|510|Family Id Does not Exists|
337 1 Eric Vieillevigne
|FizAccountAlreadyExistsException |Ex|2|Account Identifier already exists|
338
|AFizInvalidIdentifierException|Ex|21|Identifier has an invalid format|
339 17 jerome bonnet
|AFizInvalidEmailException|Ex|17|Email has an invalid format|
340
|AFizInvalidMSISDNException|Ex|22|MSISDN has an invalid format|
341 1 Eric Vieillevigne
342 17 jerome bonnet
h2. Update Account - _provupdateaccount_
343
344
This method update a member for a family and set the member type (member=(0),administrator=(1),founder=(2)). 
345
346 20 jerome bonnet
By sending an HTTP request http://devserver/api/prov/updateaccount?locale=FR&UserName=myNewFirstName&Locale=fr&accountId=123455
347 17 jerome bonnet
348
*Parameters*:
349
350
|*Name*|*Type*|*Description*|
351
|accountId|Long|Account Id of the modified account|
352
|UserName|String|User First Name|
353
|Locale|String|Country Code International Two letters|
354 20 jerome bonnet
|Picture|file|Binary file of picture for the user (optional)|
355 17 jerome bonnet
356
357
*Response*:
358
<pre><code class="javascript">
359
{
360
  "a01":{
361 1 Eric Vieillevigne
    "r":{
362 19 jerome bonnet
      "r": {
363
                            accountId :  42,
364
                            deleted :  false,
365
                            identifiers : [
366
                                {
367
                                    validated :  false,
368
                                    id :  63,
369
                                    type :  Login,
370
                                    value :  homersimpsontest
371
                                }
372
                            ],
373
                            name :  founder,
374
                            lastLoginDate :  2015-09-16T16:05:15.000Z,
375
                            creationDate :  2014-01-03T13:43:06.000Z,
376
                            termsChecked :  true
377
                        }
378 17 jerome bonnet
    },
379
    "cn":"provupdateaccount"
380
  }
381
}
382
</code></pre>
383
The Method response is a *Long* which represents the _AccountId_ of the account updated. 
384 1 Eric Vieillevigne
385 17 jerome bonnet
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
386
387
*Error*:
388
389
|*Error Code*|*Type*|*Value*|*Description*|
390 21 jerome bonnet
|FizFamilyDoesNotExistException|Ex|510|Family Id Does not Exists|
391 17 jerome bonnet
|FizAccountAlreadyExistsException |Ex|2|Account Identifier already exists|
392
|FizFounderAlreadyExistsException |Ex|15|Founder already exists|
393
|AFizInvalidIdentifierException|Ex|21|Identifier has an invalid format|
394
|AFizInvalidEmailException|Ex|17|Email has an invalid format|
395
|AFizInvalidMSISDNException|Ex|22|MSISDN has an invalid format|
396
397
h2. Add Account to family- _provaddaccount2family_
398
399
This method add an existing account to a family and set the member type (member=(0),administrator=(1),founder=(2)). 
400
401 1 Eric Vieillevigne
By sending an HTTP request http://devserver/api/prov/addaccount2family?accountId=123455&familyId=333445
402 17 jerome bonnet
403
*Parameters*:
404
405
|*Name*|*Type*|*Description*|
406
|accountId|Long|Family Id where the member shall added|
407
|familyId|Long|Family Id where the member shall be added|
408 21 jerome bonnet
|AccountType|Long|Account Type (None,Admin,SuperAdmin) None=normal member, Admin=administrator|
409 17 jerome bonnet
410
*Response*:
411
<pre><code class="javascript">
412
{
413
  "a01":{
414
    "r":{
415
      "r":"true"
416
    },
417
    "cn":"provupdateaccount"
418
  }
419 1 Eric Vieillevigne
}
420
</code></pre>
421
The Method response is true when the operation is successful. 
422 17 jerome bonnet
423
In case the method encounter any error, the response is an exception with specific parameters detailed below.
424
425
*Error*:
426
427
|*Error Code*|*Type*|*Value*|*Description*|
428 21 jerome bonnet
|FizFamilyDoesNotExistException|Ex|510|Family Id Does not Exists|
429
|FizAccountNotFoundException |Ex|1|account not found|
430
|FizAccountAlreadyInThisFamilyException |Ex|12|ccount already in the family|
431 1 Eric Vieillevigne
432
h2. Remove Account from family- _provremoveaccount2family_
433
434 17 jerome bonnet
This method remove an existing account from a family. 
435 1 Eric Vieillevigne
436 17 jerome bonnet
By sending an HTTP request http://devserver/api/prov/removeaccount2family?accountId=123455&familyId=333445
437
438
*Parameters*:
439
440
|*Name*|*Type*|*Description*|
441
|accountId|Long|Family Id where the member shall added|
442
|familyId|Long|Family Id where the member shall be added|
443
444
*Response*:
445
<pre><code class="javascript">
446
{
447
  "a01":{
448
    "r":{
449 1 Eric Vieillevigne
      "r":"true"
450
    },
451
    "cn":"provupdateaccount"
452
  }
453
}
454
</code></pre>
455
The Method response is true when the operation is successful. 
456
457
In case the method encounter any error, the response is an exception with specific parameters detailed below.
458
459 17 jerome bonnet
*Error*:
460
461
|*Error Code*|*Type*|*Value*|*Description*|
462 21 jerome bonnet
|FizFamilyDoesNotExistException|Ex|510|Family Id Does not Exists|
463
|FizAccountNotFoundException |Ex|1|account not found|
464 17 jerome bonnet
465
h2. Delete Account _provdeleteaccount_
466
467 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.
468 17 jerome bonnet
469
By sending an HTTP request http://devserver/api/prov/deleteaccount?accountId=123455
470
471
*Parameters*:
472
473
|*Name*|*Type*|*Description*|
474
|accountId|Long|Family Id where the member shall added|
475
476
*Response*:
477
<pre><code class="javascript">
478
{
479
  "a01":{
480
    "r":{
481 1 Eric Vieillevigne
      "r":"true"
482 17 jerome bonnet
    },
483
    "cn":"provupdateaccount"
484
  }
485
}
486
</code></pre>
487
The Method response is true when the operation is successful. 
488
489
In case the method encounter any error, the response is an exception with specific parameters detailed below.
490
491
*Error*:
492 1 Eric Vieillevigne
493 17 jerome bonnet
|*Error Code*|*Type*|*Value*|*Description*|
494 21 jerome bonnet
|FizAccountNotFoundException |Ex|1|account not found|
495 17 jerome bonnet
496
497
h2. get Account information _provgetaccount_
498
499
This method returns the information about an existing account, mainly the family he has subscribed to.
500
501
By sending an HTTP request http://devserver/api/prov/getaccount?accountId=123455
502
503
*Parameters*:
504
505 19 jerome bonnet
|*Name*|*Type*|*Description*|
506 21 jerome bonnet
|accountId|Long|Account Id of the account|
507 17 jerome bonnet
508
*Response*:
509 19 jerome bonnet
<pre><code class="javascript">
510 17 jerome bonnet
{
511 19 jerome bonnet
  "a01":{
512
    "r":{
513
      "r": {
514 1 Eric Vieillevigne
				accountId :  42,
515 19 jerome bonnet
				deleted :  false,
516
				identifiers : [
517
					{
518
						validated :  false,
519
						id :  63,
520
						type :  Login,
521
						value :  homersimpsontest
522 1 Eric Vieillevigne
					}
523
				],
524
				name :  founder,
525
				lastLoginDate :  2015-09-16T16:05:15.000Z,
526
				creationDate :  2014-01-03T13:43:06.000Z,
527
				termsChecked :  true
528
			}
529
    },
530 21 jerome bonnet
    "cn":"provgetaccount"
531 1 Eric Vieillevigne
  }
532
}
533
</code></pre>
534
535
In case the method encounter any error, the response is an exception with specific parameters detailed below.
536
537
*Error*:
538
539
|*Error Code*|*Type*|*Value*|*Description*|
540 21 jerome bonnet
|FizAccountNotFoundException |Ex|1|account not found|
541
542
543
h2. get family information _provgetfamily_
544
545
This method returns the information about an existing family, mainly all the members.
546
547
By sending an HTTP request http://devserver/api/prov/getfamily?familyId=123455
548
549
*Parameters*:
550
551
|*Name*|*Type*|*Description*|
552
|familyId|Long|Family Id of the family|
553
554
*Response*:
555
<pre><code class="javascript">
556
{
557
    a00 : {
558
        r : {
559
            r : {
560
                coverDefault :  false,
561
                family_id :  61,
562
                pictureDefault :  false,
563
                metaId :  family/61,
564
                members : [
565
                    {
566
                        familyId :  family/61,
567
                        joinDate :  2014-01-03T13:43:09.000Z,
568
                        role :  Dad,
569
                        metaId :  familymember/42_61,
570
                        isFirstFamily :  true,
571
                        lastLoginDate :  2015-09-16T14:46:10.000Z,
572
                        right :  SuperAdmin,
573
                        account : {
574
                            accountId :  42,
575
                            deleted :  false,
576
                            identifiers : [
577
                                {
578
                                    validated :  false,
579
                                    id :  63,
580
                                    type :  Login,
581
                                    value :  homersimpsontest
582
                                }
583
                            ],
584
                            name :  founder,
585
                            lastLoginDate :  2015-09-16T16:05:15.000Z,
586
                            creationDate :  2014-01-03T13:43:06.000Z,
587
                            termsChecked :  true
588
                        }
589
                    }
590
                ],
591
                name :  Simpson12,
592
                pictureUri :  http://localhost:8080/media/61_20ck56bl_43?,
593
                coverUri :  http://localhost:8080/media/61_8cz2k3bk_3222?
594
            }
595
        },
596
        cn :  provgetfamily
597
}
598
</code></pre>
599
600
In case the method encounter any error, the response is an exception with specific parameters detailed below.
601
602
*Error*:
603
604
|*Error Code*|*Type*|*Value*|*Description*|
605
|FizFamilyDoesNotExistException|Ex|510|Family Id Does not Exists|
606
|FizAccountNotFoundException |Ex|1|account not found|