This API can be used to create a new task activity. Only one activity can be created at a time.
Method | URL | Description |
---|---|---|
POST | /ws/v12/interaction/activity | Create task activity. |
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.
All of the following are required:
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 |
The request body is mandatory. The request body can be in one of the below two formats:
Name | Description |
---|---|
department.name | Name of the department in which the activity should be created. |
type.value | Type of the activity. Must be "task". |
type.subtype.value | Subtype of activity. Must be one of the subtypes of task configured in application. To find out the configured values in the application, refer Get Activity Attributes API. |
subject or payload.task.contents | Must have at least one of subject or payload.task.contents. |
customer | The attributes provided in the value of query parameters "searchContactOnAttribute" and "activityContact" must be provided in the customer representation. If a customer is found using the value of the query parameter "searchContactOnAttribute", the other values provided in this representation are ignored. If a customer is not found using the value of the query parameter "searchContactOnAttribute":
|
Name | Description |
---|---|
case.id | Case to which activity should be associated with. If this attribute is not provided, the server will create a new case for this activity. If this attribute is provided, this case must exist in the system and the activity will be associated to the case. |
priority | Priority of the activity. Must be a value between 1 and 7. |
dueDate | Due date of the activity. Must be a future date. Refer supported date format here. |
subject | Subject of the activity. Must not exceed 255 characters. |
attachments | Attachments of the activity. If attachments are provided, file type of any attachment must not be blocked in the application. Refer Attachments Element section for more details. This attribute is not allowed for multipart/form-data requests. To send attachments for multipart/form-data requests refer Example 3 - Create task activity with all attributes, using Multipart/form-data as content-type . |
customAttributes | Custom attribute of the activity. 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.task.contents | Content of the activity. Supported content type are "text" and "html". One or both can be provided. |
status.assigned.user.id or status.assigned.user.loginId or status.assigned.user.externalId or status.assigned.user.customAttributes | User to whom the activity should be assigned. Refer Target User section for more details. |
Each attachment must be represented as a separate attachment element. It must have the following representation:
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. |
None
Optionally, one of the below attributes 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.loginId | Login id of the target user. |
status.assigned.user.externalId | External id of the target user. |
status.assigned.user.customAttributes | Any custom attribute that can uniquely identify the target user. |
This API does not allow specifying "department.name" attribute in the customer element. Instead, when creating a new customer, customer's department is determined as follows:
Additionally, not more than one contact point of the below types can be provided:
Refer Create Individual Customer API for more details.
Name | Description | Allowed Values | Default Value |
---|---|---|---|
searchContactOnAttribute | This parameter indicates the attribute of the contact person, on which customer records will be looked up. The attribute corresponding to the provided value must exist in the customer representation. Eg: If provided value is "email.emailAddress", the contact person in the customer representation must contain email address. If "Customer departmentalization" setting is enabled, this API will search the customer in the department of the activity, otherwise it will search the customer across the application. If a customer with the value of this attribute does not exist, a new customer will be created using the customer details provided in the customer element. |
| N/A |
Name | Description | Allowed Values | Default Value |
---|---|---|---|
createCustomer | This indicates whether a new customer must be created if a customer is not found when looked up using the query parameter "searchContactOnAttribute". |
| N/A |
activityContact | The contact to be used for the activity. The attribute corresponding to the provided value must exist in the customer representation. Eg: If provided value is "email.emailAddress", the contact person in the customer representation must contain an email contact point. If not provided, the activity will be associated with the customer and the contact person. It will not be associated with the contact point. |
| N/A |
None
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 |
201 - Created
400 - Bad Request
401 - Unauthorized
403 - Forbidden
406 - Not Acceptable
500 - Internal server error
Example 1 - Create task activity with required attributes and search customer only
Example 2 - Create task activity with all attributes with customer creation
Example 3 - Create task activity with all attributes, using Multipart/form-data as content-type