getPlaces
get
/ccadmin/v1/places
Get place suggestions for autocomplete clients. Places are cities, regions and countries.
Request
Supported Media Types
- application/json
Query Parameters
-
fields(optional): string
This controls which fields are returned in the response body. The default is to return all fields: id, displayName and rank.
-
limit(optional): integer
This is the field to specify the number of records to be fetched per REST call. This number should be small so results fit in an autocomplete suggestions box.
-
q(optional): string
This field specifies the SCIM compliant query used to filter places. While not technically required, this endpoint is meant to be used with the q or sw operators like q=displayName sw "san" or id sw "san".
-
sort(optional): string
This field specifies the sort order of the list to be fetched. We recommend using the rank field, e.g. sort=rank:desc
Header Parameters
-
Accept-Language(optional): string
The locale.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : getPlaces_response
Type:
Show Source
object
-
items(optional):
array items
The returned list of items.
-
limit(optional):
integer
Maximum number of places to be fetched.
-
sort(optional):
array sort
The sort used for the returned places.
Nested Schema : items
Type:
Show Source
object
-
country(optional):
string
The country the place resides in.
-
displayName(optional):
string
The name of the city, region or country.
-
id(optional):
string
The location code, e.g. US-CA-SANFRANCISCO.
-
rank(optional):
integer
The number used for sorting place suggestions, usually the population of the place in question.
-
region(optional):
string
The region or state the place resides in. Most cities don't have a corresponding region so this field won't appear for them.
Nested Schema : items
Type:
Show Source
object
-
order(optional):
string
The sort order: either asc or desc.
-
property(optional):
string
The property sorted on.
Example Response (application/json)
{
"q":"displayName sw \"san\"",
"totalResults":-1,
"offset":0,
"limit":10,
"sort":[
{
"property":"rank",
"order":"desc"
}
],
"items":[
{
"country":"Brazil",
"displayName":"Santa Catarina",
"rank":6727000,
"id":"BR-SC",
"type":"region",
"region":"Santa Catarina"
},
{
"country":"Chile",
"displayName":"SANTIAGO",
"rank":5150000,
"id":"CL--SANTIAGO",
"type":"city"
},
{
"country":"Mexico",
"displayName":"San Luis Potosi",
"rank":2718000,
"id":"MX-SLP",
"type":"region",
"region":"San Luis Potosi"
},
{
"country":"Mexico",
"displayName":"San Mart??n Texmelucan",
"rank":2668000,
"id":"MX-PUE-SANMARTINTEXMELUCAN",
"type":"city",
"region":"Puebla"
},
{
"country":"United States",
"displayName":"San Antonio (TX)",
"rank":1470000,
"id":"US-TX-SANANTONIO",
"type":"city",
"region":"Texas"
},
{
"country":"United States",
"displayName":"San Diego (CA)",
"rank":1395000,
"id":"US-CA-SANDIEGO",
"type":"city",
"region":"California"
},
{
"country":"United States",
"displayName":"San Jose (CA)",
"rank":1027000,
"id":"US-CA-SANJOSE",
"type":"city",
"region":"California"
},
{
"country":"Brazil",
"displayName":"Santa Ana Dos Remedios",
"rank":1000000,
"id":"BR-IS",
"type":"region",
"region":"Santa Ana Dos Remedios"
},
{
"country":"Dominican Republic",
"displayName":"SANTO DOMINGO",
"rank":965000,
"id":"DO--SANTODOMINGO",
"type":"city"
},
{
"country":"United States",
"displayName":"San Francisco (CA)",
"rank":865000,
"id":"US-CA-SANFRANCISCO",
"type":"city",
"region":"California"
}
]
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|54083|An error occurred accessing places with query {0}.|
|85003|Invalid attribute in query: {}|
|85000|q query param is not valid SCIM filter format|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code