NOTE: Redirecting to updated article at https://semantria.readme.io/docs/send-documents
What are the data retrieval options for Semantria?
Semantria API exposes several ways for data retrieval and they depend completely on the customer’s needs, number of performed calls, etc. There are 3 different options available:
- Direct data requests
- Auto-Responde mechanism
- Webhooks (user defined HTTP callbacks)
Direct data request mode leads the user to perform an additional request to get already processed data from the server. The user may retrieve up to 100 processed documents in one API call by default. This limit is configurable per customer and can be easily adjusted on demand.
Auto-response is designed for clients who work with the API constantly and allows an almost real-time data retrieval. In short, the server responds with already processed documents on each incoming data call. This method is convenient for constant but not intensive loading. The amount of returned data is also configurable on Semantria's side.
Webhook, also known as an HTTP callback, which allows the user to get the processed data back through the provided callback URL. This means that the user gives Semantria a URL and it responds with the processed data by calling that URL. This is the most convenient way of data retrieving; however, is suitable for server based integrations only.
How I can get the processed results back?
The default data retrieval mechanism that is available for out-of-the-box configuration is for manual data requests. Auto-response and Webhook options should be switched on by the customer, if required.
Available API options are combined in flexible configurations and allowed for direct management by the customer through the API. http://semantria.com/documentation/configurations
Direct data requests for results allows the customer to call the service when required and get a configured number of processed tasks in a single call. The default limit is 100 tasks per call, and can be configured as per the requirement of the customer. Ideally two jobs should run simultaneously; the first one for pushing the data into the queue and another for retrieving the processed data.
Note: Any processed document can be retrieved from the server only once using Manual data requesting mode. If either document or batch was successfully delivered to the client it becomes marked as responded and will never appear again. If some documents were missed due to some reason they can be requested by their unique ID within 24 hours from queuing.
Another option would be to request a task from the server using its ID. Just like the other options, the processed results would be available after some delay. This method allows the customer to verify the current task status. Processed results are made available with the response status of PROCESSED. Other possible status values are QUEUED and FAILED. Requesting of processed tasks one-by-one by ID is the worst scenario that leads to API loading.
Note: Semantria distinguishes an actual data call from configuration and data retrieval ones. By default Semantria limits the number of configuration and data retrieval calls to 10 calls per second.
Auto-response feature allows customers to get results in real-time while adding new tasks to the queue. If the auto response option is switched on, the service would respond with a limited number of tasks that have already been processed. The default setting is for the server to respond with 2 processed tasks for each incoming data request. This setting is configurable as per customer requirement. Even with the default setting, the rate for getting results would be twice as fast as the rate for setting up requests if the customer will queue documents one-by-one.
Webhook allows customers to not worry about manual data retrieving and get processed data automatically when it appears. The service responds with either document or batch via callback URL. It depends on the way documents are queued. If they were queued one-by-one, the service will respond to them in the same way. Documents queued within the batches will be returned in batches of the same size. The default limit is 100 documents per call, and it can be configured as per the requirement of the customer.
See http://semantria.com/documentation for details.