API Designer FAQs

All tables (arrays) passed to or returned from API calls need to be contiguous (not contain any nil elements). If you want to remove an item from an array you use the table.remove() function rather than setting the element to nil, see the example code here Delete a table element.

Note: Setting an element to nil is a valid way of deleting a table element, and may be more appropriate than table.remove() for some purposes.

However it is not compatible with the HTTP methods created by the API designer.

This is because URI parameters are are always passed as strings (because they are part of the HTTP URI request). Therefore there is no way for the Server to identify the datatype (of the incoming string data) and check that it matches the API specification.
Note: This was not a design decision that we made — instead it is part of the HTTP method design standards, URI parameters are always passed as text.

However all is not lost! If you need type checking on your parameters you can simply use Structured Body instead — which is passed as JSON and includes type information. Be aware that the Structured Body is not available for all HTTP methods, they are only supported for: POST, PATCH and PUT.


Leave A Comment?