I am getting the error below when I am trying to publish my flow.
Here is a snippet of my endpoint, it's afirebase cloud function
exports.webhook = functions.https.onRequest( (request,response)=>{
const body = request.body;
const { decryptedBody, aesKeyBuffer, initialVectorBuffer } = decryptRequest(
body
);
const { screen, data, version, action } = decryptedBody;
if (action === "ping") {
const res = `{
"version": "3.0",
"data": {
"status": "active"
}
}`
response.send(res)
}
})
As per the Encrypted Secure Data Channel Docs for WhatsApp Flows.
After processing the decrypted request, create a response (which must be encrypted) before sending it back to the WhatsApp client. Encrypt the payload using the AES key received in the request according to the rules specified below and send it back as a Base64 string. You can reference an example of how to encrypt the response here.
Please make sure that you are encrypting the response, as it is not obvious from the code snippet if this is being done.
Thanks for using WhatsApp Flows, and please reach out if you still face problems :)