Save Asset
Service that stores an asset in the context of an operation and returns the key with which it is later referenced.
Endpoint
POST /storageHeaders
consumer-id
string
Yes
Consumer identifier.
Request body
Content-Type: application/json
Parameters
operationId
string
Yes
Identifier of the operation to which the asset belongs, as returned by Create Operation.
asset
object
Yes
Asset to store.
asset.file
string
Yes
Content of the asset encoded in Base64, in the format required by its context.
The four image contexts require the tokenized buffer generated by the capture SDK. A JPEG or PNG image in Base64 is rejected with 400. The only context that accepts a free binary is TOKEN_BIN_IAD.
The maximum size per asset is 10 MiB, applied to the encoded content.
Request example
Responses
200 Success
Response parameters
fileKey
string
Asset key, in the form {operationId}/{CONTEXTO}. It is sent back unchanged when referencing the asset.
timestamp
string
Response timestamp in format ISO 8601.
Response example
Derived contexts
When storing an asset TOKEN_BIN_IAD the context is also available TOKEN_BEST_IMAGE of the same operation, with the best image from that capture. A TOKEN_BEST_IMAGE may be stored later; if one is already stored, that one is kept.
Query Get File Keys to confirm which contexts are available in the operation.
Other responses
400
The operationId does not have the expected format, the content does not correspond to the declared context, or the asset is empty or exceeds the maximum size.
403
The consumer is not provisioned with the service STORAGE.
404
The operation does not exist or belongs to another consumer.
409
An asset of that context already exists in the operation.
410
The operation has expired.
429
The consumer has exceeded its request rate limit. The response includes Retry-After with the wait seconds, and X-RateLimit-Limit and X-RateLimit-Burst with the current thresholds.
The body of an error response has the form described in MIDAPI v2.
Last updated