-
API Groups are folders under the
apis/directory.
Each API group must have a definition file atapis/<api_group_name>/api_group.xs. -
API Endpoints are
.xsfiles inside an API group folder.
Each endpoint must define:- The query name and HTTP verb (e.g.,
products verb=GET) - An optional
descriptionfield - An
inputblock for request parameters - A
stackblock for processing logic - A
responseblock for returned data
- The query name and HTTP verb (e.g.,
For inspiration and reference, see API Query Examples. When adding inputs, refer to the Input Guideline for proper syntax and best practices. Important:
- use
//for comments, comments need to be on their own line and outside a statement. - Each endpoint must have an
input,stack, andresponseblock. - Use the
verbfield to specify the HTTP method (GET, POST, etc.). - Document your queries with
descriptionfields. - Validate inputs and handle errors using
preconditionand control flow statements. - All statements are available for use, refer to the Function Lexicon.
- For web responses, set the appropriate content type in the response block.