Press Ticket icon

Press Ticket

Interage com a API do Press Ticket®

Overview

This node integrates with the Press Ticket® API to perform various operations related to communication management, including handling messages, contacts, tickets, queues, tags, WhatsApp connections, and sessions. Specifically, for the Mensagem (Message) resource and the Obter Mídia em Base64 (Get Media in Base64) operation, the node retrieves media content associated with a message by its ID and returns it encoded in base64 format.

This functionality is useful when you need to fetch media files (images, videos, audio, documents) sent or received in messages and process or store them within your workflows without downloading the files separately. For example, you might want to archive media attachments from customer support chats or analyze images sent via WhatsApp.

Properties

Name Meaning
ID da Mensagem The unique identifier of the message that contains the media to be retrieved in base64.

Output

The output JSON object for the "Obter Mídia em Base64" operation includes:

  • success: Boolean indicating if the media retrieval was successful.
  • messageId: The ID of the message queried.
  • mediaType: Type of media (e.g., image, video, audio, document).
  • filename: The name of the media file (fallbacks to a generic name if not provided).
  • mimeType: MIME type of the media.
  • Binary data under the binary property:
    • data: Contains the base64-encoded media content.
    • mimeType: The MIME type of the media.
    • fileName: The filename of the media.

If the media is not found or an error occurs, the output will contain:

  • success: false
  • messageId: The requested message ID
  • error: Description of the error encountered
  • response: Raw response from the API (if applicable)

The binary data allows downstream nodes to handle the media as a file, such as saving it to disk or uploading it elsewhere.

Dependencies

  • Requires an API key credential for authenticating with the Press Ticket® API.
  • The node uses the API URL and token from the configured credentials.
  • Network access to the Press Ticket® API endpoints is necessary.

Troubleshooting

  • Media Not Found: If the media data is missing in the response, ensure the message ID is correct and that the message actually contains media.
  • Parsing Errors: The node attempts to parse JSON responses but falls back to string parsing if needed. If parsing fails, check the API response format and network connectivity.
  • Authentication Issues: Verify that the API token credential is valid and has sufficient permissions.
  • Disabled Features: Sending media is currently disabled in this node implementation; attempting to use that operation will throw an error.
  • Empty Input: Ensure the input message ID is provided and non-empty.

Links and References

  • Press Ticket® Official Website (for general product info)
  • API documentation should be consulted for detailed endpoint behavior and media handling specifics (not included in the source code).

Discussion