Package Setup
Firstly, it is necessary to install the Refari package into the client's org - contact the Seven20 Product team to obtain the link for the latest package version. Seven20's Refari package is dependent on the following core product packages:
- Seven20 - Utilities
- Seven20 - Core
- Seven20 - Parse and Match
Configure the API key
As part of the onboarding process with Refari, they will provide the client with an API key. This needs to be stored in a packaged metadata record, as follows:
- In Seven20 navigate to Setup -> Custom Code -> Custom Metadata Types
- Click 'Manage Records' against Seven20 Configuration Setting
- Find the record called Refari Client Key (Refari_Client_Key), click Edit, paste the API token into the Value field and click Save
Updating the endpoint
The default endpoint is included as a packaged Seven20 configuration named Refari Api Url (Refari_Api_Url). The default value is currently correct for all clients, but if Refari make any updates to their API which result in a change to the URL, the value can be updated by following the same steps as for the API key above.
Setup the webhook
Create a site in Salesforce
In Salesforce setup, create a site and assign the below permissions to the Site:
| Permission Type | Name | Value |
|---|---|---|
| Apex Class | seven20.JobApplicationService | Enabled |
| Custom Metadata Types | seven20.Trigger Action | Enabled |
| Object | Accounts | Read, Create |
Copy the URL of the site as this will be required for the webhook.
Configure the webhook with Refari
- Access the Postman collection here and navigate to the Create Refari Webhook request.
- Under Headers replace the value for API-KEY with the API key provided by Refari
- Navigate to Body
- Where PASTE-URL-HERE is, paste the salesforce site URL appended with /services/apexrest/seven20/v1/jobs/application/
- Where ENTER-A-TOKEN-HERE is, enter a security key for the webhook; this should adhere to standard password security principles
- Press Send
- Ensure a 200 response is received
If an error response is received, check that all associated values have been entered correctly.
User/Recruiter setup
Create new Refari Recruiters
To create a new Recruiter in Refari from a Seven20 User record, simply check the Create Recruiter (seven20__Create_Recruiter__c) field on the relevant user record. After a few minutes, the Refari External Id (seven20__RefariExternalId__c) should become populated, confirming successful syncing.
Sync existing Refari Recruiters
If the Recruiter already exists in Refari run the below command from execute anonymous in the developer console to sync the records:
seven20.RefariRecruiterSync.syncRecruiters();
The email address on the Seven20 user record and pre-existing recruiter record in Refari must match for sync to be successful.
Configuring Categories, Locations, and Work Types
In Refari Categories, Locations, and Work Types exist as objects; in Seven20 they are represented by picklist fields. If a picklist value in Seven20 does not already exist as an object in Refari when a job advert is posted, a new Category, Location or Work Type will be created in Refari. Details of these created objects are stored in a custom setting in Seven20 named Refari Types (seven20__Refari_Types__c). These records are queried when sending job adverts to Refari and the Ids for existing values will be referenced in the request to prevent duplication.
Sync existing objects
If integrating into an existing Refari environment with Categories, Locations, or Work Types configured, after installation and completion of previous install steps run the below command from execute anonymous in the developer console:
seven20.SyncRefariObjectsQueueable.queueJob();
Job Posting
Job posting is controlled by the Send To Refari (seven20__Send_To_Refari__c) checkbox field on the Job (seven20__Job__c) record in Seven20; records with the checkbox set to true will be picked up by a trigger and flagged to be delivered to Refari. When posting, all required fields must be populated when sending (see field mappings for details).