Project

General

Profile

Profile Management » History » Revision 5

Revision 4 (Eric Vieillevigne, 05/12/2015 12:34 PM) → Revision 5/6 (Eric Vieillevigne, 05/12/2015 06:16 PM)

{{>toc}} 

 h1. Profile Management - _*prf*_ method 

 The profile API enable to manage the existing profiles of the members. In all the other apis, members are labeled by accountid. Developper may use the profile api to retrieve  

 the information of each member and match the ids with a display information. 

 h2. Get Profile- _prfgetProfile_ 

 The method prfgetProfile enables a logged user to retrieve all the information of the profile for a certain accountid.. 

 The method returns the profile information. 

 By sending an HTTP request http://APISERVER/api/prf/getProfile?oid=1705 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |accountid|String|Account Information Id| 


 if accountid is null, the method returns the profile of the logged account. 

 *Response*: 
 <pre><code class="javascript"> 
 { 
   "cn":"prfgetProfile", 
   "feed":{ 
     "ln":"Simpson", // last name 
     "pictureURI":"http:\/\/API server\/media\/48_20mwynve_47?", // avatar 
     "profileId":"30", 
     "ownerId":"48", 
     "dname":"Bart", // nickname 
     "birthDate":"1986-12-01T23:00:00.000Z",/*Birthdate in UTC format*/ 
     "locale":"en", 
     "pictureURIs":[ 
       "http:\/\/API server\/media\/48_20mwynve_47?" 
     ], 
     "devices":"devices":[ 
       { 
         "deviceType":"MOBILE", 
         "value":"0687824772", 
         "deviceId":"20_215" 
       },{ 
         "deviceType":"EMAIL", 
         "value":"ericv@voxmobili.com", 
         "deviceId":"20_216" 
       } 
     ], 
     "fn":"Bart" // first name 
   } 
 }        
 </code></pre> 
 The Method response returns the IProfile Feed. 


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

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |FizAccountNotFoundInSessionException|un|501|Session is invalid| 
 |FizApiInvalidParameterException|un|502|invalid token| 
 |FizApiModelDoesNotExistException|un|503|Object does not exists| 
 |FizApiModelRightException|un|504|Right exception to use this method| 

 h2. Get Profile List- _prfgetProfiles_ 

 The method prfgetProfile enables a logged user to retrieve all the information of the lists of the profile of all family members. 

 The method returns the profile information. 

 By sending an HTTP request http://servername/api/prf/getProfiles? http://stagingapi.familywall.com/api/api/prf/getProfiles? 

 *Parameters*: 

 No parameters 


 *Response*: 
 <pre><code class="javascript"> 
 { 
   "cn":"prfgetProfiles", 
   "feed":{ 
     "1704":{ 
       "profileId":"944", 
       "ownerId":"1704", 
       "pictureURIs":[], 
       "devices":[ 
         { 
           "deviceType":"EMAIL", 
           "value":"grandpa@smartnsoft.com", 
           "deviceId":"1704_163" 
         } 
       ], 
       "fn":"Grandpa" 
     }, 
     "1705":{ 
       "profileId":"945", 
       "ownerId":"1705", 
       "dname":"", 
       "timeZone":"Asia\/Hong_Kong", 
       "birthDate":"2011-07-26T03:50:18.00Z", 
       "pictureURIs":[], 
       "devices":[ 
         { 
           "deviceType":"EMAIL", 
           "value":"yuanyuan.xu@mgsei.com", 
           "deviceId":"1705_164" 
         },{ 
           "deviceType":"MOBILE", 
           "value":"13678049601", 
           "deviceId":"1705_165" 
         } 
       ], 
       "fn":"2" 
     }, 
     "133":{ 
       "ln":"Simpson", 
       "pictureURI":"http:\/\/API server\/media\/133_150?", 
       "profileId":"73", 
       "ownerId":"133", 
       "dname":"Lizy", 
       "gender":"FEMININE", 
       "timeZone":"Asia\/Taipei", 
       "birthDate":"2011-07-15T02:50:00.00Z", 
       "pictureURIs":[ 
         "http:\/\/API server\/media\/133_150?" 
       ], 
       "devices":[ 
         { 
           "deviceType":"MOBILE", 
           "value":"15586347557", 
           "deviceId":"133_4" 
         } 
       ], 
       "fn":"Lisa" 
     }, 
     "1706":{ 
       "profileId":"946", 
       "ownerId":"1706", 
       "pictureURIs":[], 
       "devices":[ 
         { 
           "deviceType":"EMAIL", 
           "value":"roaming0816@gmail.com", 
           "deviceId":"1706_166" 
         } 
       ], 
       "fn":"2" 
     }, 
     "131":{ 
       "ln":"Simpson", 
       "pictureURI":"http:\/\/API server\/media\/131_148?", 
       "profileId":"71", 
       "ownerId":"131", 
       "dname":"Dad", 
       "gender":"MASCULINE", 
       "timeZone":"Asia\/Hong_Kong", 
       "birthDate":"1980-01-06T00:02:35.00Z", 
       "pictureURIs":[ 
         "http:\/\/API server\/media\/131_148?" 
       ], 
       "devices":[ 
         { 
           "deviceType":"MOBILE", 
           "value":"123456789", 
           "deviceId":"131_5" 
         },{ 
           "deviceType":"EMAIL", 
           "value":"dad@smartnsoft.com", 
           "deviceId":"131_161" 
         } 
       ], 
       "fn":"homer" 
     }, 
     "130":{ 
       "ln":"Simpson", 
       "pictureURI":"http:\/\/API server\/media\/130_147?", 
       "profileId":"70", 
       "ownerId":"130", 
       "dname":"Mom", 
       "gender":"FEMININE", 
       "timeZone":"Asia\/Taipei", 
       "birthDate":"1991-03-03T12:10:48.00Z", 
       "pictureURIs":[ 
         "http:\/\/API server\/media\/130_147?" 
       ], 
       "devices":[ 
         { 
           "deviceType":"MOBILE", 
           "value":"06655242", 
           "deviceId":"130_3" 
         },{ 
           "deviceType":"EMAIL", 
           "value":"mom@smartnsoft.com", 
           "deviceId":"130_162" 
         } 
       ], 
       "fn":"Marge" 
     } 
   } 
 } 
        
 </code></pre> 
 The Method response returns the profile MAP list account id, iprofile. 


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

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |FizAccountNotFoundInSessionException|un|501|Session is invalid| 
 |FizApiInvalidParameterException|un|502|invalid token| 
 |FizApiModelDoesNotExistException|un|503|Object does not exists| 
 |FizApiModelRightException|un|504|Right exception to use this method| 


 h2. Set Profile Picture- _prfsetPicture_ 

 The method prfsetPicture enables a logged user to set the profile picture of certain account id of the members of the family. 

 The method returns the update IProfile. 

 By sending an HTTP request http://servername/api/prf/prfsetPicture http://stagingapi.familywall.com/api/prf/prfsetPicture 

 *Parameters*: 

 |*Name*|*Type*|*Description*| 
 |accountid|String|accountid Information| 
 |file|binary|binary file picture| 



 *Response*: 
 <pre><code class="javascript"> 
 { 
   "cn":"prfsetPicture", 
   "feed":{ 
     "ln":"Simpson", 
     "pictureURI":"http:\/\/API server\/media\/130_2757?", 
     "profileId":"70", 
     "ownerId":"130", 
     "dname":"Mom", 
     "gender":"FEMININE", 
     "timeZone":"Asia\/Taipei", 
     "birthDate":"1991-03-03T12:10:48.00Z", 
     "pictureURIs":[ 
       "http:\/\/API server\/media\/130_2757?" 
     ], 
     "devices":[ 
       { 
         "deviceType":"MOBILE", 
         "value":"06655242", 
         "deviceId":"130_3" 
       },{ 
         "deviceType":"EMAIL", 
         "value":"mom@smartnsoft.com", 
         "deviceId":"130_162" 
       } 
     ], 
     "fn":"Marge" 
   } 
 } 
 </code></pre> 

 The Method response returns updated iprofile. 


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

 *Error*: 

 |*Error Code*|*Type*|*Value*|*Description*| 
 |FizAccountNotFoundInSessionException|un|501|Session is invalid| 
 |FizApiInvalidParameterException|un|502|invalid token| 
 |FizApiModelDoesNotExistException|un|503|Object does not exists| 
 |FizApiModelRightException|un|504|Right exception to use this method|