Hi Everyone,
New to the forum but excited to learn from all of you. I just performed an API call and the only thing it returned was a “1” in the Body.
Please advise on what could be causing this. Thank you in advance.
Hi Everyone,
New to the forum but excited to learn from all of you. I just performed an API call and the only thing it returned was a “1” in the Body.
Please advise on what could be causing this. Thank you in advance.
Hi @rklee,
Welcome to the community!
While that does look like strange behavior, this is most likely based on the endpoint you are hitting.
If you click on “Code” all the way to the right just above the response area, you can generate a curl command, or other language snippet that will let you make the request from that language or program.
Going with curl, I would execute that call and see if you also get a “1” back, and if so, its likely to be issues with your endpoint.
In addition, it looks like that “1” could also be line numbering from the UI, and that you actually have an empty result, or your response sent back a character that doesnt render text, such as new line character, carriage return character, or even a space or tab. Trying this in curl should help, as well to see if its an empty response or not.
Hopefully this helps!
I experienced the same and realized that the errors were not being displayed.
I modified /etc/php7/php.ini file (location will vary)
display_errors = On
I hope this helps.
I forgot to echo the response in my case. I added echo json_encode($response);
and is working now.