WCF User Profile API Examples

Below are example usages of the User Profile API using the WCF API

 

Authenticate(DataServiceAuthorization auth, string profileTypeName, string login, string password)

using (Agility_UGC_API_WCFClient client = DataServiceUtil.GetUGCClient())
{
   DataServiceAuthorization auth =
     DataServiceUtil.GetDataServiceAuthorization(-1);
					
    string AuthenticationToken = client.Authenticate(auth, "Profile", "miskiw", "Password");
    if(AuthenticationToken!=null){
             //Authentication Successful
             PerformLoginFunction(AuthenticationToken);
    }
  
}
                        
IsAuthenticated(DataServiceAuthorization auth, string authenticationToken, string profileRecordType)
public bool IsUserAuthenticated(string AuthenticationToken){
using (Agility_UGC_API_WCFClient client = DataServiceUtil.GetUGCClient())
{
   DataServiceAuthorization auth =
     DataServiceUtil.GetDataServiceAuthorization(-1);
					
    DataServiceAuthorization newAuth = client.IsAuthenticated(auth, authenticationToken, "Profile");
    if(newAuth!=null){
             //Is Authenticated and has a valid auth object
             ReinitializeUGCAuthentication(newAuth);
    }
  
}
}
                        
ChangePassword(DataServiceAuthorization auth, int profileRecordID, string currentPassword, string newPassword)
using (Agility_UGC_API_WCFClient client = DataServiceUtil.GetUGCClient())
{
   DataServiceAuthorization auth =
     DataServiceUtil.GetDataServiceAuthorization(-1);
					
    bool success= client.ChangePassword(auth, profileRecordID, currentPassword, newPassword);
    if(success){
         ///Password changed successfully
    }
  
}
                        
RetrievePassword(DataServiceAuthorization auth, string profileTypeName, string login)
using (Agility_UGC_API_WCFClient client = DataServiceUtil.GetUGCClient())
{
   DataServiceAuthorization auth =
     DataServiceUtil.GetDataServiceAuthorization(-1);
					
    bool success= client.RetrievePassword(auth, "Profile", "miskiw");
    if(success){
         ///Password was successfully emailed to the user
    }
  
}
                        

LOGIN

Log in with your Agility username and password or
register for the site




Log In

REGISTER












Register

FORGOT PASSWORD