使用WhatsApp Cloud API发送商务经理目录产品

发布于 2025-02-12 17:32:27 字数 2153 浏览 0 评论 0 原文

在成功将目录从Commerce Manager添加到WhatsApp Manager之后,我想通过WhatsApp Cloud API向用户发送此产品,我已经看到了与On-Permiss API相关的链接,但发现没有运气。

到目前为止,我的请求车身代码:

https:https:https:https:https:https:https:https:https: //graph.facebook.com/v13.0/ {{phone-number-id} }/messages

{
"interactive": {
    "messaging_product": "whatsapp",
    "to": "9***********",
    "type": "product",
    "body": {
      "text": "text-body-content"
    },
    "footer": {
      "text": "text-footer-content"
    },
    "action": {
      "catalog_id": "11111111111111",
      "product_retailer_id": "2222"
    }
  }
}

错误:

 {
    "error": {
        "message": "(#100) The parameter messaging_product is required.",
        "type": "OAuthException",
        "code": 100,
        "fbtrace_id": "AZ-AFvM-Nsnm62de34st5mMJxzJ"
    }
}

另一个请求

{ 
    "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to" : "**********",
  "type": "interactive",
  "interactive": {
    "type": "product",
    "body": {
      "text": "body text"
    },
    "footer": {
      "text": "footer text"
    },
    "action": {
      "catalog_id": "1968701893374783",
      "product_retailer_id": "5493"
    }
  }
}

Result: {
    "error": {
        "message": "(#131009) Parameter value is not valid",
        "type": "OAuthException",
        "code": 131009,
        "error_data": {
            "messaging_product": "whatsapp",
            "details": "Interactive Message type,  'product' not supported. Supported types ['button', 'list']"
        },
        "error_subcode": 2494010,
        "fbtrace_id": "AntQdhmCkgZ0Xtaz643Bgq"
    }
}

After successfully adding my catalog from Commerce manager to Whatsapp manager, now I want to send the user this product via WhatsApp cloud API, I have seen the link which is related to the on-permises API, but found no luck.

https://developers.facebook.com/docs/whatsapp/guides/commerce-guides/share-products-with-customers.

my request body code so far:

https://graph.facebook.com/v13.0/{{Phone-Number-ID}}/messages

{
"interactive": {
    "messaging_product": "whatsapp",
    "to": "9***********",
    "type": "product",
    "body": {
      "text": "text-body-content"
    },
    "footer": {
      "text": "text-footer-content"
    },
    "action": {
      "catalog_id": "11111111111111",
      "product_retailer_id": "2222"
    }
  }
}

error:

 {
    "error": {
        "message": "(#100) The parameter messaging_product is required.",
        "type": "OAuthException",
        "code": 100,
        "fbtrace_id": "AZ-AFvM-Nsnm62de34st5mMJxzJ"
    }
}

another request

{ 
    "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to" : "**********",
  "type": "interactive",
  "interactive": {
    "type": "product",
    "body": {
      "text": "body text"
    },
    "footer": {
      "text": "footer text"
    },
    "action": {
      "catalog_id": "1968701893374783",
      "product_retailer_id": "5493"
    }
  }
}

Result: {
    "error": {
        "message": "(#131009) Parameter value is not valid",
        "type": "OAuthException",
        "code": 131009,
        "error_data": {
            "messaging_product": "whatsapp",
            "details": "Interactive Message type,  'product' not supported. Supported types ['button', 'list']"
        },
        "error_subcode": 2494010,
        "fbtrace_id": "AntQdhmCkgZ0Xtaz643Bgq"
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

悲欢浪云 2025-02-19 17:32:27

更新:

它是从2022年8月25日开始支持

您现在可以在发送给客户的消息中包括产品和服务,而客户可以将它们添加到购物车中,而无需离开聊天线程。请参阅卖出产品&服务指南,学习如何向客户发送单一和多产品消息。


不支持产品 product_list cloud api ,但您可以在 on-Premises api api ,

可能是仍在开发中,您可以跟踪Facebook社区中的对话,

  • 1094784808057904
  • href =“ https://developers.facebook.com/community/threads/415039447294216/” rel =“ nofollow noreferrer”> 415039447294216

Update:

It is supporting from Aug 25, 2022,

You can now include products and services in messages sent to customers, and customers can add them to shopping carts without having to leave the chat thread. Refer to the Sell Products & Services guide to learn how to send Single and Multi-Product messages to customers.


There is no support for product and product_list types in Cloud API, but you can use it in On-Premises API,

Might be it is still in development, You can track the conversations in Facebook Community,

杀手六號 2025-02-19 17:32:27
data = {
    "messaging_product": "whatsapp",
    "to": m_id,
    "type": "interactive",
    "interactive":

        {
            "type": "product_list",
            "header": {
                "type": "text",
                "text": "header text"
            },
            "body": {
                "text": "body text"
            },
            "footer": {
                "text": "footer text"
            },
            "action": {
                "catalog_id": "catalog id",
                "sections": [
                    {
                        "title": "section title",
                        "product_items": [
                            {"product_retailer_id": "product id"},
                        ]},
                    {
                        "title": "section title",
                        "product_items": [
                            {"product_retailer_id": "product id"},
                         
                        ]},
                ]

            },
        }


             }
data = {
    "messaging_product": "whatsapp",
    "to": m_id,
    "type": "interactive",
    "interactive":

        {
            "type": "product_list",
            "header": {
                "type": "text",
                "text": "header text"
            },
            "body": {
                "text": "body text"
            },
            "footer": {
                "text": "footer text"
            },
            "action": {
                "catalog_id": "catalog id",
                "sections": [
                    {
                        "title": "section title",
                        "product_items": [
                            {"product_retailer_id": "product id"},
                        ]},
                    {
                        "title": "section title",
                        "product_items": [
                            {"product_retailer_id": "product id"},
                         
                        ]},
                ]

            },
        }


             }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文