Open2view API - Documentation - Agents

API Home > Agents

Any questions regarding this interface please address to webmaster@open2view.com

Get a list of all your agents


GET https://api.open2view.com/au/agents.xml?{search_criteria}

GET https://api.open2view.com/au/agents.json?{search_criteria}

Get a list of all your agents. Optional search criteria will limit the results returned.

Try it yourself with the following form:

Open2view ID#:
Name:
Username:
Detail:
Limit:
Offset:
Order:

Possible search criteria

Key Example Notes
id /agents.xml?id=123
/agents.xml?id[]=123&id[]=222
Open2view ID
Could also use /agents/123.xml which will return a single resource with full details
name /agents.xml?name=John%20Smith
/agents.xml?name=Bob
Search on the agent's name. Will perform partial matches. So name=John%20Smith will match John Smith and John Smithson.
username /agents.xml?username=jsmith The agent's Open2view login name
detail /agents.xml?detail=full Get either a limited or full set of details (short or full).
limit /agents.xml?limit=10 Limit the number of results
offset /agents.xml?offset=10 Offset from where the results should be returned.
order /agents.xml?order=name The field the results should be ordered by. See appendix for possible options.

Notes:

  1. If the Open2view ID is specified, it will be used and all other fields will be ignored
  2. Otherwise, if multiple conditions are supplied, only agents matching all conditions will be returned.

List of returned attributes for each agent

Key Notes Detail
idOpen2view IDShort and full
nameAgent's full nameShort and full
usernameAgent's Open2view login nameFull Only
phoneAgent's phone numberFull Only
after_hours_phoneAgent's after hours phone numberFull Only
mobile_phoneAgent's mobile phone numberFull Only
emailAgent's email addressFull Only
descriptionAgent's descriptionFull Only
photoURL of agent's photo. (Empty if no photo exists.)Full Only
website_urlURL of agent's website.Full Only
propertiesCount of agent's current propertiesShort and full
List of agent's current properties. Includes Open2view ID, Agency ID, address.Full Only

XML Response example

HTTP/1.1 200 OK
Date: Thu, 07 Feb 2008 00:15:32 GMT
Content-Type: application/xml
Encoding: UTF-8
Content-Length: 13219

<?xml version="1.0" encoding="UTF-8"?>
<agents count="10">
 <agent id="123">
  <name>John Smith   <username>jsmith</username>
  <phone>555 1234</phone>
  <mobile_phone>021 555 1234</mobile_phone>
  <email>jsmith@virtualrealty.co.nz</email>
  <description>John Smith works hard to ...</description>
  <photo/>
  <properties count="8">
   <property last_updated="Fri Jan 04 19:01:48 +1300 2008" id="162528">
    <address>614 Moonshine Hill Road</address>
    <agency_id>57886</agency_id>
   </property>
   ...
  </properties>
 </agent>
 ...
</agents>

JSON Response example

{
 "agents":
 {
  "count":"10",
  "agent":
  [
   {
    "id":"123",
    "name":"John Smith",
    "username":"jsmith",
    "phone":"555 1234",
    "mobile_phone":"021 555 1234",
    "email":"jsmith@virtualrealty.co.nz",
    "description":"John Smith works hard to ...",
    "photo":"",
    "properties":
    {
     "count":"8",
     "property":
     [
      {
       "id":"162528",
       "last_updated":" Fri Jan 04 19:01:48 +1300 2008",
       "address":"614 Moonshine Hill Road",
       "agency_id":"57886",
      },
      ...
     ]
    }
   },
   ...
  ]
 }
}


Errors


If there are any problems with the supplied search criteria then a list of errors will be returned instead of a list of agents

XML Response error example

HTTP/1.1 200 OK
Date: Thu, 07 Feb 2008 00:15:32 GMT
Content-Type: application/xml
Encoding: UTF-8
Content-Length: 13219

<?xml version="1.0" encoding="UTF-8"?>
<errors count="1">
 <error field="id">
   ID is not a valid number
 </error>
</errors>

JSON Response error example

{
 "errors":
 {
  "count":"1",
  "error":
   {
    "field":"id",
    "message":"ID is not a valid number",
   }
 }
}


Get a single agent


GET https://api.open2view.com/au/agents/{id}.xml

GET https://api.open2view.com/au/agents/{id}.json

Get all details of a single agent with id of {id}

XML Response example

HTTP/1.1 200 OK
Date: Thu, 07 Feb 2008 00:15:32 GMT
Content-Type: application/xml
Encoding: UTF-8
Content-Length: 13219

<?xml version="1.0" encoding="UTF-8"?>
<agent id="123">
 <name>John Smith  <username>jsmith</username>
 <phone>555 1234</phone>
 <mobile_phone>021 555 1234</mobile_phone>
 <email>jsmith@virtualrealty.co.nz</email>
 <properties count="8">
  <property last_updated="Fri Jan 04 19:01:48 +1300 2008" id="162528">
   <address>614 Moonshine Hill Road</address>
   <agency_id>57886</agency_id>
  </property>
  ...
 </properties>
</agent>

JSON Response example

{
 "agent":
 {
  "id":"123",
  "name":"John Smith",
  "username":"jsmith",
  "phone":"555 1234",
  "mobile_phone":"021 555 1234",
  "email":"jsmith@virtualrealty.co.nz",
  "properties":
  {
   "count":"8",
   "property":
   [
    {
     "id":"162528",
     "last_updated":" Fri Jan 04 19:01:48 +1300 2008",
     "address":"614 Moonshine Hill Road",
     "agency_id":"57886",
    },
    ...
   ]
  }
 }
}


Errors


If the agent can't be found, a single error will be returned.

XML Response error example

HTTP/1.1 200 OK
Date: Thu, 07 Feb 2008 00:15:32 GMT
Content-Type: application/xml
Encoding: UTF-8
Content-Length: 13219

<?xml version="1.0" encoding="UTF-8"?>
<error>
  Couldn't find an agent with that ID
</error>

JSON Response error example

{
 "error":"Couldn't find an agent with that ID"
}