How to get JSON response?
Status: Open · Asked by Niche Web Marketing on · 0 views
I shared my workflow and you have permission to test everything in it. When I submit the API request in Pabbly, I send the API Endpoint URL and I've tried both simple response and regular response, and both times Pabbly returns a simple response looking result and not the JSON. When I copy the exact same API Endpoint URL into my browser, I get a JSON response, so why am I not getting a JSON response inside of Pabbly that I can use?
I should also note if I send the exact same API Endpoint URL in postman, I get a JSON response back so I know it's possible, I just need to know how to get it in Pabbly. Thanks
Hi @nicheweb,
Based on the Workflow URL you shared, we can see that you receive separate records when the 'Simple Response' is enabled.
When the 'Simple Response' is disabled, you receive the records in the form of an array.
I'm talking about the entire thing as a JSON response like when I send the request in postman and if you enter my API URL into a browser. The JSON response returns true and false for results and when Pabbly is returning them and splitting them into individual fields it's not retaining the false record and it looks like it is Null.
Here is how the response looks in postman and by entering it into the URL bar - https://gyazo.com/5977c0209217f646f272e0ff78231cbf
Currently, it's not possible to get the JSON in raw form, even with the simple response disabled. You can try using the 'Default Value' action event to get the value as 'False' instead of an null value.
I am also very interested in being able to get the raw response body from API (Pabbly) workflow actions.
I have a use case where I would like to make several API calls, and depending on the result of those various calls, initiate a final call that includes, in its body, the responses from one or more of those previous API calls, all amalgamated into a single JSON object.
I'm not sure this is even possible presently. Perhaps using a Code module, but I'm not sure how to reliably escape all the data I got back from the previous API calls to build out a new JSON object.
Hello @JoshBeall,
You may use the Code module in Pabbly or leverage OpenAI to achieve such a use case, where multiple API responses can be combined into a single JSON object for your final call.