Get Companies endpoint of Vainu API supports asynchronous operations. This is especially handy with complex queries or with larger datasets, where response times might be slower.
With asynchronous requests, Vainu API responds with job details or begins a process to generate a file to be downloaded. API can be used for follow-up queries to get the status of the job and eventually to get a download link for the response.
Limit for asynchronous request
Note that the default maximum limit of 1000 returned objects applies to the asynchronous endpoint. This can be changed. Contact your Vainu representative or support for requests.
Asynchronous endpoint has a separate endpoint but utilizes the same filtering capabilities as a normal GET companies endpoint. Instead of an immediate response, the API will respond with the job ID and details.
Following fields will be included in the initial and follow-up request responses.
Timestamp when the job was created
Link where completed data may be requested
Duration the job has been running
Timestamp when the job was completed
Unique id for the job
Link to request the status of the job. Response is identical to the initial request
State of the job. Expected statuses are accepted, process, completed, and failure
The initial response of the initiated job includes a field called link. This field may be used for follow-up queries to see the state and job details. The response will be identical to the first request.
Expected states of the job are following
Job has been accepted by Vainu and processing will begin shortly
Job has been completed and is ready for download
Job has failed due to error.
Job is in process and will be completed shortly.
When the job state is "completed" the results can be downloaded from the download_link found at the initial or follow-up responses. You can either use the link to download the file or do a simple GET request to get the response programmatically.
Response and data included will be as stated in the initial request. See the Filtering and Response data guides for further instructions on how to manage response data.
Updated 11 months ago