How do I store an API payload as JSON in the database?

I’m calling an API that returns a JSON payload. I’d like to use that payload, as JSON, in a different API call. How do I save the info returned from the API as JSON?

Ideally, I’d like to be able to also stringify the JSON before storage.

Why do you want to store it as json?
When you use API connector as data, Bubble will create a Type (or more than one) of the payload json. You can store the API Call directly into this field.
Also, Bubble now provide the raw body’s text (but it doesn’t always work).
Finally, you can also turn the JSON response to TEXT response and you will be able to save the JSON into a Text field.

Thank you! I only want to store it as JSON because I want to use it as JSON in the body of an outgoing API call to a different API. I’ll look into what you’ve suggested. Any other thoughts you have, however, would be welcome. Thanks again!

Perhaps you just need to save/pass on the raw body text from the response? I believe you have to check the boxes “Capture the headers” and “Allow errors and continue workflow” to get the raw body text

1 Like

You nailed it. Thank you! That’s how you get the raw body text!!!

1 Like