Apache Karavan 集成 Whatsapp 消息

问题描述 投票:0回答:1

我已经生成了一个 yaml,使用 apache karavan 在 Whatsapp 上每 10 秒发送一次消息,但我在哪里输入收件人电话号码?我也找不到任何有关它的文档

这是我的yaml:

route:
    id: route-408f
    nodePrefixId: route-432
    from:
      id: from-9db7
      uri: kamelet:timer-source
      parameters:
        message: huhih
        period: 100000
      steps:
        - to:
            id: to-bb44
            uri: whatsapp
            pattern: InOnly
            parameters:
              authorizationToken: >-
               ***
              phoneNumberId: '***'
              apiVersion: v18.0
              baseUri: https://graph.facebook.com

根据camel文档,收件人号码在标题中提供。但卡拉万没有给出这样的选择。

yaml apache-camel whatsapp bpmn
1个回答
0
投票

尝试使用setHeader EIP

- route:
id: route-408f
from:
  id: from-9db7
  uri: kamelet:timer-source
  parameters:
    message: huhih
    period: 100000
  steps:
    - setHeader:
        id: setHeader-3951
        expression:
          constant:
            expression: recipientPhoneNo
        name: CamelWhatsAppRecipientPhoneNumberId
    - to:
        id: to-bb44
        uri: whatsapp
        parameters:
          apiVersion: v18.0
          authorizationToken: "***"
          baseUri: https://graph.facebook.com
          phoneNumberId: "***"
        pattern: InOnly
nodePrefixId: route-432
© www.soinside.com 2019 - 2024. All rights reserved.