Data ingest
The Ingest API supports typed JSON and the legacy string-based entity format. Both formats validate the complete request before accepting it for asynchronous processing.Typed source entries
UsePOST https://api.occtoo.com/sources/{sourceId} to send native JSON strings, numbers, booleans, null values, and arrays of strings. Occtoo validates values against configured source property types and infers types for new properties. New list properties use , as their delimiter unless the source already defines one.
Typed ingest requires a tenant-level Application token with the write:sources scope and access to the target source. A successful 202 Accepted response includes the batch correlation ID, accepted entry count, and any new properties inferred from the request.
Typed source entries
View authentication requirements, type mapping and inference rules, request and response schemas, and the interactive API playground.
Legacy import
The legacy import format serializes property values as strings. Exchange registered Data Provider credentials through the Occtoo authorization service, then use that bearer token to call the import endpoint.Data import sequence diagrams
Data import sequence diagrams
- Typed ingest
- Legacy import
Rules
There are a set of rules related to the ingest data that need to be respected for the payload to be accepted by the ingest API:- Entry key can have a length of 1-256 characters.
- Property ID can have a length of 1-256 characters.
- Property language can have a length of 2-10 characters.
- The following characters are allowed in entry key, property ID, or property language:
- a-z (lowercase a to z)
- A-Z (uppercase A to Z)
- 0-9 (numbers 0 to 9)
- _ (underscore)
Recommendations
We recommend that payloads containing entities adhere to the following guidelines for optimal performance and efficiency:- Total payload size: Ensure that the total payload size does not exceed 20 MB. This helps maintain efficient data transfer and processing.
- Single entity size: Each individual entity within the payload should not exceed 1 MB in size. Keeping entity sizes manageable improves processing speed and reduces the risk of errors.
- Payload entity limit: It is recommended that a single payload does not contain more than 1000 entities. This limit helps maintain optimal performance during data ingestion and processing.
API endpoints
Data Provider access token
Request a token through the standard OAuth 2.0 client credentials flow athttps://auth.occtoo.com/oauth2/token. Use your Data Provider OAuth client ID and client secret, your tenant ID as audience, and import-datasource as scope.
See Data Provider access token for the request fields, interactive playground, and response schema.
Import
Imports are initiated by sending a POST request to the URL ending with the identifier of the data source the data is intended for.Request payload
The import format is structured as follows:- entities: Array of entities to be included in the import
- key (Mandatory): Unique identifier of the entity
- delete (Optional): Flag indicating if the entity is to be deleted (true) or added/updated (false)
- properties (Mandatory): Array of properties of the entity
- id (Mandatory): Unique identifier of the property
- value (Mandatory): Value of the property
- language (Optional): The language code for the property
- Standard
- Multiple items
- Multiple properties & languages
- Delete payload
- Mixed actions payload
Response payload
The status of the import is given by the HTTP response code of the request.Media ingest
Media ingestion can be performed using the ingest API, but the media file to be uploaded must be available at a public URL. The Occtoo onboarding SDK supports uploading via streaming content directly. Before calling a media endpoint, request a Data Provider access token fromhttps://auth.occtoo.com/oauth2/token.
All uploaded media files are provided with an Occtoo media file identifier. The media file ID is used for all API interactions related to the file. When uploading a file, users have the option to provide their own unique identifiers as an attribute to the file. The unique ID attribute is respected, meaning that once it is used, any additional upload attempts with that same unique ID will fail. If a media file needs to be replaced, users must first delete the original and then upload the updated file.
All uploads are made asynchronously, and the ingest API allows for multiple uploads to be initiated in a single request. To track the status of uploads, users can use the Upload Status API.
Media information can be retrieved either using user-provided unique IDs via the Media File Information by Unique Identifier API, or using the Occtoo media file ID via the Media File Information by File ID API.
Media API sequence diagrams
Media API sequence diagrams
Each flow sends a Data Provider access token in the
Authorization header.- Upload
- Status
- File ID
- Unique ID
- Delete
Upload media files from public links with the Upload via Links API.
API endpoints
Data Provider access token
Request a token through the standard OAuth 2.0 client credentials flow athttps://auth.occtoo.com/oauth2/token. Use your Data Provider OAuth client ID and client secret, your tenant ID as audience, and import-datasource as scope.
See Data Provider access token for the request fields, interactive playground, and response schema.
Upload via links
Media uploads are initiated by sending a PUT request containing a list of one or more media files to be uploaded. Upon successful acceptance of the payload, the API will respond with an HTTP Code 202 Accepted.Request payload
The upload via links payload format is structured as follows:- links: Array of links to the media to be included in the import
- filename (Mandatory): The filename of the media file when uploaded
- link (Mandatory): The URL to the media to be uploaded
- uniqueidentifier (Optional): Unique identifier of the media to be uploaded
- Standard
- Without unique identifier
Response payload
The response is divided into two parts:succeeded and failures. Since file uploads are handled asynchronously, each linked media’s information in the sent payload indicates whether the file has finished uploading to Occtoo. Accepted links receive an Occtoo media ID, which can be used to query the upload status of individual links using the upload status endpoint. This same ID can also be used to retrieve media file details using the media information by file ID endpoint. If an upload link was rejected for any reason (such as conflicting unique identifiers or unreachable URLs), it will be categorized under the failures section with an error message explaining the cause of the failed upload.
Upload status
The upload status of an individual file can be checked by sending a GET request with the provided Occtoo media ID. Upon successful request, the API will respond with an HTTP Code 200 OK.Response payload
The response payload contains detailed information on the current status of the upload.Media file information by File ID
Detailed media information can be fetched by doing a GET request with the Occtoo media ID. Upon successful request, the API will respond with an HTTP Code 200 OK.Response payload
The response contains the public URL that is to be used when accessing the media. Additionally, the response contains themetadata object, which provides more details about the media object, such as its size and MIME type. If the media object is an image file (e.g., jpg, png) or a video file (e.g., mp4), there is detailed information about the file encapsulated in the mediaInfo object.
Media file information by unique identifier
To fetch detailed media information for multiple objects simultaneously, you can make a POST request to the batch endpoint, providing a list of unique identifiers. Upon a successful request, the API will respond with an HTTP Code 200 OK.Request payload
The endpoint accepts a JSON payload in the body, which consists of a list of unique identifiers used during the media upload process.Response payload
The response is divided into two parts:succeeded and failures. Media information for each media object that could be identified via its unique identifier is listed under succeeded. The response contains the public URL to access the media. Additionally, it includes the metadata object, which provides details such as size and MIME type. If the media object is an image file (e.g., jpg, png) or a video file (e.g., mp4), detailed information is encapsulated in the mediaInfo object.
Unique identifiers that were not found are sorted under failures.