Tutorial 2 - Fetch Applications

In this tutorial we will continue the process we started in Tutorial 1 where we have created and published a new Job. We assume that some candidates have already applied for our job and will now show how to:

4. Fetch Application Data

5. Fetch Application Files


4. Fetch Application Data

To retrieve current applications for your mandator, you can call the /get-all-applications-extern endpoint which can take the get parameters startTime and endTime in UTC format to specify a timespan to filter the applications.


5. Fetch Applications Files

We will now download an application pdf containing the interview questions from the application of the previous call.

Here we used the request library from npm to fetch the profile pdf from the applicant. We therefore set the x-session-token in the request header for authentication. With the query string qs we say that we want to download the "profile" pdf for the corresponding match of the application.

With .on('response',(response)=> ... we are registering a callback to be notified once we got a response from the server. We then stream the response data into a file with the filename specified in the response-header.

Here is an example of the result:

Software-API-Entwickler_Bewerber_Andreas-Rosegger.pdf

The full example can be downloaded here.

It was tested with node.js version 8.9.4 and npm 5.6.0.

You will have to do > npm install and insert your mandator id and token before starting the project with > node src/create_job.js