API Creator supports binary and large character objects. This page will use the term BLOB (for binary large object) and CLOB (for character large object).
API Creator merges the database concepts of CHAR, VARCHAR, TEXT, LONG TEXT, CLOB, etc. into a single JSON String. This means that client programs see just a string regardless of the underlying datatype.
For all character results, the JSON returned will be in one of two formats:
a) An 'INLINED' value - a standard JSON string - e.g. "ABC"
b) A 'DEFERRED' value - a JSON Object containing the length of the string and a URL that can be used to retrieve the value.
API Creator merges all database binary types to a single base 64 encoded string. Like strings, they can be returned INLINE or DEFERRED.
a) An 'INLINED' VALUE - a JSON object, with 'type', 'length', and 'value' properties.
b) A 'DEFERRED' value - a JSON object wih 'type', 'length', and 'url' properties.
There are several project properties and per request parameters that can be used to control the values.
By default, strings are
This behavior can be controlled on a per-column basis using the
Comma-separated list of Resource.attribute names that will be returned as deferred links. This applies only to BINARY and STRING data. '
This will cause the Cust.Orders.LineItem.Product.Photo object to be returned as a deferred link regardless of the size.
Comma-separated list of Resource.attribute names that will be returned as inline values. This applies only to BINARY and STRING data.
'inline' values take precedence over 'inlineamount' values. The value is also used for transaction summaries, but database names must be used.
Overrides the project setting. Number of characters or bytes used to decide whether a value is returned inline in the JSON or deferred to a link for BINARY or STRING data.
Both 'deferred' and 'inline' take precendence over '
Inline Limit Default
The default values for inlinelimit if not provided as a request parameter.
Checksum Size Limit
The number of characters or bytes used to calculate the checksum. For obvious reasons, it would be impractical to compute a checksum on a very large (e.g. gigabytes) blob. This setting defines how many characters/bytes will be used to compute the check sum. If the column is larger than that, the checksum will be computed using the total size and the checksum of the first n bytes/characters where n is the value of Checksum Size Limit.
This is unrelated to the type of value returned (inline or deferred) and can be larger or smaller that the inline limit.
Stored Procedure Row Limit
Maximum number of rows returned for each result set returned by a stored procedure. These are NOT pageable. The will be a value in the JSON telling you the limit was exceeded.
Stored Procedure Inline Limit
Values returned in a stored procedure use this to determine when to inline. Unfortunately, it is NOT possible to generate a URL for a deferred link. When a value is exceeds the inline limit, just the length is returned.
When a value is
API Creator has support for multi-part form uploads
In addition to base64 encoded values for BLOBs as part of the normal JSON processing, HTML Multi-part Forms can be used to stream the data directly into the database when supported by the underlying database/driver combination. Oracle and SQL Server are well supported for this. MySQL is supported, but has some limitations and requirements on the MySQL configuration.
Currently, while a POST HTTP Request is being performed, this MUST be an update to an existing record, based on the primary key.
A checksum value MUST be provided.
The authorization value MUST be provided with a valid API Key.
The values sent by the browser are streamed directly in the database and are NOT available to rules during the transaction.
The following simple HTML page demonstrates it usage.
The "checksum" == "override", while convenient for testing, is not recommended for production.
<h2>File Upload Example</h2>
<form action="https://demodev.espressologic.com/rest/abl/demo/v1/employee_picture/1" method="post" enctype="multipart/form-data">
<input type="hidden" name="checksum" value="override" />
<input type="hidden" name="authorization" value="demo_full:1" />
<p>Select file for ICON <input type="file" name="icon" size="70" /></p>
<p>Select file for PICTURE <input type="file" name="picture" size="70" /></p>
<p>Select file for VOICE <input type="file" name="voice" size="70" /></p>
<input type="submit" value="Upload Them" />