You can enter in your RETS login information into RETS M.D. and it will return all metadata and fields for each class (ResidentialProperty, Agent, etc).
If you want to get the listing agent's information for a specific MLS listing and you have the MLS ID, it would be something like this:
$mlsNumber = 130050044;
//Perform search query for a specific MLS Id
$search = $rets->SearchQuery("Property", "9", "(MLNumber_f139={$mlsNumber})", array('Limit' => 1, 'Format' => 'COMPACT'));
$numRows = $rets->NumRows();
if ($numRows > 0) {
$listing = $rets->FetchRow($search);
// Get Agent's public Id from MLS listing
$agentId = $listing['ListingPublicID_f1187'];
// Perform search query for Agent using Agent Id
$search = $rets->SearchQuery("User", "14", "(AgentPublicID_f1191={$agentId})", array('Limit' => 1, 'Format' => 'COMPACT'));
$numRows = $rets->NumRows();
if ($numRows > 0) {
$listing = $rets->FetchRow($search);
$agentName = $listing['AgentFullName_f1595'];
echo "Agent Name : " . $agentName . "<br />";
// echo more Agent Details here
}
}
$rets->FreeResult($search);
If you wanted to run a search query to return all Agents from a RETS Server, your DMQL might search for all agents with a status of Active.