Project

General

Profile

Provisioning Management » History » Revision 20

Revision 19 (jerome bonnet, 09/17/2015 02:14 PM) → Revision 20/26 (jerome bonnet, 09/17/2015 02:22 PM)

{{>toc}} 

 h1. Provisioning Management - _*prov*_ Method 

 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.  

 h2. Search User - _provsearch_ 

 This method returns the accountId of a Valid user by Identifiers (email, login or MSISDN) 

 By sending an HTTP request http://devserver/api/prov/search?identifier=test@gmail.com 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |identifier|String|value |email|String|Email identifier| 
 |MSISDN|String|internationalized 10 digits number| 
 |login|String|login of identifier to search for| 
 |Type|Enum|Email,Msisdn,Login| a valid account| 

 *Response*: 
 <pre><code class="javascript"> 
 { 
   "a01":{ 
     "r":{ 
       "r":"12345" 
     }, 
     "cn":"provsearch" 
   } 
 } 
 </code></pre> 
 The Method response is a *Long* which represents the _AccountId_ of the account searched.  

 In case, the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |FizApiAccIdentifierInvalidException |Ex|21|identifier wrong format| 
 |FizAccountNotFoundException |Ex|1|account |Ex|21|User does not found| 

 exist| 


 h2. Create Family - _provcreatefamily_ 

 This method create a family with a founder member. A family cannot exist without at least one member, therefore founderId parameter is mandatory. 

 By sending an HTTP request http://devserver/api/prov/createfamily 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |FamilyName|String|Name of the Family| 
 |FamilyImage|file|Binary file of Family image (optional)| 
 |founderId|Long|account id of the founder of this family| family 

 *Response*: 
 <pre><code class="javascript"> 
 { 
     a00 : { 
         r : { 
             r : { 
                 coverDefault :    false, 
                 family_id :    61, 
                 pictureDefault :    false, 
                 metaId :    family/61, 
                 members : [ 
                     { 
                         familyId :    family/61, 
                         joinDate :    2014-01-03T13:43:09.000Z, 
                         role :    Dad, 
                         metaId :    familymember/42_61, 
                         isFirstFamily :    true, 
                         lastLoginDate :    2015-09-16T14:46:10.000Z, 
                         right :    SuperAdmin, 
                         account : { 
                             accountId :    42, 
                             deleted :    false, 
                             identifiers : [ 
                                 { 
                                     validated :    false, 
                                     id :    63, 
                                     type :    Login, 
                                     value :    homersimpsontest 
                                 } 
                             ], 
                             name :    founder, 
                             lastLoginDate :    2015-09-16T16:05:15.000Z, 
                             creationDate :    2014-01-03T13:43:06.000Z, 
                             termsChecked :    true 
                         } 
                     } 
                 ], 
                 name :    Simpson12, 
                 pictureUri :    http://localhost:8080/media/61_20ck56bl_43?, 
                 coverUri :    http://localhost:8080/media/61_8cz2k3bk_3222? 
             } 
         }, 
         cn :    provcreatefamily 
 } 
 </code></pre> 
 The Method response is the created family. 

 In case, the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |AFizApiUnattendedException|Ex|21|Unknown exception| 
 |FizAccountNotFoundException |Ex|1|account not found| 

 h2. Create Family - _provfoundfamily_ 

 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. 

 By sending an HTTP request http://devserver/api/prov/createfamily 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |FamilyName|String|Name of the Family| 
 |FamilyImage|file|Binary file of Family image (optional)| 
 |Type|Enum|Email,Msisdn,Login| |Type|String|Email,phone,login| 
 |Identifier|String|User Identifier Email or MSISDN depending on the type| 
 |Firstname|String|User First Name| 
 |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.| 
 |Picture|file|Binary file of picture for the user (optional)| 

 *Response*: 
 <pre><code class="javascript"> 
 { 
     a00 : { 
         r : { 
             r : { 
                 coverDefault :    false, 
                 family_id :    61, 
                 pictureDefault :    false, 
                 metaId :    family/61, 
                 members : [ 
                     { 
                         familyId :    family/61, 
                         joinDate :    2014-01-03T13:43:09.000Z, 
                         role :    Dad, 
                         metaId :    familymember/42_61, 
                         isFirstFamily :    true, 
                         lastLoginDate :    2015-09-16T14:46:10.000Z, 
                         right :    SuperAdmin, 
                         account : { 
                             accountId :    42, 
                             deleted :    false, 
                             identifiers : [ 
                                 { 
                                     validated :    false, 
                                     id :    63, 
                                     type :    Login, 
                                     value :    homersimpsontest 
                                 } 
                             ], 
                             name :    founder, 
                             lastLoginDate :    2015-09-16T16:05:15.000Z, 
                             creationDate :    2014-01-03T13:43:06.000Z, 
                             termsChecked :    true 
                         } 
                     } 
                 ], 
                 name :    Simpson12, 
                 pictureUri :    http://localhost:8080/media/61_20ck56bl_43?, 
                 coverUri :    http://localhost:8080/media/61_8cz2k3bk_3222? 
             } 
         }, 
         cn :    provfoundfamily 
 } 
 </code></pre> 

 In case, the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |AFizApiUnattendedException|Ex|21|Unknown exception| 

 h2. Update Family - _provupdatefamily_ 

 This method update a family to change the name or picture of a family. 

 By sending an HTTP request http://devserver/api/prov/updatefamily?familyId=12345 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 

 |FamilyName|String|Name of the Family| 
 |familyId|Long|Family Id | 
 |FamilyImage|file|Binary file of Family image| 

 *Response*: 
 <pre><code class="javascript"> 
 { 
     a00 : { 
         r : { 
             r : { 
                 coverDefault :    false, 
                 family_id :    61, 
                 pictureDefault :    false, 
                 metaId :    family/61, 
                 members : [ 
                     { 
                         familyId :    family/61, 
                         joinDate :    2014-01-03T13:43:09.000Z, 
                         role :    Dad, 
                         metaId :    familymember/42_61, 
                         isFirstFamily :    true, 
                         lastLoginDate :    2015-09-16T14:46:10.000Z, 
                         right :    SuperAdmin, 
                         account : { 
                             accountId :    42, 
                             deleted :    false, 
                             identifiers : [ 
                                 { 
                                     validated :    false, 
                                     id :    63, 
                                     type :    Login, 
                                     value :    homersimpsontest 
                                 } 
                             ], 
                             name :    founder, 
                             lastLoginDate :    2015-09-16T16:05:15.000Z, 
                             creationDate :    2014-01-03T13:43:06.000Z, 
                             termsChecked :    true 
                         } 
                     } 
                 ], 
                 name :    Simpson12, 
                 pictureUri :    http://localhost:8080/media/61_20ck56bl_43?, 
                 coverUri :    http://localhost:8080/media/61_8cz2k3bk_3222? 
             } 
         }, 
         cn :    provupdatefamily 
 } 
 </code></pre> 
 The Method response is the updated family.  

 In case, the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists| 


 h2. Delete Family - _provdeletefamily_ 

 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. 

 By sending an HTTP request http://devserver/api/prov/deletefamily?familyId=12345 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 

 |familyId|Long|Family Id | 


 *Response*: 
 <pre><code class="javascript"> 
 { 
   "a01":{ 
     "r":{ 
       "r":"true" 
     }, 
     "cn":"provdeletefamily" 
   } 
 } 
 </code></pre> 
 The Method response is true when the operation is successful.  

 In case the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists| 
 |AFizFamilyNotEmpty|Ex|31|Family contains members| 


 h2. Create Account - _provcreateaccount_ 

 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. 

 By sending an HTTP request http://devserver/api/prov/createaccount?type=Email&identifier=test@gmail.com http://devserver/api/prov/createaccount?type=Email&identifier=test@gmail.com&countryCode=FR 
 &accountType=2&locale=FR&familyId=12345&UserName=myFirstName&Locale=fr 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |familyId|Long|Family Id where the member shall be added| 
 |Type|Enum|Email,Msisdn,Login| |Type|String|Email,phone,login| 
 |Identifier|String|User Identifier Email or MSISDN depending on the type| 
 |UserName|String|User First Name| 
 |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.| 
 |AccountType|Enum|Account |AccountType|Long|Account Type (None,Admin,SuperAdmin) None=normal member, Admin=administrator, SuperAdmin= founder| 
 |Picture|file|Binary file of picture for the user (optional)| 

 *Response*: 
 <pre><code class="javascript"> 
 { 
   "a01":{ 
     "r":{ 
       "r": { 
				 accountId :    42, 
				 deleted :    false, 
				 identifiers : [ 
					 { 
						 validated :    false, 
						 id :    63, 
						 type :    Login, 
						 value :    homersimpsontest 
					 } 
				 ], 
				 name :    founder, 
				 lastLoginDate :    2015-09-16T16:05:15.000Z, 
				 creationDate :    2014-01-03T13:43:06.000Z, 
				 termsChecked :    true 
			 } 
     }, 
     "cn":"provcreateaccount" 
   } 
 } 
 </code></pre> 
 The Method response is a *Long* which represents the _AccountId_ of the account created.  

 In case, the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |FizFamilyDoesNotExistException|Ex|510|Family Id Does not Exists| 
 |FizAccountAlreadyExistsException |Ex|2|Account Identifier already exists| 
 |FizFounderAlreadyExistsException |Ex|ccc|Founder already exists| 
 |AFizInvalidIdentifierException|Ex|21|Identifier has an invalid format| 
 |AFizInvalidEmailException|Ex|17|Email has an invalid format| 
 |AFizInvalidMSISDNException|Ex|22|MSISDN has an invalid format| 

 h2. Update Account - _provupdateaccount_ 

 This method update a member for a family and set the member type (member=(0),administrator=(1),founder=(2)).  

 By sending an HTTP request http://devserver/api/prov/updateaccount?locale=FR&UserName=myNewFirstName&Locale=fr&accountId=123455 http://devserver/api/prov/updateaccount?UserCountryCode=FR 
 &AccountType=2&locale=FR&UserName=myNewFirstName&Locale=fr&accountId=123455 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |accountId|Long|Account Id of the modified account| 
 |UserName|String|User First Name| 
 |UserCountryCode|String|Country Code International Two letters| 
 |Locale|String|Country Code International Two letters| 
 |Picture|file|Binary file of picture for the user (optional)| 


 *Response*: 
 <pre><code class="javascript"> 
 { 
   "a01":{ 
     "r":{ 
       "r": { 
                             accountId :    42, 
                             deleted :    false, 
                             identifiers : [ 
                                 { 
                                     validated :    false, 
                                     id :    63, 
                                     type :    Login, 
                                     value :    homersimpsontest 
                                 } 
                             ], 
                             name :    founder, 
                             lastLoginDate :    2015-09-16T16:05:15.000Z, 
                             creationDate :    2014-01-03T13:43:06.000Z, 
                             termsChecked :    true 
                         } 
     }, 
     "cn":"provupdateaccount" 
   } 
 } 
 </code></pre> 
 The Method response is a *Long* which represents the _AccountId_ of the account updated.  

 In case, the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists| 
 |FizAccountAlreadyExistsException |Ex|2|Account Identifier already exists| 
 |FizFounderAlreadyExistsException |Ex|15|Founder already exists| 
 |AFizInvalidIdentifierException|Ex|21|Identifier has an invalid format| 
 |AFizInvalidEmailException|Ex|17|Email has an invalid format| 
 |AFizInvalidMSISDNException|Ex|22|MSISDN has an invalid format| 

 h2. Add Account to family- _provaddaccount2family_ 

 This method add an existing account to a family and set the member type (member=(0),administrator=(1),founder=(2)).  

 By sending an HTTP request http://devserver/api/prov/addaccount2family?accountId=123455&familyId=333445 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |accountId|Long|Family Id where the member shall added| 
 |familyId|Long|Family Id where the member shall be added| 
 |AccountType|Long|Account Type (None,Admin,SuperAdmin) None=normal member, Admin=administrator, SuperAdmin= founder| 

 *Response*: 
 <pre><code class="javascript"> 
 { 
   "a01":{ 
     "r":{ 
       "r":"true" 
     }, 
     "cn":"provupdateaccount" 
   } 
 } 
 </code></pre> 
 The Method response is true when the operation is successful.  

 In case the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists| 
 |FizFounderAlreadyExistsException |Ex|15|Founder already exists| 

 h2. Remove Account from family- _provremoveaccount2family_ 

 This method remove an existing account from a family.  

 By sending an HTTP request http://devserver/api/prov/removeaccount2family?accountId=123455&familyId=333445 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |accountId|Long|Family Id where the member shall added| 
 |familyId|Long|Family Id where the member shall be added| 

 *Response*: 
 <pre><code class="javascript"> 
 { 
   "a01":{ 
     "r":{ 
       "r":"true" 
     }, 
     "cn":"provupdateaccount" 
   } 
 } 
 </code></pre> 
 The Method response is true when the operation is successful.  

 In case the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists| 
 |FizFounderAlreadyExistsException |Ex|15|Founder already exists| 

 h2. Delete Account _provdeleteaccount_ 

 This method delete an existing account. It will be removed from all his families beforehand. Families without remaining members are definitively deleted. 

 By sending an HTTP request http://devserver/api/prov/deleteaccount?accountId=123455 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |accountId|Long|Family Id where the member shall added| 

 *Response*: 
 <pre><code class="javascript"> 
 { 
   "a01":{ 
     "r":{ 
       "r":"true" 
     }, 
     "cn":"provupdateaccount" 
   } 
 } 
 </code></pre> 
 The Method response is true when the operation is successful.  

 In case the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists| 
 |FizAccountDoesNotExistException    |Un|507|Account is not found| 


 h2. get Account information _provgetaccount_ 

 This method returns the information about an existing account, mainly the family he has subscribed to. 

 By sending an HTTP request http://devserver/api/prov/getaccount?accountId=123455 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |accountId|Long|Account Id where the member shall added| 

 *Response*: 
 <pre><code class="javascript"> 
 <pre><code class="javascript"> 
 { 
   "a01":{ 
     "r":{ 
       "r": { 
				 accountId :    42, 
				 deleted :    false, 
				 identifiers : [ 
					 { 
						 validated :    false, 
						 id :    63, 
						 type :    Login, 
						 value :    homersimpsontest 
					 } 
				 ], 
				 name :    founder, 
				 lastLoginDate :    2015-09-16T16:05:15.000Z, 
				 creationDate :    2014-01-03T13:43:06.000Z, 
				 termsChecked :    true 
			 } 
     }, 
     "cn":"provcreateaccount" 
   } 
 } 
 </code></pre> 

 In case the method encounter any error, the response is an exception with specific parameters detailed below. 

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |AFizFamilyIdDoesNotExist|Ex|11|Family Id Does not Exists| 
 |FizAccountDoesNotExistException    |Un|507|Account is not found|