Skip navigation

YouRecruit Own site posting

Wordpress Job Manager API Help - Download

This API module extends the WP Job Manager or Simple Job Board plugin and allows the posting and deletion of jobs from external websites using Json, XML or standard POST. Let us know if you need to support other plugins.

There are some settings, please see the Settings page section

Yourecruit Wordpress Integration

Do you want to integrate your wordpress installation with YouRecruit?

We have built an API that is integrated with WP Job Manager and Simple Job Board so that it should be very easy to integrate your own website job posting with wordpress.

  1. Install WP Job Manager or Simple Job Board,
  2. install WP Job Manager API2 - YouRecruit wordpress plugin,
  3. create new user in wordpress with admin rights,
  4. in Job Manager settings - allow categories.

When you have done this, please send email to support@yourecruit.com with the following details:

  • login details created in point 3 above,
  • name of the client,
  • URL for the website and login URL, if it is not the standard wp-login.php.

Additional Features

If you want to use job salary, update the one-job_listing.php and/or content-single-job_listing-meta.php, adding following piece of code echo WP_Job_Manager_TW_API::displaySalary(get_the_id()); on the place where you want display the salary. You may need to copy these files from the original WP Job Manager plugin into your template.

Settings page screenshot

Settings page

The API is fully configurable. You can find the settings in Admin > Job Listings > Settings > API2 for WP Job Manager (Admin > Job Board > Settings > API2 for Simple Job Board).

In the first part, you can set up the mapping from the API request to the internal Wordpress meta fields and taxonomies (allows you to create custom taxonomies and meta keys too). You can setup multiple keys for each field, taxonomies support multiple fields, but meta fields will be overridden with the latest one.

You can attach files to the job, this needs to be supplied as an URL currently. Once a user applies to a job, it can send the details to an arbitrary URL (applicant tracking).

Taxonomies also support a tree structure (sent as subitems of the specified key - eg. 'category_name': ['Category', 'Subcategory']), the last item can also be multiple - eg. 'category_name': ['Category', ['Subcategory', 'Subcategory 2']] (If you supply any other item as array, the behavior is undefined and is subject to later changes).

The Custom Meta items can specify own taxonomy - requiring a correct value when a job is posted.

The API allows the job to be mapped to another user, based on the email address (Do not enable when you do not trust the senders).

You can change the default status of the job when it is inserted (eg. to require a review), choose to update the publish date of the job, applicant source tracking, API access IP filter, specify the job url format, log the requests and export/restore the settings.

Technical description for Non-Yourecruit clients

You can find a how-to for this module here. There is also a snippet featuring the PHP code used to post to this module.

This module supports several commands:

Standard success response

When the request is successful, the response contain the string 'Success' within the message key, See below as an example.

<?xml version="1.0" encoding="utf-8"?>
<xmlfeed>
  <message>Successfuly posted</message>
</xmlfeed>

There can be multiple elements within the XML (not only the message), when the type of request requires it. But only one message element is allowed within the XML.

Standard error response

If there is any major issue with the request or it is missing some elements, the API can respond with a standard error response as follows:

<?xml version="1.0" encoding="utf-8"?>
<xmlfeed>
  <errors>
    <missing>login_details</missing>
  </errors>
</xmlfeed>

As previous, only one errors element is allowed, there are many subitems that can appear under the errors element (eg. 'missing', 'invalid', …)

How to start

To implement posting to the Wordpress module, You should take the following steps:

  1. Test active_reports first, it is the simplest one to begin with.
  2. Implement upload_job.
  3. Implement an update to the job that you have just inserted.
  4. Implement delete_job.

Command list_taxonomy

This allows you to list all the available taxonomy terms on the site. You should provide the name of the taxonomy in using a 'taxonomy' key in the request body.

Example: (Response: XML, JSON)

<?xml version="1.0" encoding="utf-8"?>
<xml>
  <login_username>admin</login_username>
  <login_password>1234</login_password>
  <taxonomy>job_listing_category</taxonomy>
</xml>

Command active_reports

This will let the poster know which jobs are present within the wordpress website, so they can update the current status on the posting system. (eg. automatic posting).

Example: (Response: XML, JSON)

<?xml version="1.0" encoding="utf-8"?>
<xml>
  <login_username>admin</login_username>
  <login_password>1234</login_password>
</xml>

Command upload_job

This is the main function, this will insert or update the job specified in XML, attach the categories, locations and job types to the job.

If there are multiple repeated elements present in the XML, the last one will be used.

Example: (Response: XML, JSON)

<?xml version="1.0" encoding="utf-8"?>
<xml>
  <login_username>admin</login_username>
  <login_password>1234</login_password>
  <job_id>40312571</job_id>
  <contact_name>Joe Black</contact_name>
  <contact_email>martin@nestdesign.com</contact_email>
  <ref>RF1234</ref>
  <title>Application Development and Support .Net</title>
  <salary>40000</salary>
  <salary_max>50000</salary_max>
  <salary_negotiable>0</salary_negotiable>
  <job_type>full-time</job_type>
  <category_name>
    <item>Sales</item>
    <item>
      <subitem>Sales Administration</subitem>
      <subitem>Sales Director</subitem>
    </item>
  </category_name>
  <location_name>
    <item>Ireland</item>
    <item>Dublin</item>
  </location_name>
  <desc_short>Application Support and Development .Net Location: Dublin City Centre Salary: 40 - 50K</desc_short>
  <desc_long><![CDATA[<UL><LI>2 years plus experience developing with .Net.</LI><LI>Ideally have knowledge of C#, but ASP.Net and VB.Net will also be of interest.</LI><LI>Have a strong customer focus.</LI><LI>Ideally have experience providing user support.</LI></UL>>]]></desc_long>
</xml>
  • job_id - A unique identifier supplied by the poster (it is not the same as post_id, returned in the response),
  • contact_name - Name of the consultant,
  • contact_email - The email address applications should be routed to,
  • ref - Poster reference number,
  • title - Job Title,
  • salary - The minimum salary provided,
  • salary_max - The maximum salary provided,
  • salary_negotiable - Whether to display the salary or not (supply 1 if you want to hide the salary, 0 or omitted tag to show the salary),
  • job_type - One of the job type taxonomy slug,
  • desc_short - Short description (exceprt),
  • desc_long - Job long description.
  • category_name - One category name or array of category names (the last item can be an array again)
  • location_name - One location name or array of location names (the last item can be an array again)

These fields are configurable in the Settings page.

Success Response

post_url, post_id elements will be returned, so the poster knows where the job can be viewed.

Command delete_job

This function deletes a job from Wordpress, if it is present and is to be removed, currently job_id is required to be present in the request.

Example: (Response: XML, JSON)

<?xml version="1.0" encoding="utf-8"?>
<xml>
  <login_username>admin</login_username>
  <login_password>1234</login_password>
  <job_id>40312571</job_id>
</xml>

Basic functionality

The following PHP snippet is useful for sending XML to the WP Job Manager API2.

<?php
$curl = curl_init();
$command = 'active_reports';
$xml_data = file_get_contents('request.xml');
curl_setopt_array($curl, array(
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => 1,
  CURLOPT_URL => 'http://yoursite.com/wp-admin/admin-ajax.php?act=wpjb_api_'.$command,
  CURLOPT_POSTFIELDS => $xml_data,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/xml',
    'Accept: text/xml'
  )
));
$response = curl_exec($curl);
curl_close($curl);
$xml = simplexml_load_string($response);
if($xml && stripos($xml->message, 'Success') !== false) {
  // the request succeded
} else {
  // There was some issue processing your request
}
?>

The request.xml has following defined structure:

<?xml version="1.0" encoding="utf-8"?>
<xml>
  <login_username>admin</login_username>
  <login_password>1234</login_password>
</xml>

login_username and login_password are the login details for a user in wordpress.


If you have any queries or issues, just contact us at support@yourecruit.com