Personio API connection for Contao.
For the job listings you first need to configure the public XML feed of the company's job listings:
# config/config.yaml
contao_personio:
xml_feed: https://{YOUR_COMPANY}.jobs.personio.de/xml
For the Recruiting API you will need to define the Company ID and the Recruiting API token:
# config/config.yaml
contao_personio:
company_id: 123456
recruiting_api_token: your-token
It is recommended to store the token as an environment variable:
# .env
PERSONIO_RECRUITING_API_TOKEN=
# .env.local
PERSONIO_RECRUITING_API_TOKEN=your-token
# config/config.yaml
contao_personio:
recruiting_api_token: '%env(PERSONIO_RECRUITING_API_TOKEN)%'
The Personio jobs content elements lists all available jobs. Within the content element you can set a redirect page for the details of the job. This redirect page must be a page of the type Personio job (see below).
The Personio job content element acts as the reader output for the details of a job. For it work, it needs to be placed within a page of the type Personio job.
The application form can be placed either alongside the Personio job reader content element, or on its own page. In both cases the type of the page needs to be Personio job. If you place the form on a separate page, you can define a redirect page in the Personio job content element, so that it automatically generates a link to the application form.
The application form can either be generated through the dedicated Personio job application content element, or a form from the Contao Form Generator.
In order to get additional form fields for your custom Personio attributes into the application form, you can use the
ModifyApplicationFormListener
event:
// src/EventListener/ModifyApplicationFormListener.php
namespace App\EventListener;
use Codefog\HasteBundle\Util\ArrayPosition;
use InspiredMinds\ContaoPersonio\Event\ModifyApplicationFormEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
#[AsEventListener]
class ModifyApplicationFormListener
{
public function __invoke(ModifyApplicationFormEvent $event): void
{
$event->getForm()
->addFormField(
'custom_attribute_123',
[
'label' => 'Custom attribute',
'inputType' => 'text',
'eval' => ['maxlength' => 255],
],
ArrayPosition::after('email'),
)
;
}
}
The name of the field must match the internal name of the custom attribute.
Instead of using the Personio job application content element you can also create your own form in the Contao Form Generator and activate the Store in Personio setting. Within the form you can then add the form fields you need. The names of the fields must match the names of the fields in the API. For file uploads the field name must match the category of the file in the API.
Also keep in mind that the fields first_name
, last_name
and email
are mandatory in the Personio API.
Development funded by: