Use this API to compose and save or send or send-complete an email activity. Only one outbound email activity can be created at a time.
If the setting "Enable secure messaging" is enabled, and the value of the setting "Types of emails agents are allowed to send" is "Only secure emails", the created activity is a secure activity.
For 'send' and 'sendcomplete' action type, as part of completing this API request:
All of the following are required:
The logged in user must have the following licenses:
The request body is mandatory. Request body can be in either XML or JSON format.
Name | Description |
---|---|
department.name | Name of the department in which the activity should be created. |
type.value | Type of the activity. Must be "email". |
type.subtype.value | Subtype of the activity. Must be "compose". |
payload.email.emailAddresses.to | Specifies the customer's email address. This must be a single email address. If "Customer departmentalization" setting is enabled, this API tries to find the customer in the department of the activity, otherwise it tries to find the customer across the application. If a customer with this email address does not exist:
|
subject or attachments or content | Must have at least one of subject, attachments or content. |
Name | Description |
---|---|
payload.email.emailAddresses.from | Must be provided if the setting "Enable secure messaging" is disabled. If provided:
If not provided:
|
case.id | If case.id is not provided, the application creates a new case for the activity. If provided, this case must exist in the system and the activity is associated to the case. |
queue.name | The queue with which the created activity is associated. Must be a queue in the department of the activity. This is allowed only if the setting "Allow agent to associate a new outbound activity with a queue" is enabled in the department of the activity. |
priority | Priority of the email activity. |
dueDate | Due date of email activity. Must be a future date. |
subject | Subject of email activity Subject can contain macros in the format (two grave accents followed by the macro name): `` |
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. |
payload.email.content | Supported content types are "text" and "html". One or both can be provided. Content can contain macros in the format (two grave accents followed by the macro name): `` |
payload.email.emailAddresses.cc | All addresses must be in the valid email address format. |
payload.email.emailAddresses.bcc | All addresses must be in the valid email address format. |
customer | This is used to create a new customer only if a customer with the email address provided using "payload.email.emailAddresses.to" attribute does not exist in the application. Otherwise, this attribute is ignored. 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:
Refer the "Customer creation" API for more details about the customer element. |
Each attachment must be present within a separate attachment element. It must have the following representation:
Name | Description |
---|---|
altId | Alternate ID of the attachment. |
Created
Bad Request
Unauthorized
Forbidden
Not Acceptable
Internal server error
{- "department": {
- "name": "service"
}, - "type": {
- "value": "email",
- "subtype": {
- "value": "compose"
}
}, - "case": {
- "id": "1003"
}, - "subject": "Issue with mobile phone. Ref: ``external_case_id",
- "payload": {
- "email": {
- "content": {
- "text": "The issue in your mobile is due to obsolete display driver. Please update the driver by following these steps: ``update_display_driver",
- "html": "<HTML><HEAD><TITLE></TITLE></HEAD><BODY><P>The issue in your mobile is due to obsolete display driver. Please update the driver by following these steps: ``update_display_driver <BR> </P></BODY></HTML>"
}, - "emailAddresses": {
- "to": {
- "address": [
- "jhenry@customer.com"
]
}
}
}
}
}
{- "code": "400-101",
- "developerMessage": "Unsupported query parameter(s) supplied: '<query_parameter>'."
}