MetaClient

@Service
class MetaClient(@Value(value = "${flow.meta.base-url}") baseUrl: String, objectMapper: ObjectMapper)(source)

Constructors

Link copied to clipboard
constructor(@Value(value = "${flow.meta.base-url}") baseUrl: String, objectMapper: ObjectMapper)

Functions

Link copied to clipboard

Cria um novo template na Meta para aprovação. Endpoint: POST /{waba_id}/message_templates

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Busca todos os templates da conta WABA. Endpoint: GET /{waba_id}/message_templates

Link copied to clipboard
fun sendDocumentMessage(phoneNumberId: String, token: String, to: String, documentUrl: String, filename: String, caption: String? = null): String

Envia um arquivo PDF ou Doc.

Link copied to clipboard
fun sendImageMessage(phoneNumberId: String, token: String, to: String, imageUrl: String, caption: String? = null): String

Envia uma imagem hospedada publicamente (ex: R2/S3).

Link copied to clipboard
fun sendTemplateMessage(phoneNumberId: String, token: String, to: String, templateName: String, language: String = "pt_BR", components: List<MetaComponent> = emptyList()): String

Envia um Template pré-aprovado.

Link copied to clipboard
fun sendTextMessage(phoneNumberId: String, token: String, to: String, content: String): String
Link copied to clipboard

Verifica se o Token e o Phone ID são válidos consultando a API da Meta. Retorna os dados do número (ex: display_phone_number) se sucesso.