Store Object

Stores a file.

The Store Object API takes a file, reference, or an input URL and stores the contents of the document for use in other APIs. It returns the object store reference, which you can pass to other APIs to process the document that you store.

Quick Start

The API returns an object store reference.

curl -X POST http://api.havenondemand.com/1/api/[async|sync]/storeobject/v1 --form "file=@mydoc.doc"

{
  "reference": "98ca9183-0902-4981-9a2b-0942ea4e1a67"
}

You can use the reference in many of the Haven OnDemand APIs, so that you do not have to send the whole document multiple times. For example:

/1/api/[async|sync]/analyzesentiment/v1?reference=dbb35d16-7481-4938-961d-d38202513838

/1/api/[async|sync]/extractentities/v1?reference=dbb35d16-7481-4938-961d-d38202513838&entity_type=people_eng

Tip: If you have a container file (that is, a file that contains other files, such as ZIP archive, or a PST file), you can use the Expand Container API to extract the files from the container, and to store and return a reference for each of the contained files.

Note: API input is subject to a maximum size quota. If you upload text or a file that is too large, the API returns an error. For more information, see Rate Limiting, Quotas, Data Expiry, and Maximums.

Synchronous
https://api.havenondemand.com/1/api/sync/storeobject/v1
Asynchronous
https://api.havenondemand.com/1/api/async/storeobject/v1
Authentication

This API requires an authentication token to be supplied in the following parameter:

Parameter Description
apikey The API key to use to authenticate the API request.
Parameters

This API accepts the following parameters:

Required
Name Type Description
file
binary The file to store.
reference
string A Haven OnDemand reference obtained from either the Expand Container or Store Object API. The corresponding document is passed to the API.
url
string A publicly accessible HTTP URL from which the file to store can be retrieved.

This API returns a JSON response that is described by the model below. This single model is presented both as an easy to read abstract definition and as the formal JSON schema.

Asynchronous Use

Additional requests are required to get the result if this API is invoked asynchronously.

You can use /1/job/status/<job-id> to get the status of the job, including results if the job is finished.

You can also use /1/job/result/<job-id>, which waits until the job has finished and then returns the result.

Model
This is an abstract definition of the response that describes each of the properties that might be returned.
Store Object Response {
reference ( string ) The object store reference of the extracted file.
}
Model Schema
This is a JSON schema that describes the syntax of the response. See json-schema.org for a complete reference.
{
    "properties": {
        "reference": {
            "type": "string"
        }
    },
    "required": [
        "reference"
    ],
    "type": "object"
}
https://api.havenondemand.com/1/api/sync/storeobject/v1
/api/api-example/1/api/sync/storeobject/v1
Examples
See this API for yourself - select one of our examples below.
Store JPG
Store PDF
Parameters
Required
Select file Change Remove


Async – Response An error occurred making the API request
Response Code:
Response Body

	
Making API Request…
Checking result of job

To try this API with your own data and use it in your own applications, you need an API Key. You can create an API Key from your account page - API Keys.

Output Refresh An error occurred making the API request View Input
Rendered RawHtml Response
Result Display
Response Code:
Response Body:

			
Make this call with curl


If you would like to provide us with more information then please use the box below:

We will use your submission to help improve our product.