API - Company Import / Synchronize

API - Company Import / Synchronize

The XML company import is available through an endpoint on the eRecruiter API, if you have the "Companies" access level granted for your API key.

General data structure

  1. One account has many locations.
  2. One location can have none, one or more contacts.
  3. A contact must be assigned to one location.

Format

The input file must be a well-formed XML document and valid against the specified XML schema. Have a look at the schema for a more detailed description of the fields.

REST web service

company import REST end point
PUT Api/Synchronize/Company?isValidationOnly=(false|true)&requestTimeout=(number)
HTTP request - body
{
XMLContent: "..."
}
HTTP response - body parameters
{
StatusType Status,
SyncResult Result
}
Type definitions
enum StatusType
{
ValidData = 1,
InValidData = 2,
PeristingSkipped = 4,
PersistingError = 8,
PersistingSuccess = 16,
}

SyncResult
{
string Identifyer,
string Type,
Message[] Messages,
SyncResult[] NestedResults
}

Message
{
string Text,
Severity Severity
}

enum Severity
{
Trace,
Debug,
Info,
Warning,
Error
}
The type definitions can also be found on GitHub

XML Schema

CompanyImport.xsd can be downloaded at the end of this article.

Import process

The import operation is an update operation too. For each data element in the XML, the importer tries to find an already existing similar data record in the eRecruiter database. If a data record is found, the attributes are updated with the values of the data element in the import XML. If no existing data record is found, a new data record is created. The following list describes which entities are identified by what property.

Company

A company entity is identified by the ExternalId property. If the existing data record matches the ExternalId of the import element, all values in the import element are stored to the existing data record.
Documents
Documents are identified by following three attributes:
DocumentTypeName
FileName
FileExtension
It's just possible to update the file content of the document.

Custom fields

The custom field is identified by it's Name . The value will be updated or created if the custom field exists in the eRecruiter, otherwise an error will be returned. The value is also validated.

Location

A location is identified by the following attributes:
Street
ZipCode
City

Contact

The contact entity is identified by the UserName property. The contact will be looked up in the company's context. If any contact is found, it will be assigned to the location, which is hierarchically above it. A contact can change the location withing a company. If no contact with the same username is found, a new data record is created.

Phone

A contact's phone is identified by its PhoneNumber . It will be either updated or created.

Email

A contact's email is identified by its EmailAdress . It will be either updated or created.

API-Client and usage

The company import can be called using the API command line client, which can be found on Github . The tool must be called with following command line parameters:
usage of company import--RunCompanySynchronization --XmlCompanySource PATH/TO/IMPORT.xml --ApiKey THE123API456KEY789 --ApiUrl " http://URL.TO/Api " --MandatorId ID --RequestTimeout 3600
The server and client side timeout is set to the timeout of the parameter RequestTimeout (in seconds). It's recommended to use the timeout parameter, due to a time consuming data synchronization operation.

    • Related Articles

    • Company Import

      The company import is available through a wizard in the eRecruiter backend (.../Modules/Import/Companies) if you have the permissions to import data. General data structure One account has many locations. One location can have none, one or more ...
    • Applicant Import

      The applicant import is an open source command line tool and can be found at https://github.com/eRecruiter/eRecruiter.ApplicantImport. Format The input file must be a tab-separated ("\t") Textfile in UTF8 format. The rows are separated by new line ...
    • API - Application

      Prerequisites It's assumed that the requesting user is authenticated and there is an existing job on which an applicant wants to apply. The following actions could be performed for an application: Apply for an existing job Apply again for an existing ...
    • API - External Profiles

      There are two possible ways for external profiles to be integrated into an applicant portal: Login with external profile Link with external profile Login with external profile Prerequisites The following prerequisites need to be met, if ...
    • API - Questionnaires

      The eRecuiter application allows recruiters to create questionnaires to create questions for jobs. Questionnaires describes applicant information, that can be provided for that job during the application process. For all possible questions, an API ...