Unable to retrieve data from catalog using WhatsApp Cloud API - whatsapp

I'm unable to send multiproduct messages to users. Every time I send the request I receive the same error. The following attachment shows the catalog connected to the number.
The body of the request:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "###########",
"type": "interactive",
"interactive": {
"type": "product_list",
"header": {
"type": "text",
"text": "text-header-content"
},
"body": {
"text": "text-body-content"
},
"footer": {
"text": "text-footer-content"
},
"action": {
"catalog_id": "673529427462715",
"sections": [
{
"title": "the-section-title",
"product_items": [
{
"product_retailer_id": "K456653445"
}
]
}
]
}
}
}
The error received:
{
"error": {
"message": "(#131009) Parameter value is not valid",
"type": "OAuthException",
"code": 131009,
"error_data": {
"messaging_product": "whatsapp",
"details": "None of the products provided could be sent. Please check your catalog."
},
"error_subcode": 2494010,
"fbtrace_id": "A4YbEq8SQ7rMIisuc4M2HiX"
}
}

Related

Send Commerce Manager catalog product using WhatsApp Cloud API

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"
}
}
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,
1094784808057904
415039447294216
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"},
]},
]
},
}
}

Whatsapp API (#132000) Number of parameters does not match the expected number of params

I created below template in Whatsapp API. And I want to set the parameter value in the API call. What is the correct payload ? I have been following the Meta docs and trying but everytime I get error. Please Help.
Template:
You order # {{1}} is received successfully.
I used this payload:
{
"messaging_product": "whatsapp",
"to": "918456712349",
"type": "template",
"template": {
"name": "order_notification",
"language": {
"code": "en_US"
}
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "135345345"
}
]
}
]
}
But I am still getting this error
{
"error": {
"message": "(#132000) Number of parameters does not match the expected number of params",
"type": "OAuthException",
"code": 132000,
"error_data": {
"messaging_product": "whatsapp",
"details": "body: number of localizable_params (0) does not match the expected number of params (1)"
},
"error_subcode": 2494002,
"fbtrace_id": "AzPa-uWXctIcdNVu0Lf3Fic"
}
}
The issue due to closing the template object then opening a new component object.
make the component object inside the template object and it will be fixed
{
"messaging_product": "whatsapp",
"to": "918456712349",
"type": "template",
"template": {
"name": "order_notification",
"language": {
"code": "en_US"
}
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "135345345"
}
]
}
]
}
}
change in parameter type "header", this code run for me:
{
"messaging_product": "whatsapp",
"to": "918456712349",
"type": "template",
"template": {
"name": "order_notification",
"language": {
"code": "en_US"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "text",
"text": "xxxxxxx"
}
]
}
]
}
}
Looks like the template is expecting 1 parameter, which is not being provided.
You can look at the documentation and example here.
It includes a working example.

Sample code for WhatsApp interactive template message

Does anyone have a sample code for WhatsApp interactive template message?
I am trying to trigger an API from postman but getting the below error:
{
"meta": {
"api_status": "stable",
"version": "2.37.1"
},
"errors": [
{
"code": 2012,
"title": "Parameter format does not match format in the created template",
"details": "header: Format mismatch, expected Video, received Unknown",
"href": "https://developers.facebook.com/docs/whatsapp/faq#faq_1612022582274564"
}
]
}
Here is what I added in the body:
{
"to": "91NUMBER",
"type": "template",
"template": {
"namespace": "NAMESPACE_ID",
"language": {
"policy": "deterministic",
"code": "en"
},
"name": "TEMPLATE_NAME",
"components": [
{
"type": "header",
"parameters": [
{
"type": "video",
"video": {
"link": "https://res.cloudinary.com/MY_VIDEO_LINK"
}
}
],
"type": "button",
"sub_type": "url",
"index": "0",
"parameters": [
{
"type": "text",
"text": "9rwnB8RbYmPF5t2Mn09x4h"
}
]
}
]
}
}
Any sort of help would be appreciated.
PS: I'm still new to this.
Use the below code maybe it works
{
"to": "91NUMBER",
"type": "template",
"template": {
"namespace": "NAMESPACE_ID",
"language": {
"policy": "deterministic",
"code": "en"
},
"name": "TEMPLATE_NAME",
"components": [
{
"type": "header",
"parameters": [
{
"type": "video",
"video": {
"link": "https://res.cloudinary.com/MY_VIDEO_LINK"
}
}
]
},
{
"type": "button",
"sub_type": "url",
"index": "0",
"parameters": [
{
"type": "text",
"text": "9rwnB8RbYmPF5t2Mn09x4h"
}
]
}
]
}
}

Deploying template using PowerShell script failed

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountType": {
"type": "string",
"defaultValue": "eNtsaBuilding M103",
"metadata": {
"description": "Storage Account type"
}
}
},
"variables": {
"MandelaUniversity2019": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
},
"resources": [
{
"type": "Microsoft.Storage/eNtsaResourcesIOT",
"name": "[variables('MandelaUniversity2019')]",
"apiVersion": "2018-01-06",
"location": "[resourceGroup().location]",
"sku": {
"name": "[parameters('storageAccountType')]"
},
"kind": "Storage",
"properties": {
}
}
],
"outputs": {
"MandelaUniversity2019": {
"type": "string",
"value": "[variables('MandelaUniversity2019')]"
}
}
}
14:16:57 - 2:16:56 PM - Resource Microsoft.Storage/eNtsaResourcesIOT 'fi7so6zmvqa2istandardsa' failed with message '{
14:16:57 - "error": {
14:16:57 - "code": "InvalidResourceType",
14:16:57 - "message": "The resource type could not be found in the namespace 'Microsoft.Storage' for api version '2018-01-06'."
14:16:57 - }
14:16:57 - }'
How do i solve this problem, i am trying to create a template using VS 2019 and my deploymentJSON script indicate that error. Please assist as i dont know Yes invalidResourceType but i do have that Resource type on my portal. Is there anything should add or modify on this JSON script? Please guide me to resolve this issue, thanks.
As mentioned in the comments, use this:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountType": {
"type": "string",
"defaultValue": "eNtsaBuilding M103",
"metadata": {
"description": "Storage Account type"
}
}
},
"variables": {
"MandelaUniversity2019": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
},
"resources":[
{
"type":"Microsoft.Storage/storageAccounts",
"name":"[variables('storageAccountName')]",
"apiVersion":"2018-07-01",
"location":"eastus",
"sku":{
"name":"Standard_LRS",
"tier":"Standard"
},
"kind":"Storage",
"properties":{
}
}
],
"outputs": {
"MandelaUniversity2019": {
"type": "string",
"value": "[variables('MandelaUniversity2019')]"
}
}
}

INVALID_ARGUMENT projects.locations.transferConfig.create

I try to create projects.locations.transferConfig.create on the page
https://cloud.google.com/bigquery/docs/reference/datatransfer/rest/v1/projects.locations.transferConfigs/create
set parent projects/1069829667403/locations/eu
and Request body
{
"dataRefreshWindowDays": 10,
"destinationDatasetId": "stat",
"displayName": "test",
"dataSourceId": "adwords",
"params": {
"customer_id": "5030341011"
}
}
and have error
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
What am I doing wrong?
Request body should look like this:
{
"dataRefreshWindowDays": 10,
"destinationDatasetId": "stat",
"displayName": "test",
"dataSourceId": "adwords",
"params": {
"fields": {
"key": "customer_id",
"value": {
"string_value": "5030341011"
}
}
}
}