This API can be used to create a new calltrack activity. Only one activity can be created at a time.
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 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:
The logged in user must have the following licenses:
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 | 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. |
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. |
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 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. |
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. |
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. |
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
500 - Internal server error
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