The code in every language
Each example is the inside of main, written in every language API Maker runs : pick yours in the tabs, and every page shows it from then on. The types a call takes (GetAll, DeepItem…) are those of am : from am import GetAll in Python, use am::GetAll; in Rust, import am.GetAll; in Java and Kotlin ; PHP and C# have them without an import, Go names them am.GetAll.
The request : g.req¶
Custom APIs, hooks, events and schedulers read the request through g.req. Who calls is in g.req.auth : see Who calls : g.req.auth.
Body¶
To get the value of request body, use g.req.body.
Headers¶
To get the value of requested headers, use g.req.headers.
The tenant header of a request of a tenant of a multi-tenant instance. g.req.params.tenantUsername holds the tenant too, also when the request named it in the path (crm::acme).
Params¶
To get the value of requested params, use g.req.params.
The tenant of the request, for a multi-tenant instance: named with the x-am-tenant-username header, or in the path of an API of the instance (crm::acme).
Query params¶
To get the value of requested query params, use g.req.query.
Event data¶
To get the value of requested body data of the event, use g.req.eventData.