Rest API

REST API is an interface that allows querying the job board for various data (jobs, applications, resumes, companies) by sending a request and receiving a reply in JSON format.

You can use this API to upload new jobs, applications, etc. using a custom code, or query the database for jobs to display them in a unique way.

Note that in both cases this will require at least some programming knowledge to do.

Configuring The REST API

To start off you will need WPJB 5.8.3 or newer, if you are using an older version try updating to the latest one first.

Once you have it go to the wp-admin / Settings (WPJB) / REST API panel and click the “Generate” button this will generate an encryption key and you should see a screen similar to the one below

Aside from the key, you will also see some additional data, like the API URL – Home, API URL, and API Cypher (encryption method), these are information that will allow you to connect to the API in a secure way, it will be useful in a while.

The last thing you need to do in the configuration panel is to click the “+ Add New” button it will create a user account with an “import” capability and an API access token.

If you are thinking why do I need a new user here? Then it is because the tokens are assigned to the user accounts and in case the token gets compromised you can simply delete the user from the wp-admin / Users panel the token will get canceled and attacker even if he knows the token will not be able to access the data.

Using The REST API

The easiest way to get started with the API is to download and use the API examples.

The examples are using PHP so you need to unzip them on some server (your localhost or some development machine) that can execute PHP scripts.

For testing, you can also put them on the server where your WordPress installation is but note that this is not recommended since anyone who knows a link to this page will be able to play with your API.

Once you have the file uploaded you need to open the config.php file and fill the configuration with the data from the REST API panel.

To test if everything is working properly visit the page /wpjobboard-api/jobs-get.php it should show you the list of active jobs on your site in a JSON format.

In the wpjobboard-api folder you will find files with different code examples that will show you how list and publish: jobs, applications, resumes and companies.

 

Leave a Reply

Your email address will not be published. Required fields are marked *