This document explains the response structure for the Post Collaboration Survey (PCS) form submission API. The API captures survey form submissions and logs them as activities, providing a comprehensive overview of each submission.
Mock API for PCS Activity Response
http://38.242.158.52:1880/mock
Response Structure
The response is structured as a JSON object with the following main fields:
-
hasPrevPage: Boolean indicating if there is a previous page of results. -
docs: An array of document objects representing a form submission activity.
Document Object (docs)
Each document object contains detailed information about the form submission activity. The key fields in a document object are:
-
id: Unique identifier for the activity. -
name: The type of message or activity, e.g.,CUSTOMER_MESSAGE. -
type: The message type, e.g.,MESSAGE. -
timestamp: The timestamp when the activity was recorded. -
conversationId: Unique identifier for the conversation.
Event Emitter (eventEmitter)
The eventEmitter field contains information about the entity that triggered the event:
-
id: Unique identifier for the emitter. -
type: The type of the emitter, e.g.,CUSTOMER. -
senderName: Name of the sender. -
additionalDetail: Additional details about the emitter, such as voice information.
Channel Session (channelSession)
The channelSession field provides information about the channel session:
-
id: Unique identifier for the channel session. -
participantType: The type of participant, e.g.,ChannelSession. -
channel: Information about the channel used for the session, including:-
id: Channel identifier. -
name: Name of the channel, e.g.,CX Voice Channel. -
serviceIdentifier: Service identifier for the channel. -
tenant: Information about the tenant. -
channelConfig: Configuration details for the channel. -
channelConnector: Details about the channel connector. -
channelType: Type of the channel.
-
Customer Information (customer)
The customer field contains information about the customer:
-
_id: Unique identifier for the customer. -
firstName: First name of the customer. -
phoneNumber: Array of phone numbers associated with the customer. -
isAnonymous: Boolean indicating if the customer is anonymous. -
voice: Array of voice details related to the customer.
Channel Data (channelData)
The channelData field provides additional data about the channel:
-
channelCustomerIdentifier: Identifier for the customer within the channel. -
serviceIdentifier: Service identifier. -
requestPriority: Priority of the request. -
customerFirstName: First name of the customer (if available). -
customerLastName: Last name of the customer (if available). -
additionalAttributes: Array of additional attributes.
Data (data)
The data field contains the actual form submission data:
-
id: Identifier for the form data. -
header: Header information for the form submission, including sender and session details. -
body: The main content of the form submission, including:-
type: Type of data, e.g.,FORM_DATA. -
markdownText: will always benull. -
formId: Unique identifier for the form. -
formType: Type of form, e.g.,Survey. -
formTitle: Title of the form, e.g.,PCS Activity Form. -
enableWeightage: Boolean indicating if weightage is enabled. -
enableSections: Boolean indicating if sections are enabled. -
formWeightage: Overall weightage of the form (if applicable). -
sentiment: Sentiment of the responses (if applicable). -
additionalDetail: if applicable can have additional information as an object otherwisenull. -
sections: Array of sections within the form, each containing:-
sectionId: Unique identifier for the section. -
sectionName: Name of the section. -
sectionWeightage: Weightage of the section (if applicable). -
attributes: Array of attributes (questions) within the section, each containing:-
id: Unique identifier for the attribute. -
label: Label for the attribute. -
valueType: Type of value, e.g.,boolean,nps,5-star-rating. -
attributeType: Type of attribute, e.g.,INPUT,OPTIONS,TEXTAREA. -
skipType: Skip type (if applicable). -
attributeAttachment: Attachment associated with the attribute. -
attributeWeightage: Weightage of the attribute (if application). -
answer: Array of answers, each containing:-
label: Label for the answer. -
value: Value of the answer. -
additionalAttributes: Additional attributes for the answer. (if applicable)-
optionWeightage: Weightage of the option (if applicable). -
enableStyle: Boolean indicating if Answer contains styles or not. -
optionStyle: Object containing styles of the option (if applicable only in case enableStyle istrue).
name: Name of any icon (if applicable).
type: Type of any icon (if applicable).
color: Color code as a string of any selected option likeNPSeg,#00000.
media: Url of the icon of any selected option eg,https://xyz.com/file-server/xyz.png
-
-
-
-
-
Room Info (roomInfo)
The roomInfo field provides information about the room where the activity took place:
-
id: Unique identifier for the room. -
mode: Mode of the room, e.g.,CONTACT_CENTER.
Sample Response
Submitted Form Scenarios
-
If any question
attributeTypeisINPUTandTEXTAREAthen theanswerarray will contain a string value at index zero. -
If any question
attributeTypeisOPTIONSthen theanswerarray will contain an object value as defined in the schema. -
if any question is not required while submitting the form, its
answerarray will beempty, whereas itsskipTypecontains a string with a relevant skip reason. for exampleskipType: "optional"in case of unanswered questions. -
By default one section exists in the schema as well as in the submitted FORM_DATA activity, can add more by enabling sections
enableSections: "true". -
A minimum of one question is required in a form while creating in the form builder.
-
additionalAttributesin case of OPTIONS will always contain an object and in that key values may vary as per use cases.