This API can be used to create a new incoming email activity. Only one email activity can be created at a time.
14.0.3
Method | URL | Description |
---|---|---|
POST | /ws/v12/interaction/activity | Create incoming email 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:
The following licenses must be installed:
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:
Note about inline attachments:
Inline attachments are supported using the cid URL scheme. The cid URL scheme allows references to attachments from the email content. Refer Example 3 - Create an inbound email with inline and non-inline attachments, using XML/JSON as content-type and Example 4 - Create inbound email with inline and non-inline attachments, using Multipart/form-data as content-type for details.
Name | Description |
---|---|
department.name | Name of the department in which the activity should be created. |
type.value | Must be "email". |
type.subtype.value | Must be "general". |
payload.email.emailAddresses.from | Specifies the customer's email address. This must be a single email address. If "Customer departmentalization" setting is enabled, this API will try to find the customer in the department of the activity, otherwise it will try to find the customer across the application. If a customer with this email address does not exist:
|
payload.email.emailAddresses.receiver | Specifies the email address of an active email alias in application. The email activity is associated with this email alias. Must be a single email address. This email address must match an active alias in the specified department. |
payload.email.date | Date when email was sent. Refer supported date format here. |
subject or attachments or content | Must have atleast one of subject, attachments or content. |
Name | Description |
---|---|
case.id | If case.id is not provided, the application will create a new case for the activity. If provided, this case must exist in the system and the activity will be associated with the case. |
isSecure | Flag to indicate whether the activity is a secure activity or not. Must be "true" or "false". If "true", the created activity will be a secure email. Default value is "false". If "Enable secure messaging" setting is disabled in the application, the customer cannot create a secure email and will recieve 400 error response code. |
subject | Must not exceed 255 characters. |
attachments | If attachments are provided, file type of any attachment must not be blocked in the application. This element is not allowed for multipart/form-data requests. To send attachments for multipart/form-data requests, refer Example 6 - Create an inbound email by specifying all attributes, 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.email.contents | Supported content types are "text" and "html". One or both can be provided. |
payload.email.emailAddresses.to | All addresses must be in the valid email address format. Must not exceed 255 characters. Refer email address definition for the valid email address format. |
payload.email.emailAddresses.cc | All addresses must be in the valid email address format. Must not exceed 255 characters. Refer email address definition for the valid email address format. |
payload.email.emailAddresses.replyTo | If present, any replies for this email will be sent to this email address. Must be a single email address in the valid email address format. Must not exceed 255 characters. Refer email address definition. |
customer | This will be used to create a new customer only if a customer with the email address provided using "payload.email.emailAddresses.from" 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 |
---|---|
contentType | content type of the attachment content. Must not exceed 255 characters. |
content | content of the attachment in base64 encoded format. Refer Size restrictions section for allowed content size. |
Name | Description |
---|---|
isInline | 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. |
fileName | Name of the attachment file. Must not exceed 255 characters. |
None
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 secure email for an existing case with required elements, using XML/JSON as content-type
Example 2 - Create email for a new case with required elements, using Multipart/form-data as content-type
Example 3 - Create an inbound email with inline and non-inline attachments, using XML/JSON as content-type
Example 4 - Create inbound email with inline and non-inline attachments, using Multipart/form-data as content-type
Example 5 - Create a secure inbound email by specifying all attributes, using XML/JSON as content-type
Example 6 - Create an inbound email by specifying all attributes, using Multipart/form-data as content-type