API LIBRARY
Collapse Sidebar Menu
Expand Drawer

Listings and ListAgents

It's possible to retrieve listings and the list agent together in the same API call, using the query option $expand available only on WebAPI.  The result will include a list of listings, each of which contains the list agent.

Property?$top=10&$expand=ListAgent


Examples

Code Example

https://api-prod.corelogic.com/trestle/odata/Property?$top=10&$select=StreetName,City&$expand=ListAgent($select=MemberFirstName,MemberPreferredPhone)

Result

{
    "@odata.context": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/$metadata#Property/CoreLogic.DataStandard.RESO.DD.Property",
    "@odata.nextLink": "https://realestate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property?$top=10&$select=StreetName%2CCity&$expand=ListAgent%28%24select%3DMemberFirstName%2CMemberPreferredPhone%29&$skip=10",
    "value": [
        {
            "@odata.type": "CoreLogic.DataStandard.RESO.DD.Property",
            "@odata.associationLink": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000001')/Media/$ref",
            "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000001')",
            "StreetName": "1st Street",
            "City": "Los Angeles",
            "ListAgent": [
                {
                    "@odata.type": "CoreLogic.DataStandard.RESO.DD.Member",
                    "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Member('5555551')",
                    "MemberPreferredPhone": "(123) 123-1234",
                    "MemberFirstName": "Jill"
                }
            ]
        },
        {
            "@odata.type": "CoreLogic.DataStandard.RESO.DD.Property",
            "@odata.associationLink": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000002')/Media/$ref",
            "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000002')",
            "StreetName": "Meadow Lane",
            "City": "Los Angeles",
            "ListAgent": [
                {
                    "@odata.type": "CoreLogic.DataStandard.RESO.DD.Member",
                    "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Member('5555552')",
                    "MemberPreferredPhone": "(123) 123-1235",
                    "MemberFirstName": "John"
                }
            ]
        },		
		{"Comment": "8 more listings and list agents..."}
    ]
}

Code Example

curl -X GET \
  'https://api-prod.corelogic.com/trestle/odata/Property?$top=10&$select=StreetName,City&$expand=ListAgent%28$select=MemberFirstName,MemberPreferredPhone%29' \
  -H 'Authorization: Bearer [Token]' \
  -H 'cache-control: no-cache'

Result

{
    "@odata.context": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/$metadata#Property/CoreLogic.DataStandard.RESO.DD.Property",
    "@odata.nextLink": "https://realestate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property?$top=10&$select=StreetName%2CCity&$expand=ListAgent%28%24select%3DMemberFirstName%2CMemberPreferredPhone%29&$skip=10",
    "value": [
        {
            "@odata.type": "CoreLogic.DataStandard.RESO.DD.Property",
            "@odata.associationLink": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000001')/Media/$ref",
            "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000001')",
            "StreetName": "1st Street",
            "City": "Los Angeles",
            "ListAgent": [
                {
                    "@odata.type": "CoreLogic.DataStandard.RESO.DD.Member",
                    "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Member('5555551')",
                    "MemberPreferredPhone": "(123) 123-1234",
                    "MemberFirstName": "Jill"
                }
            ]
        },
        {
            "@odata.type": "CoreLogic.DataStandard.RESO.DD.Property",
            "@odata.associationLink": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000002')/Media/$ref",
            "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000002')",
            "StreetName": "Meadow Lane",
            "City": "Los Angeles",
            "ListAgent": [
                {
                    "@odata.type": "CoreLogic.DataStandard.RESO.DD.Member",
                    "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Member('5555552')",
                    "MemberPreferredPhone": "(123) 123-1235",
                    "MemberFirstName": "John"
                }
            ]
        },		
		{"Comment": "8 more listings and list agents..."}
    ]
}

Code Example

<?php

$request = new HttpRequest();
$request->setUrl('https://api-prod.corelogic.com/trestle/odata/Property');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  '$top' => '10',
  '$select' => 'StreetName,City',
  '$expand' => 'ListAgent%28$select=MemberFirstName,MemberPreferredPhone%29'
));

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Authorization' => 'Bearer [Token]'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

Result

{
    "@odata.context": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/$metadata#Property/CoreLogic.DataStandard.RESO.DD.Property",
    "@odata.nextLink": "https://realestate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property?$top=10&$select=StreetName%2CCity&$expand=ListAgent%28%24select%3DMemberFirstName%2CMemberPreferredPhone%29&$skip=10",
    "value": [
        {
            "@odata.type": "CoreLogic.DataStandard.RESO.DD.Property",
            "@odata.associationLink": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000001')/Media/$ref",
            "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000001')",
            "StreetName": "1st Street",
            "City": "Los Angeles",
            "ListAgent": [
                {
                    "@odata.type": "CoreLogic.DataStandard.RESO.DD.Member",
                    "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Member('5555551')",
                    "MemberPreferredPhone": "(123) 123-1234",
                    "MemberFirstName": "Jill"
                }
            ]
        },
        {
            "@odata.type": "CoreLogic.DataStandard.RESO.DD.Property",
            "@odata.associationLink": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000002')/Media/$ref",
            "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Property('100000002')",
            "StreetName": "Meadow Lane",
            "City": "Los Angeles",
            "ListAgent": [
                {
                    "@odata.type": "CoreLogic.DataStandard.RESO.DD.Member",
                    "@odata.id": "https://RealEstate-trestle-dev-api.cfapps.dev1.uswest2.aws.clgx.cloud/odata/Member('5555552')",
                    "MemberPreferredPhone": "(123) 123-1235",
                    "MemberFirstName": "John"
                }
            ]
        },		
		{"Comment": "8 more listings and list agents..."}
    ]
}