tags:

views:

287

answers:

1

I am using PHREST class for getting photo from RETS Server I can get its city,state,zip and price but I am not able to get images of property for that I am using below function

$photos = $rets->GetObject("Property","Photo","05-020123:CLAW",1);
print_r($photos);
and here I am passed "05-020123:CLAW" this is UniqueID which I get from search query listing and I got below result:
Array
(
    [0] => Array
        (
            [Success] => 
            [Content-Type] => text/xml
            [MIME-Version] => 1.0

            [Length] => 185
            [Data] => 


            [ReplyCode] => 20402
            [ReplyText] => V2.5.0 640: The identifier does not match the KeyField of any data in the resource.  Reason: An resource-entity must only contain digits.
        )

)

please help me out.

A: 

The 3rd parameter of GetObject() needs to simply be an ID.

If you go to www.retsmd.com and use your login information, you'll be able to determine the KeyField for the particular RETS class you're looking for. Once you know what field to look at, pull one of the values from that field from the property data and put that in place.

So if the KeyField is "ListingNumber", you might find 1234567 as the ListingNumber value for a record.

$photos = $rets->GetObject("Property", "Photo", "1234567");
foreach ($photos as $photo) {
   print_r($photo);
}

That should spit out some binary image data for you. Check the samples on http://troda.com/projects/phrets/index.php?title=GetObject for further tips.

troydavisson