Calling a method
POST or GET, body versus query string, and what the field validator expects.
A method name is part of the URL. Every other input, including an id, is a parameter: a JSON body
field on POST, a query string parameter on GET. Both forms reach the same method and return
the same envelope.
POST: a JSON body
The normal shape for anything with more than a couple of parameters, or with a nested object or an array.
GET: a query string
Handy for a quick check from a browser address bar or a curl one-liner. The server parses the
query string into the same body the method handler sees, so the rules below matter more here than
they do on POST.
A field's declared type decides how its query string value is read:
- string: used as-is.
- number: run through
Number(...). - boolean: only the literal string
trueis read astrue. Anything else you pass for a boolean field onGET, includingfalse, is coerced to a truthy1. If a boolean matters, send it onPOSTwith a real JSONtrue/false, or simply omit the query parameter to leave it at the method's default. - object / array: the value is run through
JSON.parse(...), so a nested value onGEThas to be one query parameter holding a JSON string (filters=%7B%22status%22%3A%22open%22%7D), not bracket-style query nesting.
Required fields and type errors
A method's fields each carry a mandatory flag and a type. Missing a mandatory field, or
sending the wrong type on POST (where nothing is auto-coerced), gets you back a -1 before the
method itself ever runs:
The interactive API reference lists every method's fields with their types and mandatory flags, and lets you run a call from the browser to see the exact request it built.