drea21
Forum Replies Created
-
@ironikus Thank you for getting back to me. I literally thought about using file_get_contents and decided not to try it because I thought there would be a cleaner way. Regardless, your solution worked. It looks like I can parse the body from php://input.
Resolved!
Hey @ironikus,
Thanks for getting back to me. That is a good guess, but its not that. I saw that in the documentation and added it to the query string. I know the right function is getting invoked because its responding to Typeform and I can see the response as well as the var_dumps. The only problem is it seems like the response_body is null and there is no way to read the request body that I can see.
This is the response I see:
{"success":true,"msg":"Custom action was successfully fired."}
- This reply was modified 4 years, 9 months ago by drea21.
Yeah I can share more details. You can try making a Typeform for yourself and adding a webhook to a WP Webhooks endpoint to see if you can get the submissions to come through. I’ll give you more details about the request.
The Content-Type is application/json.
The body looks like:
{ "event_id": "ABCD12345", "event_type": "form_response", "form_response": { "form_id": "1234", "token": "SOME_TOKEN", "landed_at": "2020-06-07T19:56:03Z", "submitted_at": "2020-06-07T19:56:03Z", "definition": { "id": "ABCD", "title": "Question Title", "fields": [...] } } }
I have obfuscated the ID and Token values and abbreviated the fields, but you get the idea.
If you are looking for any other specific details, please let me know.
Thanks!
Hi Ironikus,
The response_body variable is the third argument of the callback just like the example. Nothing gets passed in it and if I don’t set it as a default to null, it throws an error.
I can from Typeform tests it is sending a payload, but the webhook does not seem like it is reading the request body payload and passing it to my filter. Is there another way to access the data sent to a custom action webhook?