Additional search criteria for proximity searches
The following search criteria are specific to vendors. From a technical perspective, you could use these criteria for a non-proximity search. But from a business perspective, these criteria are typically used as part of proximity searches.
Search for preferred vendors
ABContacts have a preferred field which indicates
whether they are a preferred vendor. You can limit a proximity search to preferred vendors
only by using the filter query parameter.
For example, the following payload could be used to identify all ABCompanies
within 10 miles of longitude -122.26842 and latitude 37.55496 (which is in San Mateo,
California) that are also preferred vendors.
POST /contacts/v1/search/contacts?filter=preferred:eq:true
{
"data": {
"attributes": {
"contactSubtype": {
"code": "ABCompany"
},
"coordinates": {
"longitude": "-122.26842",
"latitude": "37.55496"
},
"radius": 10
}
}
}Search for vendors that provide a given service
You can limit the search results to only those vendors that provide
a set of one or more services. For example, you could limit the search results to only the
ABCompanies that provide towing service.
The following identifies the syntax for the request payload for a services-based proximity search:
{
"data": {
"attributes": {
"contactSubtype": {
"code": "<codeForContactSubtype>"
},
"coordinates": {
"longitude": "<decimalValueAsString>",
"latitude": "<decimalValueAsString>"
},
"radius": <integerValue>,
"services": [
{
"code": "<serviceCode>"
},
{
"code": "<serviceCode>"
}
]
}
}
}
The services' codes come from the vendorservicetree.xml file, which you can access through Studio.
For example, the following payload could be used to identify all ABCompanies
within 10 miles of longitude -122.26842 and latitude 37.55496 (which is in San Mateo,
California) that provide auto rental service (which has a code of
autootherrental).
POST /contacts/v1/search/contacts
{
"data": {
"attributes": {
"contactSubtype": {
"code": "ABCompany"
},
"coordinates": {
"longitude": "-122.26842",
"latitude": "37.55496"
},
"radius": 10,
"services": [
{
"code": "autootherrental"
}
]
}
}
}
Services listed in search criteria are ANDed together. Thus, if you specify multiple codes, then a contact must provide all services listed in order to be eligible to appear in the search results.
Search for vendors with a given score or greater
A vendor can have a service provider performance review score. This is a numerical evaluation of the quality of the service provided by the vendor. It is determined by aggregating service provider performance reviews that have been submitted for past services the vendor has provided. For more information on service provider performance reviews, see the Contact Management Guide.
When searching for vendors, you can specify a minimumScore that the vendor
must have. This criteria will exclude:
- Any vendors whose score is below the specified value.
- Any vendors who do not have a score.
For example, the following payload could be used to identify all ABCompanies
within 10 miles of longitude -122.26842 and latitude 37.55496 (which is in San Mateo,
California) that have a minimum score of 60.
POST /contacts/v1/search/contacts
{
"data": {
"attributes": {
"contactSubtype": {
"code": "ABCompany"
},
"coordinates": {
"longitude": "-122.26842",
"latitude": "37.55496"
},
"radius": 10,
"minimumScore": 60
}
}
}