简体   繁体   中英

Which WhatsApp Business Account ID to use?

Can someone please clarify which is the correct WhatsApp Business Account ID to use to access the WhatsApp cloud API?

whatsapp API 示例

I have properly set up my webhook and can receive messages. However when I try to send a message using the WhatsApp Business Account ID (marked as number 1 in the attached image) provided here , I get the following error:

error: {
    message:
      "Unsupported post request. Object with ID '< my app id>' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
    type: "GraphMethodException",
    code: 100,
    error_subcode: 33,
    fbtrace_id: "AQXqjuSJKTWBnyJdUK_W-jj",
}, 

However when I switch to the second WhatsApp Business Account ID in the curl command (marked as number 2 in the attached image), it works.

What confuses me is that the incoming message has the first WhatsApp Business Account ID (marked number 1 in the attached image) like so:

message: {
  object: "whatsapp_business_account",
  entry: [
    {
      id: "xxxxxxxxxxxxxxx",  // This matches the first
      changes: [
          ...
      ],
    },
  ],
};

I am using the current api v14.0. Is there some setting I need to change?

Probably you need to add the user of this acces token to the WABA (Whatsapp Business Account). You can do it by accessing your Business Manager > Whatsapp Accounts menu.

If you don't know which user is this, you can paste the access token value on the Access Token Debug Tool to find out.

PS: it has to be done even for System Users!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM