This topic is locked
[SOLVED]

OWN REST API result includes user credentials

1/3/2023 5:33:29 PM
PHPRunner General questions
V
valdaure author

I am using Postman to test my OWN API, according to the implementation explained by Corrie de Wet. I met with success, but Corrie's YouTube tutorial stops short of explaining how an external application can construct a URL that sends parameters to be used by the MySQL stored procedure. However, after some digging, I found how to capture them with :{request.xxx}, and it seems to be working fine.

Here's my problem: After implementing API key access, the JSON result obtained by Postman includes the SQL query for user credentials (see below). Clearly, I don't want that as part of the result. Does the problem lie with the construction of the MySQL procedure, with options in Postman, with V1 of the PHPRunner API, or other?

Many thanks in advance for help in obtaining a clean JSON result with no leading SQL.

--- RESULT IN POSTMAN ---

SELECT
ID, est_id, username, password, email, fullname, language, groupid, active, ext_security_id, apikey
FROM ent_est_phpr_users WHERE ( ( apikey='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' ) ) limit 0,
1
SELECT
ID, est_id, username, password, email, fullname, language, groupid, active, ext_security_id, apikey
FROM ent_est_phpr_users WHERE ( ( ( binary username = 'xxxxxxxxxx' ) ) ) limit 0,
1
Call list_menu_items(1);
{
"data": [
{
"men_comp_pub_id": "1",
"men_comp_phase": "2",
"men_item_name": "Soupe à l’oignon gratinée",
"men_item_tag": "",
"men_item_desc": "Un grand classique à réchauffer les cœurs"
}
],
"success": true

admin 1/3/2023

It looks like you left some echo stetements in your events or left $dDebug variable set to true. It returns pure JSON by default.

V
valdaure author 1/4/2023

Doh! I'm kicking myself for not having thought of that. Problem solved. I had only just activated debug today for the first time and wasn't aware of the number of places where it could rear its head. Thanks.