PHRETS icon indicating copy to clipboard operation
PHRETS copied to clipboard

How to get the content_id

Open lillorme opened this issue 7 years ago • 3 comments

@troydavisson I'm new to PHRETS and I would like to know how would I get the content_id to place in the action below $photos = $rets->GetObject("Property", "Photo", "$content_ids", "*", 1);

lillorme avatar Jan 06 '18 19:01 lillorme

The third parameter to GetObject should be the Property Key Field, usually the one with a SystemName of ListingID. You should be able to use something like this:

$results = $rets->Search($resource, $class, $query, $params);
foreach ($results as $r) {
    printf("ListingID: %s\n", $r->get('ListingID'));
    $photos = $rets->GetObject('Property', 'Photo', $r->get('ListingID'), '*', 1);
    foreach ($photos as $p) {
        printf("Photo %s: %s\n", $p->getObjectId(), $p->getLocation());
    }
}

quinncomendant avatar Dec 06 '19 02:12 quinncomendant

@quinncomendant The above code is not working.

parteek-sdm avatar Sep 28 '22 07:09 parteek-sdm

@parteek-sdm You might need to customize the key names, they'll be different for each RETS API.

Try retsmd.com – Use it to log in to your MLS to get a LIVE data dictionary and schema, which you need to know to communicate with the API correctly.

quinncomendant avatar Sep 30 '22 17:09 quinncomendant