No Results Response
If the search does not produce any results, the search returns a response that specifies no results were found. The default XML format response is described below. See the section on optional JSON output for an illustration of how this might differ if optional JSON output format was requested.
For example, given the following search query, which is for someone with the non-existent last name of "zzzzzz":
http://api.whitepages.com/find_person/1.0/?lastname=zzzzzz;api_key=API_KEY
The results response (the elements are described below) should look like the following:
<wp:wp>
<wp:result wp:type="success" wp:message="The search did not find results" wp:code="No Data Found"/>
<wp:meta>
<wp:linkexpiration>2008-04-01</wp:linkexpiration>
<wp:recordrange wp:lastrecord="0" wp:firstrecord="0" wp:totalavailable="0"/>
<wp:apiversion>1.0</wp:apiversion>
<wp:searchlinks>
<wp:link wp:linktext="Whitepages.com" wp:type="homepage">http://www.whitepages.com</wp:link>
<wp:link wp:linktext="View Search Suggestions" wp:type="viewsearchsuggestions">
URL_TO_SEARCH_SUGGESTIONS
</wp:link>
<wp:link wp:linktext="Link to this api call" wp:type="self">
URL_TO_THIS_API_CALL
</wp:link>
</wp:searchlinks>
</wp:meta>
</wp:wp>
The URLs for links returned in the NoResults response will be:
URL_TO_SEARCH_SUGGESTIONS is the URL to where the user can find information to help them perform a successful search
URL_TO_THIS_API_CALL is the same URL as the original query
Data Elements
The data elements that may be found in a no results response are described in the following table.
| Attribute | Description | Notes |
|---|---|---|
| result | The result status of the search request | |
| type | The type of result | error means the request contained invalid or ambiguous data or resulted in some kind of error. success means the request returned 0 or more records. A valid search which returns NoResults will be success |
| message | A textual description of the result or error | Typically The search did not find results |
| code | The results code | Found Data means that the search response contains at least one record No Data Found means that the search response contains no records For NoResults Responses, this should be No Data Found |
| linkexpiration | The date after which the links are no longer valid. | These are typically valid for several days. |
| lastrecord | The index of the last record in the list of records | This attribute should be 0 for a NoResults response |
| firstrecord | The index of the first record in the list of records | This attribute should be 0 for a NoResults response |
| totalavailable | The total number of returned records | This attribute should be 0 for a NoResults response |
| apiversion | The version of the API | This is 1.0 for this release |
Return to the main documentation page
Copyright © 2011 WhitePages.com. All rights reserved.
0 Comments
Please sign in to post a comment.