All Classes Pages
ActivitySearchPage Class Reference

More...

Detailed Description

Activity Search

Overview

This API allows users to search for activities based on various criteria. If no activities match the search criteria, the server will respond with 204 success code and an empty body. This API only supports exact match searches; partial matches are not supported. For example, if a client searches for activities where customer ID is 1080, then only activities with customer ID 1080 will be returned. Activities associated with customer ID 10801 will not be returned.

Since
11.6

APIs

Method URL Description
GET /ws/v12/interaction/activity?customer={ID} Retrieve activities for one customer ID: {ID}
GET /ws/v12/interaction/activity?case={ID} Retrieve activities for one case ID: {ID}
GET /ws/v12/interaction/activity?status={VAL} Retrieve activities having status <name> with value: {VAL}
GET /ws/v12/interaction/activity?mode={VAL} Retrieve activities having mode with value: {VAL}
GET /ws/v12/interaction/activity?assignedTo={ID} Retrieve activities assigned to a user with ID: {ID}
GET /ws/v12/interaction/activity?queue={ID} Retrieve activities for one queue ID: {ID}
GET /ws/v12/interaction/activity?createdDate={RANGE} Retrieve activities for a range of creation dates with value : {RANGE}
GET /ws/v12/interaction/activity?lastModifiedDate={RANGE} Retrieve activities for a range of last modification date with value: {RANGE}
GET /ws/v12/interaction/activity?custom.<name>={VAL} Retrieve activities having custom attribute <name> with value: {VAL}
GET /ws/v12/interaction/activity?assignedUserName={VAL} Retrieve activities assigned to a user with name: {VAL}
GET /ws/v12/interaction/activity?type={VAL} Retrieve activities of type {VAL}. Note that at least one more parameter must be provided along with 'type' for filtering the activities.

NOTE: You can mix and match one or more filter criteria listed above in any order. If more than one filter criteria are used, then response will only contain activities that satisfy all filter criteria.

Authentication

Authentication is required. The client must be logged in to call this API. Each API request must contain X-egain-session request header returned by Login API.

Permissions

All of the following are required:

  • 'View Agent Console' action.
  • Only activities that satisfy one of the below conditions will be returned by server:
    • activity belongs to user's home department;
    • activity belongs to a department where the user is a foreign user;
    • the department of the activity is shared with the department of the user, and as part of this sharing, activity sharing is enabled as well.

Licenses

The logged in user must have the following licenses:

Request

Request headers

Name Description Allowed values Default value
X-egain-session Session ID obtained from Login API response header N/A N/A
Accept Content type accepted by client application/xml or application/json N/A
Accept-Language Language locale accepted by client (used for locale specific fields in resource representation and in error responses) Supported 'Accept-Language' header codes default system language

Supported API specific query parameters

One or more query parameters listed below can be supplied per API call:

  • case: case ID to be used in activity search.
  • customer: customer ID to be used in activity search.
  • custom.<name>: custom attribute value for custom attribute <name> of an activity to be used in activity search. Only non-encrypted custom attributes are supported.
  • status: status value of an activity. If activities are to be searched based on status and substatus both, the status value must be sent in the format: <status_value>:<substatus_value>.
    Note that substatus is optional, and if omitted, the filtering will happen on just the status. Some valid examples of status that can be used in filtering are: assigned:new, assigned:in-progress, assigned, awaiting_assignment. Refer this page for list of all supported out of the box activity status and substatus values.
    Additionally, status can have a special-meaning value "open". If this value is specified, the filter will return all activities that are not in "completed" status.
  • mode: mode value of an activity. Valid values for mode are: "inbound", "outbound", and "none". This returns the activities in specified mode.
  • assignedTo: user ID to whom the activity is assigned. This returns the activities assigned to this user.
  • queue: queue ID to be used in activity search. This returns the activities associated with this queue.
  • createdDate: date of creation of activity to be used in activity search. This is a range query parameter. Range query parameter representation can be found here.
  • lastModifiedDate: date of last modification of an activity to be used in activity search. This is a range query parameter. Range query parameter representation can be found here.
  • assignedUserName: login name of the user to whom the activity is assigned. This returns the activities assigned to this user regardless of the activity status.
  • type: type value of an activity. This returns the activities of specified type. Note that at least one more parameter must be provided along with 'type' for filtering the activities.

Supported common query parameters

Refer to Supported Common Query Parameters in ECE REST API page for detailed description of each common parameter listed below.

Response

Response headers

Name Description Possible values
X-egain-session Session ID of the current user session N/A
Content-Type Media type of response body application/xml or application/json

Response body xml schemas:

  • schema-interaction-activity-Activities - used in case of success
  • schema-kb-WSError - used in case of error

Summary attributes

Summary attributes of Activity Resource

Additional attributes returned in server response if explicitly requested by client

Server can be prompted to return additional attributes of resource representation using $attribute common query parameter.
See Values of $attribute common parameter supported by Activity Resource for the list of allowed attribute names.

HTTP status codes

Success Status codes

200 - OK

  • Matches are found for this search and returned in the response body.

204 - No Content

  • No matches were found for given search criteria.
  • Matches found for this search, however the requested page or range doesn't contain any results.

Failure Status codes

400 - Bad Request

  • Unsupported query parameter is sent in the request.
  • Unsupported value for query parameter is sent in the request.
  • None of the API specific query parameter is provided (since at least one search criterion is required).
  • Unsupported combination of common query parameters ($order provided without $sort, mixing of pagination and range parameters etc.).

401 - Unauthorized

  • X-egain-session request header is missing.
  • Session is invalid or expired.

403 - Forbidden

  • The user does not have sufficient permissions. Refer the "Permissions" section for details.

406 - Not Acceptable

  • Invalid 'Accept-Language' header value.

500 - Internal server error

Examples:

Example 1 - Search for activities by customer
Example 2 - Search for activities by case with pagination parameters
Example 3 - Search for activities by custom attribute with range parameters
Example 4 - Search for activities by status and last modified date
Example 5 - Search for activities by assigned user with sorting on last modified date
Example 6 - Search for activities by queue and when created date
Example 7 - Search for activities by mode and last modified date
Example 8 - Search for activities by status, assigned user name and last modified date
Example 9 - Search for activities by queue and type