Project

General

Profile

Provisioning Management » History » Version 19

jerome bonnet, 09/17/2015 02:14 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
|email|String|Email identifier|
17
|MSISDN|String|internationalized 10 digits number|
18
|login|String|login of a valid account|
19
20
*Response*:
21
<pre><code class="javascript">
22
{
23
  "a01":{
24
    "r":{
25
      "r":"12345"
26
    },
27
    "cn":"provsearch"
28
  }
29
}
30
</code></pre>
31
The Method response is a *Long* which represents the _AccountId_ of the account searched. 
32
33
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
34
35
*Error*:
36
37
|*Error Code*|*Type*|*Value*|*Description*|
38
|FizApiAccIdentifierInvalidException |Ex|21|User does not exist|
39 3 Eric Vieillevigne
40
41 5 Eric Vieillevigne
h2. Create Family - _provcreatefamily_
42 3 Eric Vieillevigne
43 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.
44 3 Eric Vieillevigne
45
By sending an HTTP request http://devserver/api/prov/createfamily
46
47
*Parameters*:
48
49
|*Name*|*Type*|*Description*|
50 1 Eric Vieillevigne
|FamilyName|String|Name of the Family|
51 19 jerome bonnet
|FamilyImage|file|Binary file of Family image (optional)|
52
|founderId|Long|account id of the founder of this family
53 1 Eric Vieillevigne
54 19 jerome bonnet
*Response*:
55
<pre><code class="javascript">
56
{
57
    a00 : {
58
        r : {
59
            r : {
60
                coverDefault :  false,
61
                family_id :  61,
62
                pictureDefault :  false,
63
                metaId :  family/61,
64
                members : [
65
                    {
66
                        familyId :  family/61,
67
                        joinDate :  2014-01-03T13:43:09.000Z,
68
                        role :  Dad,
69
                        metaId :  familymember/42_61,
70
                        isFirstFamily :  true,
71
                        lastLoginDate :  2015-09-16T14:46:10.000Z,
72
                        right :  SuperAdmin,
73
                        account : {
74
                            accountId :  42,
75
                            deleted :  false,
76
                            identifiers : [
77
                                {
78
                                    validated :  false,
79
                                    id :  63,
80
                                    type :  Login,
81
                                    value :  homersimpsontest
82
                                }
83
                            ],
84
                            name :  founder,
85
                            lastLoginDate :  2015-09-16T16:05:15.000Z,
86
                            creationDate :  2014-01-03T13:43:06.000Z,
87
                            termsChecked :  true
88
                        }
89
                    }
90
                ],
91
                name :  Simpson12,
92
                pictureUri :  http://localhost:8080/media/61_20ck56bl_43?,
93
                coverUri :  http://localhost:8080/media/61_8cz2k3bk_3222?
94
            }
95
        },
96
        cn :  provcreatefamily
97
}
98
</code></pre>
99
The Method response is the created family.
100 1 Eric Vieillevigne
101 19 jerome bonnet
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
102
103
*Error*:
104
105
|*Error Code*|*Type*|*Value*|*Description*|
106
|AFizApiUnattendedException|Ex|21|Unknown exception|
107
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
|Type|String|Email,phone,login|
120
|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
|AFizFamilyNotEmpty|Ex|31|Family contains members|
280
281
282
h2. Create Account - _provcreateaccount_
283
284
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.
285
286
By sending an HTTP request http://devserver/api/prov/createaccount?type=Email&identifier=test@gmail.com&countryCode=FR
287 13 Eric Vieillevigne
&accountType=2&locale=FR&familyId=12345&UserName=myFirstName&Locale=fr
288 1 Eric Vieillevigne
289
*Parameters*:
290
291 17 jerome bonnet
|*Name*|*Type*|*Description*|
292 10 Eric Vieillevigne
|familyId|Long|Family Id where the member shall be added|
293 17 jerome bonnet
|Type|String|Email,phone,login|
294
|Identifier|String|User Identifier Email or MSISDN depending on the type|
295 10 Eric Vieillevigne
|UserName|String|User First Name|
296 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.|
297
|AccountType|Long|Account Type (None,Admin,SuperAdmin) None=normal member, Admin=administrator, SuperAdmin= founder|
298
|Picture|file|Binary file of picture for the user (optional)|
299 17 jerome bonnet
300 10 Eric Vieillevigne
*Response*:
301
<pre><code class="javascript">
302
{
303
  "a01":{
304 17 jerome bonnet
    "r":{
305 19 jerome bonnet
      "r": {
306
				accountId :  42,
307
				deleted :  false,
308
				identifiers : [
309
					{
310
						validated :  false,
311
						id :  63,
312
						type :  Login,
313
						value :  homersimpsontest
314
					}
315
				],
316
				name :  founder,
317
				lastLoginDate :  2015-09-16T16:05:15.000Z,
318
				creationDate :  2014-01-03T13:43:06.000Z,
319
				termsChecked :  true
320
			}
321 1 Eric Vieillevigne
    },
322
    "cn":"provcreateaccount"
323
  }
324
}
325
</code></pre>
326
The Method response is a *Long* which represents the _AccountId_ of the account created. 
327
328
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
329
330
*Error*:
331
332
|*Error Code*|*Type*|*Value*|*Description*|
333 19 jerome bonnet
|FizFamilyDoesNotExistException|Ex|510|Family Id Does not Exists|
334 1 Eric Vieillevigne
|FizAccountAlreadyExistsException |Ex|2|Account Identifier already exists|
335 19 jerome bonnet
|FizFounderAlreadyExistsException |Ex|ccc|Founder already exists|
336 1 Eric Vieillevigne
|AFizInvalidIdentifierException|Ex|21|Identifier has an invalid format|
337
|AFizInvalidEmailException|Ex|17|Email has an invalid format|
338 17 jerome bonnet
|AFizInvalidMSISDNException|Ex|22|MSISDN has an invalid format|
339
340
h2. Update Account - _provupdateaccount_
341
342
This method update a member for a family and set the member type (member=(0),administrator=(1),founder=(2)). 
343
344
By sending an HTTP request http://devserver/api/prov/updateaccount?UserCountryCode=FR
345
&AccountType=2&locale=FR&UserName=myNewFirstName&Locale=fr&accountId=123455
346
347
*Parameters*:
348
349
|*Name*|*Type*|*Description*|
350
|accountId|Long|Account Id of the modified account|
351
|UserName|String|User First Name|
352
|UserCountryCode|String|Country Code International Two letters|
353
|Locale|String|Country Code International Two letters|
354
355
356
*Response*:
357
<pre><code class="javascript">
358
{
359
  "a01":{
360 1 Eric Vieillevigne
    "r":{
361 19 jerome bonnet
      "r": {
362
                            accountId :  42,
363
                            deleted :  false,
364
                            identifiers : [
365
                                {
366
                                    validated :  false,
367
                                    id :  63,
368
                                    type :  Login,
369
                                    value :  homersimpsontest
370
                                }
371
                            ],
372
                            name :  founder,
373
                            lastLoginDate :  2015-09-16T16:05:15.000Z,
374
                            creationDate :  2014-01-03T13:43:06.000Z,
375
                            termsChecked :  true
376
                        }
377 17 jerome bonnet
    },
378
    "cn":"provupdateaccount"
379
  }
380
}
381
</code></pre>
382
The Method response is a *Long* which represents the _AccountId_ of the account updated. 
383
384
In case, the method encounter any error, the response is an exception with specific parameters detailed below.
385
386
*Error*:
387
388
|*Error Code*|*Type*|*Value*|*Description*|
389
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
390
|FizAccountAlreadyExistsException |Ex|2|Account Identifier already exists|
391
|FizFounderAlreadyExistsException |Ex|15|Founder already exists|
392
|AFizInvalidIdentifierException|Ex|21|Identifier has an invalid format|
393
|AFizInvalidEmailException|Ex|17|Email has an invalid format|
394
|AFizInvalidMSISDNException|Ex|22|MSISDN has an invalid format|
395
396
h2. Add Account to family- _provaddaccount2family_
397
398
This method add an existing account to a family and set the member type (member=(0),administrator=(1),founder=(2)). 
399
400
By sending an HTTP request http://devserver/api/prov/addaccount2family?accountId=123455&familyId=333445
401
402
*Parameters*:
403
404
|*Name*|*Type*|*Description*|
405
|accountId|Long|Family Id where the member shall added|
406
|familyId|Long|Family Id where the member shall be added|
407 19 jerome bonnet
|AccountType|Long|Account Type (None,Admin,SuperAdmin) None=normal member, Admin=administrator, SuperAdmin= founder|
408 17 jerome bonnet
409
*Response*:
410
<pre><code class="javascript">
411
{
412
  "a01":{
413
    "r":{
414
      "r":"true"
415
    },
416
    "cn":"provupdateaccount"
417 1 Eric Vieillevigne
  }
418 17 jerome bonnet
}
419
</code></pre>
420
The Method response is true when the operation is successful. 
421
422
In case the method encounter any error, the response is an exception with specific parameters detailed below.
423
424
*Error*:
425
426 1 Eric Vieillevigne
|*Error Code*|*Type*|*Value*|*Description*|
427
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
428
|FizFounderAlreadyExistsException |Ex|15|Founder already exists|
429
430
h2. Remove Account from family- _provremoveaccount2family_
431
432 17 jerome bonnet
This method remove an existing account from a family. 
433 1 Eric Vieillevigne
434 17 jerome bonnet
By sending an HTTP request http://devserver/api/prov/removeaccount2family?accountId=123455&familyId=333445
435
436
*Parameters*:
437
438
|*Name*|*Type*|*Description*|
439
|accountId|Long|Family Id where the member shall added|
440
|familyId|Long|Family Id where the member shall be added|
441
442
*Response*:
443
<pre><code class="javascript">
444
{
445
  "a01":{
446
    "r":{
447 1 Eric Vieillevigne
      "r":"true"
448
    },
449
    "cn":"provupdateaccount"
450
  }
451
}
452
</code></pre>
453
The Method response is true when the operation is successful. 
454
455
In case the method encounter any error, the response is an exception with specific parameters detailed below.
456
457 17 jerome bonnet
*Error*:
458
459
|*Error Code*|*Type*|*Value*|*Description*|
460 1 Eric Vieillevigne
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
461
|FizFounderAlreadyExistsException |Ex|15|Founder already exists|
462 17 jerome bonnet
463
h2. Delete Account _provdeleteaccount_
464
465 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.
466 17 jerome bonnet
467
By sending an HTTP request http://devserver/api/prov/deleteaccount?accountId=123455
468
469
*Parameters*:
470
471
|*Name*|*Type*|*Description*|
472
|accountId|Long|Family Id where the member shall added|
473
474
*Response*:
475
<pre><code class="javascript">
476
{
477
  "a01":{
478
    "r":{
479
      "r":"true"
480
    },
481
    "cn":"provupdateaccount"
482
  }
483
}
484
</code></pre>
485
The Method response is true when the operation is successful. 
486
487
In case the method encounter any error, the response is an exception with specific parameters detailed below.
488
489
*Error*:
490
491
|*Error Code*|*Type*|*Value*|*Description*|
492
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
493
|FizAccountDoesNotExistException  |Un|507|Account is not found|
494
495
496
h2. get Account information _provgetaccount_
497
498
This method returns the information about an existing account, mainly the family he has subscribed to.
499
500
By sending an HTTP request http://devserver/api/prov/getaccount?accountId=123455
501
502
*Parameters*:
503
504
|*Name*|*Type*|*Description*|
505 19 jerome bonnet
|accountId|Long|Account Id where the member shall added|
506 17 jerome bonnet
507
*Response*:
508
<pre><code class="javascript">
509 19 jerome bonnet
<pre><code class="javascript">
510 17 jerome bonnet
{
511 19 jerome bonnet
  "a01":{
512
    "r":{
513 17 jerome bonnet
      "r": {
514 19 jerome bonnet
				accountId :  42,
515
				deleted :  false,
516
				identifiers : [
517
					{
518
						validated :  false,
519
						id :  63,
520
						type :  Login,
521
						value :  homersimpsontest
522
					}
523 17 jerome bonnet
				],
524 19 jerome bonnet
				name :  founder,
525
				lastLoginDate :  2015-09-16T16:05:15.000Z,
526
				creationDate :  2014-01-03T13:43:06.000Z,
527
				termsChecked :  true
528
			}
529 17 jerome bonnet
    },
530 19 jerome bonnet
    "cn":"provcreateaccount"
531 17 jerome bonnet
  }
532 19 jerome bonnet
}
533 17 jerome bonnet
</code></pre>
534
535
In case the method encounter any error, the response is an exception with specific parameters detailed below.
536
537 1 Eric Vieillevigne
*Error*:
538
539
|*Error Code*|*Type*|*Value*|*Description*|
540
|AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists|
541
|FizAccountDoesNotExistException  |Un|507|Account is not found|