Create an email response

Overview

Use this API to create and send an email response to an existing activity. This API can be used by customers to respond to one activity at a time.

Permissions

  • All authenticated customers can access this API.
  • If the query parameter customer={id} is provided, the logged in customer must be authorized to perform this action on behalf of the customer specified through the "customer" query parameter. Otherwise, the application returns a 400 (bad request). Refer Customer grants for more information about authorization.
SecurityoAuthCustomer
Request
path Parameters
ids
required
string <= 1500 characters

Pass one id or comma separated list of id(s).

Examples:
Providing single ID.
1001
Providing multiple IDs.
1001,1002
query Parameters
customer
string

The activity is created for the customer specified through this query parameter. If this parameter is not provided, the activity is created for self (logged in customer).

Examples:
customer=
customer=1000
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
type.value Type of the activity. Must be "email".
type.subtype.value Subtype of the activity. Must be "general".
subject or attachments or content Must have at least one of subject, attachments or content.

Optional elements allowed in the request body

Name Description
payload.email.emailAddresses.from   Specifies the sender's email address.
If this attribute is not provided, the application automatically figures out the email address to use for the activity.
If provided, must be a single email address.
1. If the query parameter "customer" is not provided:
  • If this email address is present in the application, it must be associated with the logged in contact. If the email address is not present in the application, a new contact point with the provided email address is created and used for activity creation.
  • If "Customer departmentalization" setting is enabled in the application and this email address is looked up in the department of the customer.

2. If the query parameter "customer" is provided, this attribute ("payload.email.emailAddresses.from") must not be provided. The application automatically figures out the email address to use for the activity, since the activity is being created for a different customer.
  • If the application does not find any email addresses for the customer provided through "customer" query parameter, the application errors out. It does not create a new email address for the customer
payload.email.emailAddresses.receiver   Specifies the email address of an active email alias in application. The email activity is associated with this email alias.
If customer departmentalization setting is enabled, the alias must be in the same department as the customer.
Must be a single email address.
payload.email.messageCenter.id Specifies an active message center in the application.
If customer departmentalization setting is enabled, the message center must be in the same department as the customer.
subject Subject of email activity.
attachments Attachments of the email activity. Refer 'Attachments' section for more details.
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.email.content Supported content types are "text" and "html". One or both can be provided.
payload.email.emailAddresses.replyTo   If present, any replies for this email is sent to this email address. Must be a single email address in the valid email address format.
issueType.id ID of the issue type of the activity.
This can be provided only when payload.email.messageCenter.id is provided. The issue type must be associated with the message center specified through payload.email.messageCenter.id.

Size restrictions

  • The email size (includes email content and attachments) cannot be more than the value of the partition setting "Maximum email size for retriever (MB)".
  • The email content size cannot be more than the value of the partition setting "Maximum body size for retriever (KB)".

Note on department of the activity

The department of the activity is determined as follows:

  • If none of payload.email.emailAddresses.receiver and payload.email.messageCenter.id are provided, the department of the activity is based on the activity being responded.
  • If payload.email.emailAddresses.receiver is provided, the department of the activity is derived based on the value of payload.email.emailAddresses.receiver.
  • If payload.email.messageCenter.id is provided, the department of the activity is derived based on the value of payload.email.messageCenter.id.

Attachments Element

Each attachment must be present within a separate attachment element. It must have the following representation:

Elements required for attachment

Name Description
altId Alternate ID of the attachment.

Optional elements allowed for attachment

Name Description
inline Flag to indicate if this is an inline attachment or not. Must be set to true for inline attachments.
contentId This represents the identifier for the attachment. This is required only for inline attachments.
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/{ids}/email/general
Request samples
application/json
  • POST /core/casemgr/v3/activity/1055/email/general
  • This example demonstrates the following:
    • Creating an email with required elements, subject and content.
{
  • "type": {
    },
  • "subject": "Issue with mobile phone",
  • "payload": {
    }
}
Response samples
application/json
{
  • "code": "400-101",
  • "developerMessage": "Unsupported query parameter(s) supplied: '<query_parameter>'."
}