Problem with the payload
# 🤝help
p
Hi im trying to access the source_url from the logs but i can't, in event.payload its only the text, i already check all variables in event but there is nothing, so i can't access to source_url, there is any form that i can access here? i don't care if that form its via a script, but i really need access the source_url [whatsapp] Handler received request from Whatsapp with payload: {"object":"whatsapp_business_account","entry":[{"id":"245XXXXXXXXX","changes":[{"value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"123XXXXXXX","phone_number_id":"188XXXXXXXXX"},"contacts":[{"profile":{"name":"SXXXXl"},"wa_id":"58XXXXX"}],"messages":[{"referral":{"source_url":"https:\/\/fb.me\/3jvXXXXX","source_id":"738XXXXXX","source_type":"post","headline":"api.whatsapp.com","media_type":"image","image_url":"https:\/\/scontent.xx.fbcdn.net\/v\/tXXXXXXXX"},"from":"58XXXXXXX","id":"wamid.HBgMNTg0MjQyNTXXXXXXXXXXXXXXXXXXXX","timestamp":"1713XXXXXX","text":{"body":"Hello! Can I get more info on this?"},"type":"text"}]},"field":"messages"}]}]}
f
Hey there, I am taking it that that is from
console.log(event.payload)
? If so then try
console.log(event.payload.entry[0].changes[0].value.messages[0].referral.source_url)
p
Hi, nope, its a log directly from whatsapp let me put console.log(event.payload) to show what it prints
[bot-action] [flow:Main] [node:AirTable_Acct] [card:Create a lead and retrieve its ID from an API.]: { text: 'Test for botpress discord' }
idk why event.payload its not saving all the others valors from the whatsapp payload
anyway, tysm for the help @fresh-fireman-491
i have a question about that @famous-zoo-73118 there is a plan to implement that?or i should post it on #1111026806254993459 ?
f
Ah okay, thank you for finding that
r
hey @purple-artist-60046 i am also having trouble with this exact problem with whstasapp bot.Share it if you figure out a solution for thsi. Thanks!!!
p
Hi @rough-ocean-51370 i think there is no solution, i already print all the variables on the bot (even the workflow variables) and none of them have the source_url that i need
r
okay @purple-artist-60046 thanks.
p
Hi, @bumpy-butcher-41910 @famous-zoo-73118 i want to know if this is posible, if no, there is an alternative? something like access to all the logs from the bot and i can create a func that interpret this or just a way to modify the event.payload, cause event.payload just store the message and that is irrelevant on the real payload struct
f
@purple-artist-60046 There's no plan at this moment but you can definitely post in #1111026806254993459 😃
Explanation: the
event.payload
represents the payload from Botpress, not from the downstream integration, as the Botpress Whatsapp integration is meant to act as an adapter and not as a proxy, so that's why only the Whatsapp (or any other integration's) properties that are actually supported by existing Botpress features are exposed. If a piece of data in an integration's payload cannot directly be mapped to an existing Botpress feature then it won't be in the BP event payload, while the integration's actual raw payload appears in the Logs as-is for debugging purposes only at this time.