All Classes Pages
CreateCallTrackActivityPage Class Reference

More...

Detailed Description

Create Calltrack Activity

Overview

This API can be used to create a new calltrack activity. Only one activity can be created at a time.

Since
11.6.0.3

APIs

Method URL Description
POST /ws/v12/interaction/activity Create calltrack activity.
POST /ws/v12/interaction/activity?anonymousCustomer=yes Create calltrack activity for anonymous customer.

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 'Create activity' action.
  • The activity must be created in either the user's home department, or a department in which the user is a foreign user.
  • If the activity is being assigned to a target user, that is, a user other than the one who is logged in:
    • The target user must be logged in.
    • The logged in user must have 'Transfer Activities' permission on the target user.

Licenses

The logged in user must have the following licenses:

  • ECE CallTrackPlus
  • If the activity is being assigned to a target user, that is, a user other than the one who is logged in:
    • The target user must have 'ECE CallTrackPlus' license.

Request

Request headers

Name Description Allowed values Default value
X-egain-session Session ID obtained from Login API response header N/A N/A
Content-Type Media type sent by the client. application/xml or application/json or multipart/form-data N/A
Accept Content type accepted 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. The request body can be in one of the below two formats:

  • XML or JSON representing the activity
    • The activity can contain non-inline attachments. Refer Attachments Element section for more details.
  • Multipart form data
    • The following two parts must be present:
      1. "data": This part must have the data representing the activity. This can either be in XML format or JSON format.
      2. "data-type": This part identifies the data type of "data" part. It can have one of the two values - "application/json" or "application/xml".
    • Optionally there can be more parts that represent non-inline attachments of activity. Each of these parts must contain following header:
      1. "Content-Disposition": This header must have a property by name "fileName", which indicates the file name of the attachment.

    NOTE: Inline attachments are not supported by this API.

Elements required in request body

Name Description
department.name Name of the department in which the activity should be created.
type.value Must be "call_track".
type.subtype.value Must be one of the subtypes of calltrack configured in application. To find out the configured values in the system, use Get Activity Attributes API.
mode.value Must be "Inbound" or "Outbound".
subject or content Must have alteast one of subject or content.
Customer Identifier Required only if anonymousCustomer query parameter is not present in the request URL.
Must have one of the customer identification parameters to identify the customer. Refer Customer Identification section for more details.

Optional elements allowed in request body

Name Description
case.id If case.id is not provided, the server will create a new case for this activity. If provided, this case must exist in the system and the activity will be associated to the case.
priority Must be a value between 1 and 7.
dueDate Must be a future date. Refer supported date format here.
subject Must not exceed 255 characters.
attachments If attachments are provided, file type of any attachment must not be blocked in the application. Refer Attachments Element section for more details.
This element is not allowed for multipart/form-data requests. To send attachments for multipart/form-data requests refer Example 8 - Create a calltrack activity with attachment, using Multipart/form-data as content-type .
customAttributes Name must match one of the custom attributes configured in application. If the custom attribute is configured as an enumeration, the value must be one of the predefined values.
For string type of custom attribute that is not configured as an enumeration, refer list of Allowed Characters For Custom Attributes.
payload.calltrack.contents Supported content type are "text" and "html". One or both can be provided.
targetUser User to whom the activity should be assigned. Refer Target User section for more details.


Attachments Element

Each attachment must be represented as a separate attachment element. It must have the following representation:

Elements required for attachment

Name Description
contentType Content type of the attachment content. Must not exceed 255 characters.
content Content of the attachment in base64 encoding.
fileName Name of the attachment file. Must not exceed 255 characters.

Optional elements allowed for attachment

   None

Target User

Optionally, one of the below attribute can be provided to assign the activity to another user. If none of these are provided, the server will assign the activity to the logged in user.

Name Description
status.assigned.user.id Id of the target user.
status.assigned.user.name Login Name of the target user.
status.assigned.user.customAttributes Any custom attribute that can uniquely identify the target user.

Customer Identification

If anonymousCustomer query parameter is not present in the request URL then one of the following elements must be provided to identify the customer. The identified customer must be present in system. If "Customer departmentalization" setting is enabled in the application, identified customer and the activity being created must belong to the same department.

Name Description
customer.id Id of the Customer.
customer.contactpersons.contactperson.id Contact Person Id of the customer.
customer.contactpersons.contactperson.contactpoints.contactpoint.id Contact Point Id of the customer.
contactPointData Must be a valid email address or phone number. Refer Email Address definition for the valid email address format. Phone number must be numbers only. The email address or phone number must be associated with the customer in the application.
If "Customer departmentalization" setting is enabled in the application, there must be a customer with this email address or phone number in the department in which activity is being created.

Request body XML schemas:

  • schema-interaction-activity-Activity

Supported API specific query parameters

Name Description
anonymousCustomer If provided, then created activity will not be linked to any customer. Valid value is "yes" only.
Optionally, contactPointData with an email address or phone number can be provided in request body.

Supported common query parameters

   None

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
Location Location of the new created activity N/A

Response body XML schemas:

  • schema-kb-WSError - used in case of error

HTTP status codes

Success Status codes

201 - Created

  • The request was successfully executed.

Failure Status codes

400 - Bad Request

  • Any query parameter is sent in the request other than 'anonymousCustomer'.
  • Request body does not contain the required elements.
  • An unsupported element is present in the request body.
  • Elements provided do not adhere to the rules stated in the "Request Body" section.
  • Request body is empty.

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.

500 - Internal server error

Examples:

Example 1 - Create activity for a new case
Example 2 - Create activity for an existing case
Example 3 - Create activity with contact person as customer identifier
Example 4 - Create activity with contact point as customer identifier
Example 5 - Create activity for another user with anonymous customer
Example 6 - Create activity with anonymous customer
Example 7 - Create a calltrack activity with all attributes including attachment, using XML/JSON as content-type
Example 8 - Create a calltrack activity with attachment, using Multipart/form-data as content-type