Create task activity

Overview

Use this API to create a new task activity. User can only create one new task activity at a time

Permissions

Actor Permission
User All of the following are required:
  • User must have 'Create' action on ‘Activity’ resource.
  • Activity must be created in the home department of the logged in user, or in the department in which the logged in 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 logged in user must have transfer permission on the target user.
Client Application No additional permission required.

Licenses

Actor License
User
  • The logged in user must have any of the User Licenses.
  • 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 any of the User Licenses.
  • Client Application No additional licenses required.
    SecurityoAuthUser or oAuthClient
    Request
    query Parameters
    searchContactOnAttribute
    required
    string

    This parameter indicates the attribute of the contact, on which customer records is looked up. The attribute corresponding to the provided value must exist in the customer representation. Eg: If provided value is "email.emailAddress", the contact in the customer representation must contain email address.
    If "Customer departmentalization" setting is enabled, this API searches the customer in the department of the activity, otherwise it searches the customer across the application.
    If a customer with the value of this attribute does not exist, a new customer is created using the customer details provided in the customer element. Available values are:

    • email.emailAddress: Email address of the customer.
    • home.phone: Home phone number of the customer.
    • mobile.phone: Mobile phone number of the customer.
    • office.phone: Office phone number of the customer.
    • social.facebookId: Facebook ID of the customer.
    • social.twitterId: Twitter ID of the customer.
    • social.instagramId: Instagram ID of the customer.
    • custom.<attribute_name>: Custom attribute of the contact.
    Example: searchContactOnAttribute=email.emailAddress
    createCustomer
    string

    This indicates whether a new customer must be created if a customer is not found when looked up using the query parameter "searchContactOnAttribute".

    Value: "yes"
    activityContact
    string

    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 in the customer representation must contain an email contact point.
    If not provided, the activity is associated with the customer and the contact. It is not be associated with the contact point.

    Enum: "email.emailAddress" "home.phone" "office.phone" "social.facebookId" "social.twitterId" "social.instagramId"
    header Parameters
    Accept-Language
    required
    string
    Default: en-US

    Language locale accepted by client (used for locale specific fields in resource representation and in error responses).

    Enum: "en-US" "es-ES" "fr-FR" "it-IT" "de-DE" "nl-NL" "pt-BR" "pt-PT" "da-DK" "ru-RU" "fr-CA" "zh-CN" "ja-JP" "ko-KR" "sv-SE"
    Accept
    required
    string
    Default: application/json

    Content type accepted by client.

    Enum: "application/json" "application/xml"
    Content-Type
    required
    string
    Default: application/json

    Media type sent by the client.

    Enum: "application/json" "application/xml" "application/x-www-form-urlencoded" "multipart/form-data" "text/plain"
    Request Body schema: application/json

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

    Elements required in request body

    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.content Must at least have one of subject or payload.task.content.
    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 is ignored.
    If a customer is not found using the value of the query parameter "searchContactOnAttribute":
    • If the query parameter "createCustomer" is provided, a new customer of type "individual" is created using the provided values. Refer to "New customer creation" section for more details.
    • If the query parameter "createCustomer" is not provided, this API errors out.
    status.assigned.user.id or
    status.assigned.user.loginId or
    status.assigned.user.externalId or
    status.assigned.user.customAttributes
    Required only if actor is client application.
    User to whom the activity should be assigned. Refer Target User section for more details.

    Optional elements allowed in the request body

    Name Description
    case.id Case to which activity should be associated with. If this attribute is not provided, the server creates a new case for this activity. If this attribute is provided, this case must exist in the system and the activity is associated to the case.
    priority Priority of the calltrack activity.
    dueDate Due date of calltrack activity. Must be a future date.
    subject Subject of calltrack activity.
    attachments Attachments of the task activity. Refer 'Attachments' section for more details.
    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.
    payload.task.content Content of the activity. Supported content type are "text" and "html". One or both can be provided.

    Attachments Element

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

    Attachments Element

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

    Elements required for attachment

    Name Description
    altId Id of the attachment.

    Target User

    Optionally, only one of the below attribute can be provided to assign the activity to another user. If none of these are provided, the server assigns 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.

    New customer creation

    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:

    • If the "Customer departmentalization" setting is enabled, the customer is created in the department of the activity.
    • If the "Customer departmentalization" setting is not enabled, the created customer is shared across all departments

    Additionally, not more than one contact point of the below types can be provided:

    • Email address
    • Home phone number
    • Mobile phone number
    • Office phone number.
    • Facebook ID.
    • Twitter ID
    • Instagram ID

    Refer the "Create Individual Customer" API for more details.

    Array of objects (link) >= 0 items

    Link to the current activity.

    object (_case)

    Brief information about the cases of the activity.

    object (department)

    Department of the activity.

    object (mode)

    Mode of the activity.

    object (type)

    Type of the activity.

    secure
    boolean (secure)

    Indicates whether the activity is secure or not.

    sentOnBehalf
    boolean (sentOnBehalf)

    Indicates whether the activity was created by a customer on behalf of another customer.

    object (status)

    Status of the activity.

    priority
    string (priority)

    Indicates the priority of the activity.

    Enum: "1" "2" "3" "4" "5" "6" "7"
    created
    string <date-time> (created)

    Date of creation of the activity.

    object (created)

    Activity creation details (user info).

    lastModified
    string <date-time> (lastModified)

    Date of modification of the activity.

    object (lastModifiedBy)

    Details of the last modification of the activity (user info).

    dueDate
    string <date-time> (dueDate)

    Due date of this activity.

    subject
    string (subject) <= 255 characters

    Subject of this activity.

    object (language)

    Language of the activity.

    object (userLastWorked)

    User who last worked on this activity.

    object (customer)

    Customer of this activity.

    object (classifications)

    Classifications of the activity.

    object (queue)

    Queue associated with this activity.

    object (attachments)

    Attachments of this activity.

    object (notes)

    Notes of this activity.

    contactPointData
    string (contactPointData)

    Contains the contact point information.

    object (lastDepartment)

    Information about the previous department of this activity.

    object (issueType)

    Issue type of the activity.

    contentPurged
    boolean (contentPurged)

    Indicates whether the activity content is purged.

    object (payload)

    Payload of the activity.

    object (customAttributes)

    Custom attributes of the activity.

    object (virtualAssistant)

    Virtual assistant information.

    object (channel)

    Channel for the activity.

    id
    string (id)

    Id of the activity.

    Responses
    201

    Created

    400

    Bad Request

    401

    Unauthorized

    403

    Forbidden

    406

    Not Acceptable

    500

    Internal server error

    post/activity/task
    Request samples
    application/json
    • POST /core/casemgr/v3/activity/task?searchContactOnAttribute=email.emailAddress
    • This example demonstrates the following:
      • Create a task activity with required attributes without creating a customer or associating contact points.
    {
    • "department": {
      },
    • "type": {
      },
    • "subject": "Follow up with customer",
    • "customer": {
      }
    }
    Response samples
    application/json
    {
    • "code": "400-101",
    • "developerMessage": "Unsupported query parameter(s) supplied: '<query_parameter>'."
    }