Jump to: navigation, search

Interactions On E-mail Channel

Operations

The following operations are available on me/interactions/{interaction_id}:

Operation Name HTTP Operation Description Type Permissions
Accept POST Accepts the interaction. The agent can perform this operation after a new interaction invitation arrives. Accepting an interaction allows the agent to start working on it. General Interaction Agent
Reject POST Rejects the interaction. The agent can perform this operation after a new interaction invitation arrives. Rejecting an interaction allows an agent to work on a differen interaction. General Interaction Agent
Reply POST Creates an outbound e-mail reply. The agent can perform this operation after he or she accepts a new inbound e-mail interaction. E-mail Specific Agent
ReplyAll POST Creates an outbound e-mail reply to all senders. The agent can perform this operation after he or she accepts a new inbound e-mail interation. E-mail Specific Agent
Cancel POST Cancels the outbound reply e-mail. The agent can perform this operation after he or she creates a new outbound reply e-mail. E-mail Specific Agent
Send POST Sends an outbound e-mail. The agent can perform this operation after he or she creates a new outbound reply e-mail. E-mail Specific Agent
Transfer POST Transfers an outbound e-mail interaction. The agent can perform this operation while he or she is working on an interaction. The interaction is transferred to another agent or to a group of agents associated with a skill. General Interaction Agent
Complete POST This operation can be performed after an agent has finished working on an interaction. General Interaction Agent
PlaceInQueue POST Places the interaction in a specific queue. The agent should use this operation if another agent should handle further processing of the interaction. General Interaction Agent

Reply

This operation can be performed after an agent (User) has Accepted an e-mail interaction. A Reply operation creates an interaction in Interaction Server and the Universal Contact Server. The operation is asynchronous, meaning that a CometD notification will be sent upon successful completion of the operation (see E-mail Reply Created). The newly-created interaction will have:

  • ToAddress equal to ReplyToAddress-from-original-email
  • FromnAddress equal to ToAddress-from-original-Email
  • Subject equal to subjectPrefix+original-email-subject
  • The body will be empty unless quoteOriginal is set to true and will be pre-pended by replyToStartLine and modified with indentCharacter, if present

HTTP Request

POST on /me/interactions/{id}

{
"operationName":"Reply",
"subjectPrefix":prefix-to-add-to-copy-of-subject-from-inbound-email (optional),
"replyToStartLine":line-to-add-before-quoting-original-text (optional),
"indentCharacter":indent-character-to-add-before-each-newline-of-original-text (optional),
"quoteOriginal":boolean-to-tell-whether-to-add-original-text 
"queueName":name-of-the-queue-where-to-place-interaction-while-agent-is-composing-it
}

HTTP Response

Success

{
"status":"ok"
}

Failed

{
"status":"error",
"errorDescription":details
}

CometD Response

{
"messageTypeName":"InteractionStateMessage",
"id":alpha-numeric-string,
"channel":"email",
"email_object" {
“ToAddress”:to-address,
“FromAddress”:from-address,
“CCAddresses”:cc-addresses,
"Subject":subject-of-the-email-in-string-representation,
"Text":text-of-email-as-text,
"StructuredText":text-of-email-formatted,
"MimeType":mime-type-of-text,
"StructuredTextMimeType":mime-type-of-structuredtext,
},
"interactionType":"Email",
"interactionSubType:"OutboundReply",
"receivedAt:value-of-attr_itx_received_at
"state":"ReplyCreated",
"capabilities":[“Cancel”,“Send”,“PlaceInWorkbin”,“UpdateProperties”,"LinkAttachment"]
}

ReplyAll

This operation can be performed after an agent (User) has accepted an e-mail interaction. The ReplyAll operation creates an interaction in the Interaction Server and the Universal Contact Server. The operation is asynchronous, meaning that a CometD notification will be sent upon successful completion of the operation (see E-mail Reply Created). The newly-created e-mail interaction will have:

  • ToAddress equal to ReplyToAddress-from-original-email
  • CCAddresses equal to CCAddresses-from-original-email
  • FromAddress equal to ToAddress-from-original-Email
  • Subject equal to subjectPrefix+original-email-subject
  • The body will be empty unless quoteOriginal is set to true and will be pre-pended by replyToStartLine and modified with indentCharacter, if present

HTTP Request

POST on /me/interactions/{id}

{
"operationName":"ReplyAll",
"subjectPrefix":prefix-to-add-to-copy-of-subject-from-inbound-email (optional),
"replyToStartLine":line-to-add-before-quoting-original-text (optional),
"indentCharacter":indent-character-to-add-before-each-newline-of-original-text (optional),
"quoteOriginal":boolean-to-tell-whether-to-add-original-text -- default is true
"queueName":name-of-the-queue-where-to-place-interaction-while-agent-is-composing-it
}

HTTP Response

Success

{
"status":"ok",
"replyInteractionId":interactionId
}

Failed

{
"status":"error",
"errorDescription":details
}

CometD Response

{
"messageTypeName":"InteractionStateMessage",
"id":alpha-numeric-string,
"channel":"email",
"email_object" {
“ToAddress”:to-address,
“FromAddress”:from-address,
“CCAddresses”:cc-addresses,
"Subject":subject-of-the-email-in-string-representation,
"Text":text-of-email-as-text,
"StructuredText":text-of-email-formatted,
"MimeType":mime-type-of-text,
"StructuredTextMimeType":mime-type-of-structuredtext,
},
"interactionType":"Email",
"interactionSubType:"OutboundReply",
"receivedAt:value-of-attr_itx_received_at
"state":"ReplyCreated",
"capabilities":[“Cancel”,“Send”,“PlaceInWorkbin”,“UpdateProperties”,"LinkAttachment"]
}

Send

This operation is used to send the contents of the e-mail that an agent has created.

HTTP Request

POST on /me/interactions/{id}

{
"operationName":"Send",
"queueName":queue-name-to-place-interaction-in,
"email_object": {
 "toAddress":to-address,
 "subject":email-subject,
 "text":text-of-email,
 "fromAddress":from-address,
 "ccAddress":cc-addresses, //optional
 "bccAddress":bcc-addresses //optional
}
}

HTTP Response

Success

{
"status":"ok"
}

Failed

{
"status":"error",
"errorDescription":details
}


Create

This operation can be performed to create a new interaction of type email. The new interaction will come to the agent via the CometD notification described in E-mail Reply Created.

HTTP Request

POST on /me/interactions/

{
"operationName":"Create",
"queueName":name-of-queue-where to store the interaction,
"interactionType":type of the interaction to be created (e.g. Outbound),
"interactionSubType":subtype of the interaction to be crated (e.g. OutboundNew)
}

HTTP Response

Success

{
"status":"ok"
} 

Failed

{
"status":"error",
"errorDescription":details
}

Attachments API

A Web Services attachment is the same as an e-mail attachment. In Platform SDK terms, an attachment is simply a document. Attachments are associated with one Interaction, while one Interaction can own many Attachments.

Important
These operations are not for AJAX, but should be performed as regular HTTP requests.

Operations

The following operations are supported on /me/interactions/{id}/attachments:

HTTP Operation Description Output Permissions
POST Creates a new Attachment and associates it with an Interaction. Note: The file should be bound to the 'attachment' variable. {"statusCode":0,"documentId":"00009a8T8Y13002S"} Agent

The following operations are supported on /me/interactions/{id}/attachments/{attachmentId}:

HTTP Operation Description Output Permissions
GET Returns an Attachment, given an attachmentId (documentId). Output will be byte content of the attachment, with MimeType set accordingly Agent
DELETE Deletes an Attachment, given an attachmentId (documentId). {"statusCode":0} Agent


See also:

This page was last edited on October 31, 2023, at 13:29.
Comments or questions about this documentation? Contact us for support!