ERPNext Server Script API

Hi,
I have ERPNext v12.29.0 (version-12) and Frappe v12.26.0 (version-12).
I’m trying to make server script(API) which can be called from the browser or any other device(IoT device).

I did this


But when I call page . com /api/method/Test I get 403 response. What I’m doing wrong?
I guess the script can parse arguments/parameters, update docs on ERPNext and return some text.
Thanks.


EDIT: I found out. I needed to enable server scripts in site config.
Now I’m looking how to print basic message back, no JSON struct, just single line message.

form_dict is probably what you’re looking for. For non-JSON response you can look at Response documentation

1 Like

Thanks for help.

Docs are far from good and helpful. Can you make an example how to return “OK” as text?