Working with Jobboard API to perform actions needed by Vector Institute
In order to run the code in this repository, clone it and add a file called config.ini
. This is where the script will look for the Jobboard API key and the GitHub Access token. The structure of the file should like the following:
[JOBBOARD]
api_key = <your_key_here>
[GITHUB]
access_token = <your_access_token_here>
The API key for Jobboard can be found here: https://canadaai.jobboard.io/admin/api_keys
To obtain your github access token for the above config.ini
file, use the followings steps:
- Log into github.com
- In the top right corner, click on your logo and go to Settings
- At the very bottom of the left-hand side, click Developer settings
- On the left-had side click Personal access token and then Tokens (classic)
- Click Generate new token and then click Generate new token (classic)
- Give the token whatever name you want in the Note section
- Turn the Expiration to No expiration
- Click the button to checkmark repo (Full control of private repositories)
- Scroll to the bottom and click Generate token
- Copy the generated token and place it in your
config.ini
file
To obtain all the exports (jobs, profile, employer) from Jobboard, simply run the pull_all_exports.exe
file and wait for it to finish. Once it is complete, visit whichever shared Google sheet you are interested in (in the shared Google drive). In the menu bar you will see REFRESH HERE, click that, followed by Refresh Data and wait for the script to finish running.
You may get an error message saying:
ValueError: Response is bad:
<Response [500]>
In this case, simply re-run the program and it should work.
Use the following steps to bulk update jobs, profiles, or employers:
- Start at the desired Google sheet
- Download a CSV version of the file (File > Download > Comma Separated Values (.csv)) and save it in the same folder as the
mass_edit.exe
(do not rename the CSV) - Remove all columns that you do not wish to update
- Never remove the first column (either called ID or token)
- Remove the rows that you do not wish to update. Each row corresponds to a job, profile, or employer
- Update the values that you need to (you can leave values unchanged as well)
- Run the
mass_edit.exe
and select the file that you have just edited. All changes will make their way to Jobboard
Note: for some reason, updating a profile also hides the profile so do not bulk edit profiles for now.
If either the pull_all_exports.exe
or mass_edit.exe
are not working, here are the steps to re-create them:
- Install the required python packages using the command
python -m pip install -r requirements.txt
- Create the executable with the command (with either
pull_all_exports.py
ormass_edit.py
)
pyinstaller --onefile <filename>