Open2view API - Documentation - Agents
API Home > AgentsAny 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.
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:
- If the Open2view ID is specified, it will be used and all other fields will be ignored
- Otherwise, if multiple conditions are supplied, only agents matching all conditions will be returned.
List of returned attributes for each agent
Key | Notes | Detail |
---|---|---|
id | Open2view ID | Short and full |
name | Agent's full name | Short and full |
username | Agent's Open2view login name | Full Only |
phone | Agent's phone number | Full Only |
after_hours_phone | Agent's after hours phone number | Full Only |
mobile_phone | Agent's mobile phone number | Full Only |
Agent's email address | Full Only | |
description | Agent's description | Full Only |
photo | URL of agent's photo. (Empty if no photo exists.) | Full Only |
website_url | URL of agent's website. | Full Only |
properties | Count of agent's current properties | Short 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"
}