All Classes Pages
PutCompleteActivityPage Class Reference

More...

Detailed Description

Complete Activities

Overview

This API can be used to complete multiple activities assigned to the logged in user. These activities may or may not have a case and the activities may belong to different cases.
This API cannot be used to complete draft replies created for email activities.

For this API to execute successfully:

  • All activities must exist in the application.
  • All the activities must be assigned to the logged in user, and must be in "Assigned" status.
  • The activities must be of type Email. Calltrack and Chat activities cannot be completed by this API.
  • If the value of the setting "Force activity categorization" for the department of the activity is "yes", the activity must be classified with a category (as configured in the application)
  • If the value of the setting "Force resolution code" for the department of the activity is "yes", the activity must be classified with a resolution code (as configured in the application)
  • No more than 75 activities must be sent in one request.
  • None of the activities must be awaiting supervision, i.e., waiting for supervisor to accept or reject the activity.

As part of completing this API request:

  • The activities sent in the request will be completed.
  • Upon completing an activity, the case of the activity will also be closed if there are no other open activities in that case.
Since
11.6

APIs

Method URL Description
PUT /ws/v12/interaction/activity/complete Complete one or more activities assigned to self.

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:

  • User must have "Complete" action on "Activity" resource or "Manage Utilities" action on "Utilities" resource.
  • All the activities must either belong to the user's home department, or to a department in which the user is a foreign user.

Licenses

The logged in user must have the following licenses:

  • ECE MailPlus: To complete an email activity.
  • ECE CallTrackPlus: To complete a calltrack activity.
  • Any User License: To complete a task or generic activity.

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
Content-Type Media type sent by the 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

Request Body

The request body is mandatory and can be in either XML or JSON format.

Elements required in the request body

"activities" element must be present in the request body. At least one "activity" element must be present in the "activities" element. Each "activity" element must contain the following elements:

Name Description
id ID of the activity
lastModified.date Value of last modified date of the activity

Optional elements allowed in the request body

   None

Request body XML schemas:

  • schema-interaction-activity-Activity

Supported API specific query parameters

   None

Supported common query parameters

   None

Response

Response headers

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

Response Body

Response body will have all the activities that were sent for completion. The response body can be in either XML or JSON format.

Elements sent in the response body

'activities' element will be present in the response body. At least one 'activity' element will be present in the 'activities' element. Each 'activity' element will contain the following elements:

Name Description
id ID of the activity completed.
link Self link of the activity completed.

If the activity has a case, then 'case' element will be present in the response body. Each 'case' element will contain the following elements:

Name Description
id ID of the case.
link Link to the case.
status.value The status of the case.

Response body XML schemas:

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

HTTP status codes

Success Status codes

200 - Success

  • Successfully completed the activities sent in the request body.

Failure Status codes

400 - Bad Request

  • Any query parameter is sent in the request.
  • Any criteria for successful execution mentioned in the Overview and Request Body sections are violated.

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.

409 - Conflict

  • The lastModified date of any activity in the request does not match its lastModified date on the server.

500 - Internal server error

Examples:

Example 1 - Complete activities of multiple cases
Example 2 - Complete single activity resulting in case getting closed
Example 3 - Complete single activity without a case