Tutorial 2 - Fetch applications
1. Fetch application data
In this section, we will guide you through the process of fetching job applications using the ATS-API's "getApplicationsBySourceId" endpoint. This API call allows you to retrieve a list of applications for a specific job based on its sourceId. To use this endpoint, you need to provide the appropriate access_token obtained from the authentication process.
The endpoint requires the following parameters:
sourceId: The unique identifier of the job for which you want to fetch applications. (The one that was set when creating the job.)
(For complete documentation of the endpoint, please refer to the Swagger Definition that is auto-generated and up-to-date!)
Here's an example of how to fetch applications using TypeScript and node-fetch:
Which would result in a response output like:
(Note the relationId being of the job object, and other objects also having their unique IDs (application and user) to eventually de-duplicate on your end, if you need.)
Our used GET /application/getApplicationsBySourceId endpoint fetches all applications for a specific job (by sourceId) for the current logged in mandator. Use other methods if they suit your use-cases better! For example:
GET /application/getApplicationsByJobId that uses our hokify-internal job-ID ("_id" in the job object) for filtering.
GET /application/getAllApplications get applications for all jobs of this mandator (grouped by job!).
GET /application/latestApplications get all applications for the current logged in mandator (not grouped).