luke
luke7mo ago

luke - Hey I need to access the rawBody of the ...

Hey I need to access the rawBody of the incoming request. Is this possible? Need it for signature verification purposes.
Solution:
Hi @luke, you can refer to the example of WhatsApp verification template, or create a simple workflow with Rest Call --> send a request to it and access the body recieved in the next step using variables and perform signature verification from the body data.
No description
Jump to solution
7 Replies
Solution
Gaurav Chadha
Gaurav Chadha7mo ago
Hi @luke, you can refer to the example of WhatsApp verification template, or create a simple workflow with Rest Call --> send a request to it and access the body recieved in the next step using variables and perform signature verification from the body data.
No description
luke
luke7mo ago
No clue how to access raw body from this? Could you elaborate which variable contains it?
No description
luke
luke7mo ago
just to add detail, not sure if you understand, what I need is the raw string of the body payload sent across. Not the parsed JSON. I need it exactly as it's sent
Gaurav Chadha
Gaurav Chadha7mo ago
You can simply return the Body value from your API call and it will return exactly the same data you send to it.
luke
luke7mo ago
what I need is the actual raw body payload. Not the value of what;s stored in the body Here's an example of what I need formatted the way it arrives as a string {"data":{"id":"307926","type":"subscriptions","links":{"self":"https:\/\/api.lemonsqueezy.com\/v1\/subscriptions\/307926"},"attributes":{"urls":{"customer_portal":"https:\/\/appointment.lemonsqueezy.com\/billing?expires=1711243428&test_mode=1&user=1233616&signature=49a13c5701575c0004b88a6d7a99dc209a320c3d04caf4f60a6508753bda453b","update_payment_method":"https:\/\/appointment.lemonsqueezy.com\/subscription\/307926\/payment-details?expires=1711308228&signature=a9c4c0d15a131b4e37eac1e1b83ac5ae9a73af0945e07c1e1bdf9322aa66c1ee","customer_portal_update_subscription":"https:\/\/appointment.lemonsqueezy.com\/billing\/307926\/update?expires=1711308228&user=1233616&signature=75ed3ce00177be45bfb051c90dbabaed9ea9a5b2e54b585986963a282773bcc0"},"pause":null,"status":"on_trial","end etc. and this continues on to complete the request, I cut it off because it's too long. I need to access that before it gets parsed with whatever middleware buildship is using @Gaurav Chadha any ideas?
Gaurav Chadha
Gaurav Chadha7mo ago
You can get the actual raw body and data from, nodeReq and res parameters, you'll require to define your logic and simply log it to confirm if it is coming correct. The example shared, also receives a playload when get called and does verification.
luke
luke6mo ago
How though... when I log them it just comes up as undefined or Object object. Could you explain what code I need to write to get the raw body?