How do I post jobs from XML Feed
  • 28 Nov 2023
  • 4 Minutes to read
  • PDF

How do I post jobs from XML Feed

  • PDF

Article Summary

You can post jobs to carehome.co.uk automatically by publishing an XML file that conforms to the XSD schema located at https://api.carehome.co.uk/feed/job/xml/job.xsd.

Full documentation for the schema is provided below 


 

Your browser does not support PDF.click here to download

 

the following is an example of a  feed containing a single job you can of course add as many job elements as required

<?xml version="1.0"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://api.carehome.co.uk/feed/job/xml/job.xsd">
    <jobs>
        <!-- place as many job elements as required here -->
        <job>
			<!--Element reference is is required and must be unique for each job element-->
            <reference>JOB #12344567A</reference>
            <category> <!-- either a category_id or category_name element -->
                <category_id>4</category_id>
				<!-- OR
                <category_name>Registered Manager / Service Manager</category_name>
				-->
            </category>            
            <title>The Job Title e.g. Head of Technical Support</title>
            <description><![CDATA[
				Description of your job. there is an HTML filter in place as follows p,i,b,u,strong,em,ol,ul,li,br 
				allowed but attributes stripped (exception align on p tags) small,big,center,font,div,span will be 
				removed but the content will stay e.g. '<center>hello</center>' would be replaced with 'hello' all 
				other tags and their content will be removed.
			]]></description>
            <skills>Comma, separated, list, of, Skills/Qualifications</skills><!--Element skills is optional-->
            <terms> <!-- either a salary or or a pay element -->
                <salary>single line free text e.g. 20-30k depending on experience</salary>
				<!-- OR
                <pay>
                    <pay_type> either a pay_type_id or a pay type_name
                        <pay_type_Id>2</pay_type_Id>
						OR
                        <pay_type_name>per hour</pay_type_name>
                    </pay_type>
                    <salary_from>1.00</salary_from>
                    <salary_to>2.00</salary_to>
                    <salary>optional single line free text e.g.Depending on experience</salary>
                </pay>
				-->
            </terms>
            <setting> <!-- either a setting_id or a setting_name element --> 
                <setting_id>17</setting_id>
				<!-- OR
                <setting_name>Other</setting_name>
				-->
            </setting>
            <jobtype> <!-- either a type_id or a type_name element -->
                <type_id>7</type_id>
				<!-- OR
                <type_name>Apprenticeship</type_name>
				-->
            </jobtype>
            <processed_by>single line The name of the person entering the job, for logging purposes (Not displayed to user)</processed_by>
            <contact>
                <name>contact name displayed with job details</name>
                <method> <!-- either a contact_email or a contact_url element -->
                    <contact_email>contact@your.biz</contact_email>
					<!-- OR
                    <contact_url>token</contact_url>
					-->
                </method>
            </contact>
            <admin_email>admin@your.biz</admin_email><!-- email used for administration purposes (Not displayed to user) --> 
            <location> <!-- either member_id with optional postcode or just postcode -->
                <member_id>1</member_id>
                <postcode>A0 0AA</postcode><!-- optional -->
				<!-- OR
                <postcode>A0 0AA</postcode>
				-->
            </location>
        </job>+
    </jobs>
</feed>

The key to maintaining your jobs with the xml feed is the reference this unique field controls what happens to the job as it is processed.

  1. If the reference does not exist on a job for your setting or any other members of your group (if applicable) a new job will be inserted.
  2. If the reference exists and was previously created from the feed but it is no longer in the feed it will be closed but only if it has not been modified since creation.

The feed can not be used to modify an existing job, you can publish a revised job with a new reference, and remove the existing reference from the feed which will close the old version. 

You can of course still edit a live job but if you do then the job will no longer be controlled by the feed and you will have to close it manually.

Once you have your XML file you will need to publish it on the internet and tell us where to find it. To set this up you will need to access your Control Panel.

From there you will find the navigation panel on the left side. 

Select Jobs>Your Jobs>XML Job Feed.

If you have not already added a feed URL, an add feed button is displayed clicking the button displays a form where you can add the feed URL with a checkbox to mark the feed as active. while a feed is active we will download and process the file each morning. 


If you wish to suspend the feed they can un select the checkbox and and the URL will be excluded from further processing until it is reselected.

Once a url has been added the add button is hidden and the URL is displayed with some controls 

The check mark will download the feed and validate it against the xsd reporting any errors this allows you to not only check the url is correct and that we can reach it

but also tests the validity of the XML against the schema so any error can be corrected before we try and process it.

The pen will open the above form so the feed can be edited, disabled/enabled , the out arrow will open the feed in a new window so you can see the XML, 

the bin will delete the feed URL (after confirmation), once deleted the Add button will become visible again so you can add a new URL

Each morning while the URL is active a scheduled task will import feed and a new row is added to the XML feed Activity table with the most recent run at the top.

if an import fails for some reason it is marked as such and if the row is expanded the table provides additional detail

The possible reasons for a failure are 

The URL does is not available, 

The URL  is available but does not contain xml

The URL  is available, contains XML but the XML doesn't conform to the XML schema

A job that has been processed will display a summary of the results, expanding the child row will provide details for each job in the feed.


In the above there are no existing jobs for the feed, the feed itself contains two jobs, one was posted successfully one failed no jobs where closed and no jobs failed to close

an individual job will fail

  1. If there is a communication error between admin and the api server
  2. The api returns an error

A warning is shown if a job with the same reference already exists for tyour setting or any other members of your group (if applicable) 

A job is closed when it has been created by the feed and still exists in its original state (never edited) but no longer exists in the feed



Was this article helpful?