Documentation

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

NameTypeDescription
CommentsListArray of comment objects from Zendesk, containing metadata and message content

Outputs

NameTypeDescription
SuccessBooleanIndicates whether the WhatsApp message was successfully extracted
FirstMessageStringThe 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.