如何在Facebook Messenger平台中创建和发送本地化的广播消息

时间:2018-10-09 12:30:55

标签: localization facebook-messenger-bot

我可以创建并发送广播简单消息或带有附件的消息,但是我不知道如何为接收者用户本地化消息。我订阅的用户有不同的本地化语言,例如en_US,ps_AF或fa_IR,如何为每种语言制作自定义消息?这是我的带有按钮的消息:

curl -X POST -H "Content-Type: application/json" -d '{
    "messages":[
        {
            "attachment":
            {
                "type": "template",
                "payload":
                {
                    "template_type": "generic",
                    "elements": [
                    {
                        "title": "Lorem ipsum, dolor sit amet consectetur adipisicing elit",
                        "subtitle": "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Minima harum eius similique mollitia quas.",
                        "item_url": "https://baztab.news/dummyURL",
                        "image_url": "https://baztab.news/dummyImageNameHere.jpg",
                        "buttons": [
                        {
                            "type": "web_url",
                            "title": "Read More",
                            "url": "https://baztab.news/dummyURL"
                        },
                        {
                            "type": "postback",
                            "title": "Today News",
                            "payload": "payload_top_today_news"
                        },
                        {
                            "type": "element_share"
                        }]
                    }],
                    "image_aspect_ratio": "horizontal"
                }
            }
        }
    ]
}' "https://graph.facebook.com/v2.11/me/message_creatives?access_token=<PAGE_ACCESS_TOKEN>"

0 个答案:

没有答案