Class WhatsAppService

java.lang.Object
com.bytedesk.social.whatsapp.config.WhatsAppService

@Service public class WhatsAppService extends Object
  • Field Details

    • whatsAppConfig

      private final WhatsAppConfig whatsAppConfig
    • restTemplate

      private final org.springframework.web.client.RestTemplate restTemplate
    • objectMapper

      private final com.fasterxml.jackson.databind.ObjectMapper objectMapper
  • Constructor Details

    • WhatsAppService

      public WhatsAppService()
  • Method Details

    • sendTextMessage

      public void sendTextMessage(String to, String text)
      Send text message to WhatsApp user
    • processWebhookEvent

      public void processWebhookEvent(WhatsAppWebhookEvent event)
      Process incoming webhook event from WhatsApp
    • verifyWebhook

      public boolean verifyWebhook(String mode, String verifyToken, String challenge)
      Verify webhook token
    • processWebhookEvent

      public void processWebhookEvent(String rawBody)
      Process incoming webhook event from WhatsApp (raw JSON string)
    • processMessageChange

      private void processMessageChange(com.fasterxml.jackson.databind.JsonNode value)
    • setBusinessProfile

      public boolean setBusinessProfile()
      设置WhatsApp Business Profile