【问题标题】:Amazon Pinpoint SMS For India适用于印度的 Amazon Pinpoint SMS
【发布时间】:2021-11-10 06:42:59
【问题描述】:

我正在尝试实施亚马逊的 Pinpoint SMS。印度对发送短信有特殊要求。我遵循了这个Documentation 并将EntityId 和TemplateId 作为额外参数添加到pinpoint.sendMessages。但是当我这样做时,我得到了。

  • UnexpectedParameter:在 params.MessageRequest.MessageConfiguration.SMSMessage 中发现意外的键 'EntityId'
  • UnexpectedParameter:在 params.MessageRequest.MessageConfiguration.SMSMessage 中发现意外的键“TemplateId”

代码

参考:AWS Official Pinpoint SMS Doc

 let params = {
            ApplicationId: applicationId,
            MessageRequest: {
                Addresses: {
                    [destinationNumber]: {
                        ChannelType: 'SMS'
                    }
                },
                MessageConfiguration: {
                    SMSMessage: {
                        Body: body,
                        EntityId: entityID,
                        Keyword: registeredKeyword,
                        MessageType: messageType,
                        OriginationNumber: originationNumber,
                        SenderId: senderId,
                        TemplateId: templateID
                      },
                }
            }
        };

        //Try to send the message.
        pinpoint.sendMessages(params, function (err, data) {
            // If something goes wrong, print an error message.
            if (err) {
                console.log(err.message);
                // Otherwise, show the unique ID for the message.
            } else {
                console.log(data)
                // console.log("Message sent! "
                //     + data['MessageResponse']['Result'][destinationNumber]['StatusMessage']);
            }
        });

【问题讨论】:

    标签: node.js amazon-web-services amazon-sns aws-pinpoint


    【解决方案1】:

    AWS-SDK2.467.0 迁移到 2.850 解决了我的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多