I am passing 148 objects as a JSON input to an endpoint but only 67 are received, why?

Options

Hi,

I am passing information of 148 products like this ones (this products are retrieved from Meta's API):


This list is passed as JSON variable "client_variants_meta" to another endpoint that uses this as an input.

However, if we use the requests history to check the inputs of that other endpoint, it says that there were 67 products in the JSON (instead of 148).



What is happening here? Is there a length limit on the JSON objects that can be passed as inputs to endpoints in Xano?


Thanks!

Tagged:

Best Answer

  • pachocastillosr
    pachocastillosr Member
    Answer ✓
    Options

    Hi @Pawel Magdanski !

    I am not, apparently, it is a limit in Xano because I just tried passing the JSON as text (using json_encode filter) and then in the other endpoint used the json_decode filter to convert the text into JSON again and the 148 products where passed successfully this way.

    The problem now would be that there is a limit in the length of the text that can be passed as well from endpoint to endpoint (for larger lists of products, in my case). Would you please confirm? @Michael Udinski
    What would be a way to pass large lists of objects (hundred of thousands) from one endpoint to other endpoints?

    Thanks!

Answers

  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options

    Hi,

    Interesting, so I assume that you are not performing any operation on that list before sending it to another endpoint?

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    Hi @pachocastillosr - there is no text limitation. That being said, I wouldn't recommend passing hundred of thousands of objects at once in an endpoint - whether that's Xano or any API endpoint - you'll probably overwhelm your front-end or browser and timeout. With lists that large, I'd recommend implementing paging and calling the data recursively - most likely in a background task (CRON job).

  • mike-k
    mike-k Member
    Options

    Hi Michael,

    I've seem similar results a Pawel of messages getting cut off in API calls. Is there a best practice set of headers that should be sent with each call? I wonder if there's something in the headers causing it.

    Thanks,

    Mike

  • pachocastillosr
    Options

    @Michael Udinski got it! Thanks!