Guide for creating an API method via Server Side Scripts

I know you can create and whitelist api methods for a doctype when developing custom app. But for my current scenario, there is no custom app, rather I’ve added a button, via Custom Scripts, which I need to download a processed CSV file when clicked.

How can I achieve this using Server Scripts? I’ve checked the documentation on this subject but it wasn’t very informative.

Have you looked at server scripts? These are defined client side but operate on the server. You could create a new api method and the. Link that to your button via JavaScript.

Hi peter, yes I have. But the documentation wasn’t clear. Hence the need of a simple guide. Can you assist?

did u find your solution?