API doesn't return anything in response

Options

I have this API endpoit that should return an employee object

Here is the code invoking the API, the response JSON is empty, I don't understand how to read the data returned by the API.

Tagged:

Best Answer

Answers

  • Chris Coleman
    Chris Coleman Administrator

    ADMIN

    Options

    Hi, Ambroise. It looks like this is expandable; can you click on that arroe for me and let me know if you see the data as expected? If not, we'll want to run this on the Xano side using Run & Debug and make sure the response is returned there.

  • Ambroise
    Ambroise Member
    edited April 2023
    Options

    I don't see any data.

    I would have expected the response to return a JSON, is it configurable?

    Here is what happens when I Run the endpoint:

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    A couple of thoughts:

    1) Is the endpoint published? if not, the front end will not be able to see the data.
    2) Usually the json() method (and the text() method) of a fetch response in javascript is asynchronous. Assuming that the response was properly awaited, one needs to await this call too to see what comes out the other end.

    Getting the javascript to go is often part of the hardest 5% we work on at the State Change Pro group in daily office hours and our ask-for-help forums.