GetRecord Method

The GetRecord call returns the entire record defined by the recordID. This call is used to retrieve records in the Website Users tables and the User Generated Content tables. Note that GetRecord will only return records that are published when using a standard authentication process. If an admin API key and password are used GetRecord is able to access any record with the UGC system regardless of state.

 

Parameters

  • recordID
    • Integer
    • The numeric ID that is assigned to every record in the Agility UGC content store.
    • Corresponds to Record.ID from any record object.

Returns

  • Record

Usage

Use the call to get all of the data for a given record, including the metadata for any File fields and large text fields.  This is best for a “details” page, where you have already retrieved the recordID based on list selection and need to access all of the data for a record.

 

 

GetRecord call in JavaScript

//invoke the GetRecord method with a known recordID variable

Agility.UGC.API.GetRecord(recordID, function(data) {	
	
	if (data.ResponseType != Agility.UGC.API.ResponseType.OK) {
		//error occurred
		alert("An error occurred: " + data.Message);			
	} else {
		//data.ResponseData is a "Record" object
		var record = data.ResponseData;
		
		//get the firstname and lastname properties of the record...
		var firstName = record.FirstName;
		var lastName = records.LastName;		
	}
}
                    

GetRecord call in C#

//invoke the GetRecord method with a known recordID variable

using (Agility_UGC_API_WCFClient client = DataServiceUtil.GetUGCClient())
{
   DataServiceAuthorization auth =
     DataServiceUtil.GetDataServiceAuthorization(-1);
					
   Record record = client.GetRecord(auth, recordID);

   if (record != null) 
   {
      //get the firstname and lastname 
      //properties of the record...
      var firstName = records["FirstName"];
      var lastName = records["LastName"];
   }
}
                    

GetRecord call in PHP

//invoke the GetRecord method with a known recordID variable

GetRecord($recordID);
		
		
		if($results->ID == $recordID)
{
			echo "Record was successfully collected”;
		}
		else
{
			echo “Record ID doesn’t match”;
		}
  ?>
                    

LOGIN

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




Log In

REGISTER












Register

FORGOT PASSWORD