SiteSearch resource (Data API 23.2)
Summary
Http Method | Resource | Description |
---|---|---|
POST | /site_search |
Searches for sites. The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:
The output of the query can also be sorted. These are the list of sortable attributes:
|
Search Sites
Searches for sites.
The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:
- id - String
- display_name - Localized <String>
- description - Localized <String>
- in_deletion - Boolean
The output of the query can also be sorted. These are the list of sortable attributes:
- id - String
- display_name - Localized <String>
- description - Localized <String>
- in_deletion - Boolean
Url
POST https://hostname:port/dw/data/v23_2/site_search
Formats
json, xml
Authentication
Name | Description |
---|---|
OAuth | Authentication via OAuth token. |
Request Document
Response Document
In case of a failure Fault Document is returned.
Faults
Status | Type | Arguments | Description |
---|---|---|---|
400 | MalformedSearchParameterException |
Thrown if the query is ill-formed. | |
400 | EnumConstraintViolationException |
document (String) enumValue (String) |
Thrown if the invalid value is entered for access_type |
Sample
REQUEST:
POST /s/-/dw/data/v23_2/site_search HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Accept: application/json
{
"query" : {
"text_query": {
"fields": ["id", "description"],
"search_phrase": "my"
}
},
"select" : "(**)"
}
RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
"_v" : "23.2",
"count" : 2,
"hits" : [
{
"_v" : "23.2",
"id" : "my-site1",
"customer_list_link" : {
"_type" : "customer_list_link",
"customer_list_id" : "my-site1",
"link" : "https://example.com/s/-/dw/data/v23_2/customer_lists/my-site1"
},
"display_name" : {
"default" : "my-display_name",
"en" : "An English my-display_name",
"de" : "A German my-display_name"
},
"description" : {
"default" : "my-description",
"en" : "An English my-description",
"de" : "A German my-description"
},
"link" : "https://example.com/s/-/dw/data/v23_2/sites/my-site1",
"in_deletion": false,
"storefront_status": "online"
},
{
"_v" : "23.2",
"id" : "my-site2",
"customer_list_link" : {
"_type" : "customer_list_link",
"customer_list_id" : "my-site2",
"link" : "https://example.com/s/-/dw/data/v23_2/customer_lists/my-site2"
},
"display_name" : {
"default" : "my-display_name",
"en" : "An English my-display_name",
"de" : "A German my-display_name"
},
"description" : {
"default" : "my-description",
"en" : "An English my-description",
"de" : "A German my-description"
},
"link" : "https://example.com/s/-/dw/data/v23_2/sites/my-site2",
"in_deletion": false,
"storefront_status": "online"
}
],
"query" : { "text_query": { "fields": ["id", "description"], "search_phrase": "my" } },
"select": "**",
"start" : 0,
"total" : 2
}
X
OCAPI versions 15.x and 16.x will be retired on March 31, 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.