SearchCases
Searches for cases within their associated Cases domain. Search results are returned as a paginated list of abridged case documents.
For customer_id
you must provide the full customer profile ARN in this
format: arn:aws:profile:your AWS Region:your AWS account ID:domains/profiles domain
name/profiles/profile ID
.
Request Syntax
POST /domains/domainId
/cases-search HTTP/1.1
Content-type: application/json
{
"fields": [
{
"id": "string
"
}
],
"filter": {
"andAll": [
"CaseFilter"
],
"field": {
"contains": {
"id": "string
",
"value": {
"booleanValue": boolean
,
"doubleValue": number
,
"stringValue": "string
"
}
},
"equalTo": {
"id": "string
",
"value": {
"booleanValue": boolean
,
"doubleValue": number
,
"stringValue": "string
"
}
},
"greaterThan": {
"id": "string
",
"value": {
"booleanValue": boolean
,
"doubleValue": number
,
"stringValue": "string
"
}
},
"greaterThanOrEqualTo": {
"id": "string
",
"value": {
"booleanValue": boolean
,
"doubleValue": number
,
"stringValue": "string
"
}
},
"lessThan": {
"id": "string
",
"value": {
"booleanValue": boolean
,
"doubleValue": number
,
"stringValue": "string
"
}
},
"lessThanOrEqualTo": {
"id": "string
",
"value": {
"booleanValue": boolean
,
"doubleValue": number
,
"stringValue": "string
"
}
}
},
"not": "CaseFilter"
},
"maxResults": number
,
"nextToken": "string
",
"searchTerm": "string
",
"sorts": [
{
"fieldId": "string
",
"sortOrder": "string
"
}
]
}
URI Request Parameters
The request uses the following URI parameters.
- domainId
-
The unique identifier of the Cases domain.
Length Constraints: Minimum length of 1. Maximum length of 500.
Required: Yes
Request Body
The request accepts the following data in JSON format.
- fields
-
The list of field identifiers to be returned as part of the response.
Type: Array of FieldIdentifier objects
Array Members: Minimum number of 0 items. Maximum number of 10 items.
Required: No
- filter
-
A list of filter objects.
Type: CaseFilter object
Required: No
- maxResults
-
The maximum number of cases to return. The current maximum supported value is 25. This is also the default value when no other value is provided.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 25.
Required: No
- nextToken
-
The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 9000.
Required: No
- searchTerm
-
A word or phrase used to perform a quick search.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 255.
Required: No
- sorts
-
A list of sorts where each sort specifies a field and their sort order to be applied to the results.
Type: Array of Sort objects
Array Members: Minimum number of 0 items. Maximum number of 2 items.
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"cases": [
{
"caseId": "string",
"fields": [
{
"id": "string",
"value": {
"booleanValue": boolean,
"doubleValue": number,
"stringValue": "string"
}
}
],
"tags": {
"string" : "string"
},
"templateId": "string"
}
],
"nextToken": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- cases
-
A list of case documents where each case contains the properties
CaseId
andFields
where each field is a complex union structure.Type: Array of SearchCasesResponseItem objects
Array Members: Minimum number of 0 items. Maximum number of 25 items.
- nextToken
-
The token for the next set of results. This is null if there are no more results to return.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 9000.
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You do not have sufficient access to perform this action.
HTTP Status Code: 403
- InternalServerException
-
We couldn't process your request because of an issue with the server. Try again later.
HTTP Status Code: 500
- ResourceNotFoundException
-
We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
HTTP Status Code: 404
- ThrottlingException
-
The rate has been exceeded for this API. Please try again after a few minutes.
HTTP Status Code: 429
- ValidationException
-
The request isn't valid. Check the syntax and try again.
HTTP Status Code: 400
Examples
Request and Response example
This example illustrates one usage of SearchCases.
{ "filter": { "andAll": [ { "field": { "equalTo": { "id": "title", "value": { "stringValue": "Forward Web Engineer" } } } }, { "not": { "field": { "greaterThan": { "id": "customer_age", "value": { "longValue": 38 } } } } } ] }, "fields": [ { "id": "title" } ], "maxResults": 10, "nextToken": null, "sorts": [ { "fieldId": "created_datetime", "sortOrder": "Asc" } ] }
{ "cases": [ { "caseId": "[case_id_1]", "fields": [ { "id": "title", "value": { "stringValue": "Forward Web Engineer-1" } } ], "tags": {}, "templateId": "[template_id]" }, { "caseId": "[case_id_2]", "fields": [ { "id": "title", "value": { "stringValue": "Forward Web Engineer-2" } } ], "tags": {}, "templateId": "[template_id]" }, { "caseId": "[case_id_3]", "fields": [ { "id": "title", "value": { "stringValue": "Forward Web Engineer-3" } } ], "tags": {}, "templateId": "[template_id]" }, ], "nextToken": "[nextToken]" }
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: