Skip to main content
Skip table of contents

Post Collaboration Survey (PCS) Activity API Response

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 be null.

    • 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 otherwise null.

    • 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 is true).
              name: Name of any icon (if applicable).
              type: Type of any icon (if applicable).
              color: Color code as a string of any selected option like NPS eg, #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

PCS Form Submission API Sample Response containing all possible questions (attributes)
JSON
{
  "hasPrevPage": false,
  "docs": [
    {
      "id": "66912f46b2e2af3d42863c96",
      "name": "CUSTOMER_MESSAGE",
      "type": "MESSAGE",
      "timestamp": "2024-07-12T13:27:34.004+00:00",
      "conversationId": "66912f45b4663e4bd8a8ed53",
      "eventEmitter": {
        "id": "66911b69391d8c99f45bdd9c",
        "type": "CUSTOMER",
        "senderName": "1010",
        "additionalDetail": {
          "voice": ["1010"]
        }
      },
      "channelSession": {
        "id": "66912f45b2e2af3d42863c23",
        "participantType": "ChannelSession",
        "channel": {
          "id": "6634c116f80cdb7442413adc",
          "name": "CX Voice Channel",
          "serviceIdentifier": "1225",
          "tenant": {
            "id": "6634c116f80cdb7442413ae2",
            "name": null
          },
          "channelConfig": {
            "id": "6634c116f80cdb7442413ae3",
            "channelMode": "HYBRID",
            "conversationBot": "",
            "responseSla": 0,
            "customerActivityTimeout": 3600,
            "customerIdentificationCriteria": {
              "value": null
            },
            "routingPolicy": {
              "agentSelectionPolicy": "LONGEST_AVAILABLE",
              "routeToLastAgent": true,
              "routingMode": "PUSH",
              "routingObjectId": "6634bbcff390d704fa824fe1",
              "agentRequestTtl": 3600
            },
            "botId": "6634bfe9823a1a2570f7a2cf"
          },
          "channelConnector": {
            "id": "6634bd76f80cdb7442413ad6",
            "name": "voice-connector",
            "channelProviderInterface": {
              "id": "6634bd4ff80cdb7442413ad4",
              "name": "CX-Voice Provider",
              "supportedChannelTypes": [
                {
                  "id": "6633d47ef80cdb7442413acd",
                  "name": "CX_VOICE",
                  "channelLogo": "_CX_VOICE.svg",
                  "isInteractive": true,
                  "mediaRoutingDomain": "62f9e360ea5311eda05b0242"
                }
              ],
              "providerWebhook": "http://192.168.2.24:8115/ccm-msg/receive",
              "channelProviderConfigSchema": []
            },
            "channelProviderConfigs": [],
            "tenant": {
              "id": "6662ab5be2f24e52baa63595",
              "name": null
            }
          },
          "channelType": {
            "id": "6633d47ef80cdb7442413acd",
            "name": "CX_VOICE",
            "channelLogo": "_CX_VOICE.svg",
            "isInteractive": true,
            "mediaRoutingDomain": "62f9e360ea5311eda05b0242"
          }
        },
        "customer": {
          "_id": "66911b69391d8c99f45bdd9c",
          "firstName": "1010",
          "phoneNumber": [],
          "isAnonymous": true,
          "__v": 0,
          "voice": ["1010"]
        },
        "customerSuggestions": [],
        "channelData": {
          "channelCustomerIdentifier": "1010",
          "serviceIdentifier": "1225",
          "requestPriority": 0,
          "customerFirstName": null,
          "customerLastName": null,
          "additionalAttributes": []
        },
        "latestIntent": null,
        "customerPresence": {
          "value": null
        },
        "isActive": true,
        "conversationId": "66912f45b4663e4bd8a8ed53",
        "roomInfo": {
          "id": "66911b69b4663e4bd8a4e6b7",
          "mode": "CONTACT_CENTER"
        },
        "state": {
          "name": "STARTED",
          "reasonCode": "CUSTOMER"
        },
        "channelSessionDirection": "INBOUND",
        "active": true
      },
      "data": {
        "id": "15242",
        "header": {
          "sender": {
            "id": "f1370ff7-43fa-496e-9966-e64061d35f5c",
            "type": "IVR",
            "senderName": "MY-IVR",
            "additionalDetail": null
          },
          "channelData": {
            "channelCustomerIdentifier": "1010",
            "serviceIdentifier": "1225",
            "requestPriority": 0,
            "customerFirstName": null,
            "customerLastName": null,
            "additionalAttributes": []
          },
          "language": null,
          "timestamp": 1720790853857,
          "securityInfo": null,
          "stamps": null,
          "intent": "IVR_ACTIVITY",
          "entities": null,
          "channelSessionId": "66912f45b2e2af3d42863c23",
          "conversationId": "66912f45b4663e4bd8a8ed53",
          "customer": {
            "_id": "66911b69391d8c99f45bdd9c",
            "firstName": "1010",
            "phoneNumber": [],
            "isAnonymous": true,
            "__v": 0,
            "voice": ["1010"]
          },
          "originalMessageId": null,
          "providerMessageId": null,
          "roomId": "66911b69b4663e4bd8a4e6b7",
          "schedulingMetaData": null
        },
        "body": {
          "type": "FORM_DATA",
          "markdownText": null,
          "formId": "669118abbd60d70049ee8044",
          "formType": "Survey",
          "formTitle": "PCS Activity Form",
          "enableWeightage": false,
          "enableSections": true,
          "formWeightage": null,
          "sentiment": null,
          "sections": [
            {  // Boolean Question Type Answer Response
              "sectionId": "66912a41bd60d70049ee8184",
              "sectionName": "New Section 1",
              "attributes": [
                {
                  "skipType": null,
                  "attributeAttachment": "https://efcx-frontend.expertflow.com/file-engine/api/downloadFileStream?filename=19808_yes_no.mp3",
                  "answer": [
                    {
                      "value": 2,
                      "optionWeightage": null,
                      "additionalAttributes": {
                        "optionStyle": {
                          "type": "filled",
                          "name": "Filled Angry",
                          "media": "https://efcx-frontend.expertflow.com/unified-admin/assets/images/form-assets/emoticon-filled-5.svg"
                        },
                        "enableStyle": true
                      },
                      "label": "No"
                    }
                  ],
                  "label": "New Question No 1",
                  "valueType": "boolean",
                  "id": "66912a41bd60d70049ee8185"
                }
              ],
              "sectionWeightage": null
            },
            {
              "sectionId": "66912a41bd60d70049ee8186",
              "sectionName": "New Section 2",
              "attributes": [
                {    // NPS Question Type Answer Response
                  "skipType": null,
                  "attributeAttachment": "https://efcx-frontend.expertflow.com/file-engine/api/downloadFileStream?filename=74678_nps.mp3",
                  "answer": [
                    {
                      "additionalAttributes": {
                        "optionStyle": {
                          "color": "#F14949",
                          "type": "nps",
                          "name": "Red"
                        },
                        "enableStyle": true
                      },
                      "optionWeightage": null,
                      "start": "Not Recommended",
                      "end": "Highly Recommended",
                      "label": null,
                      "value": 7
                    }
                  ],
                  "label": "New Question No 2",
                  "valueType": "nps",
                  "id": "66912a41bd60d70049ee8187"
                },
                {   // Checkbox Question Type Sample Response
                  "label": "New Question No 5",
                  "skipType": null,
                  "attributeAttachment": "https://efcx-frontend.expertflow.com/file-engine/api/downloadFileStream?filename=73243_three_options.mp3",
                  "id": "669123eabd60d70049ee811d",
                  "answer": [
                    {
                      "value": 1,
                      "label": "Option 1",
                      "optionWeightage": null,
                      "additionalAttributes": null
                    },
                    {
                      "value": 2,
                      "label": "Option 2",
                      "optionWeightage": null,
                      "additionalAttributes": null
                    },
                    {
                      "value": 4,
                      "label": "Option 3",
                      "optionWeightage": null,
                      "additionalAttributes": null
                    }
                  ],
                  "valueType": "checkbox"
                }
              ],
              "sectionWeightage": null
            },
            {
              "sectionId": "66912a41bd60d70049ee8188",
              "sectionName": "New Section 3",
              "attributes": [
                {       // 5-Star-Rating Question Type Sample Response
                  "skipType": null,
                  "attributeAttachment": "https://efcx-frontend.expertflow.com/file-engine/api/downloadFileStream?filename=62899_stars.mp3",
                  "answer": [
                    {
                      "additionalAttributes": {
                        "optionStyle": {
                          "type": "filled",
                          "name": "Angry",
                          "media": "https://efcx-frontend.expertflow.com/unified-admin/assets/images/form-assets/emoticon-filled-5.svg"
                        },
                        "enableStyle": true
                      },
                      "optionWeightage": null,
                      "label": "Text 5",
                      "value": 5
                    }
                  ],
                  "label": "New Question No 3",
                  "valueType": "5-star-rating",
                  "id": "66912a41bd60d70049ee8189"
                }
              ],
              "sectionWeightage": null
            },
            {
              "sectionId": "66912a41bd60d70049ee818a",
              "sectionName": "New Section 4",
              "attributes": [
                {    // Dropdown Question Type Sample Response
                  "attributeAttachment": "https://efcx-frontend.expertflow.com/file-engine/api/downloadFileStream?filename=73243_three_options.mp3",
                  "label": "New Question No 5",
                  "valueType": "dropdown",
                  "answer": [
                    {
                      "value": 3,
                      "label": "Option 3",
                      "additionalAttributes": {
                      "enableStyle": false,
                      "optionStyle": {}
                    },
                      "optionWeightage": null
                    }
                  ],
                  "id": "669123eabd60d70049ee811d",
                  "skipType": null
                  }
              ],
              "sectionWeightage": null
            },
            {
              "sectionId": "66912a41bd60d70049ee818a",
              "sectionName": "New Section 4",
              "attributes": [
                {    // Multiple Choice Question (MCQ) Type Sample Response
                  "attributeAttachment": "https://efcx-frontend.expertflow.com/file-engine/api/downloadFileStream?filename=73243_three_options.mp3",
                  "label": "New Question No 5",
                  "valueType": "mcq",
                  "answer": [
                    {
                      "value": 3,
                      "label": "Option 3",
                      "additionalAttributes": {
                      "enableStyle": false,
                      "optionStyle": {}
                    },
                      "optionWeightage": null
                    }
                  ],
                  "id": "669123eabd60d70049ee811d",
                  "skipType": null
                  }
              ],
              "sectionWeightage": null
            },
            {
              "sectionId": "66912a41bd60d70049ee818a",
              "sectionName": "New Section 4",
              "attributes": [
                {   // Short Answer Question Type Sample Response
                  "label": "New Question No 6",
                  "skipType": null,
                  "attributeAttachment": "https://efcx-frontend.expertflow.com/file-engine/api/downloadFileStream?filename=47594_stars.mp3",
                  "id": "669123eabd60d70049ee811e",
                  "answer": [
                    "this is my short answer"
                  ],
                    "valueType": "shortAnswer"
                },
                {     // Paragraph Question Type Sample Response
                  "label": "New Question No 6",
                  "skipType": null,
                  "attributeAttachment": "https://efcx-frontend.expertflow.com/file-engine/api/downloadFileStream?filename=47594_stars.mp3",
                  "id": "669123eabd60d70049ee811e",
                  "answer": [
                    "this is my short answer this is my short answer this is my short answer this is my short answer this is my short answer"
                  ],
                  "valueType": "paragraph"
                },
              ],
              "sectionWeightage": null
            }
          ]
        }
      },
      "roomInfo": {
        "id": "66911b69b4663e4bd8a4e6b7",
        "mode": "CONTACT_CENTER"
      }
    }
  ]
}

Submitted Form Scenarios

  1. If any question attributeType is INPUT and TEXTAREA then the answer array will contain a string value at index zero.

  2. If any question attributeType is OPTIONS then the answer array will contain an object value as defined in the schema.

  3. if any question is not required while submitting the form, its answer array will be empty, whereas its skipType contains a string with a relevant skip reason. for example skipType: "optional" in case of unanswered questions.

  4. 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".

  5. A minimum of one question is required in a form while creating in the form builder.

  6. additionalAttributes in case of OPTIONS will always contain an object and in that key values may vary as per use cases.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.