Zendesk Get WhatsApp Messages
This function extracts the first message from a WhatsApp chat transcript within an array (list) of Zendesk comment objects. The message is identified by the initial timestamp in the plain_body of the transcript. If no chat transcript is found, the function returns success: false.
Inputs
Name | Type | Description |
---|---|---|
Comments | List | Array of comment objects from Zendesk, containing metadata and message content |
Outputs
Name | Type | Description |
---|---|---|
Success | Boolean | Indicates whether the WhatsApp message was successfully extracted |
FirstMessage | String | The first message in the WhatsApp chat transcript, based on the initial timestamp sequence |
Notes
- Ensure that the Comments array includes at least one chat_transcript-type comment in the via.channel field for message extraction.
- The function extracts the message from plain_body under the format (timestamp) User: Message.
Updated 4 days ago