Skip to main content

Actions

The ballerinax/sap.successfactors.ecemploymentinformation package exposes the following clients:

Available clients:

ClientPurpose
ClientManages ecemploymentinformation objects: EmpBeneficiary, EmpEmployment, EmpEmploymentTermination, EmpPensionPayout, EmpWorkPermit, EmpJobRelationships, EmpJob, PersonEmpTerminationInfo…, over the SAP SuccessFactors OData v2 API.

Client​

You can use these APIs to access the employment related information, including job information, employment termination, and work permit.

Configuration​

ConnectionConfig​

Provides a set of configurations for controlling the behaviours when communicating with the SAP SuccessFactors OData endpoint. Passed as the argument to the client initializer.

FieldTypeDefaultDescription
authhttp:CredentialsConfigRequiredConfigurations related to client authentication
httpVersionhttp:HttpVersionSee defaultThe HTTP version understood by the client
http1Settingshttp:ClientHttp1SettingsSee defaultConfigurations related to HTTP/1.x protocol
http2Settingshttp:ClientHttp2SettingsSee defaultConfigurations related to HTTP/2 protocol
timeoutdecimalSee defaultThe maximum time to wait (in seconds) for a response before closing the connection
forwardedstringSee defaultThe choice of setting forwarded/x-forwarded header
followRedirectshttp:FollowRedirectsOptionalConfigurations associated with Redirection
poolConfighttp:PoolConfigurationOptionalConfigurations associated with request pooling
cachehttp:CacheConfigSee defaultHTTP caching related configurations
compressionhttp:CompressionSee defaultSpecifies the way of handling compression (accept-encoding) header
circuitBreakerhttp:CircuitBreakerConfigOptionalConfigurations associated with the behaviour of the Circuit Breaker
retryConfighttp:RetryConfigOptionalConfigurations associated with retrying
cookieConfighttp:CookieConfigOptionalConfigurations associated with cookies
responseLimitshttp:ResponseLimitConfigsSee defaultConfigurations associated with inbound response size limits
secureSockethttp:ClientSecureSocketOptionalSSL/TLS-related options
proxyhttp:ProxyConfigOptionalProxy server related options
socketConfighttp:ClientSocketConfigSee defaultProvides settings related to client socket configuration
validationbooleanSee defaultEnables the inbound payload validation functionality which provided by the constraint package. Enabled by default
laxDataBindingbooleanSee defaultEnables relaxed data binding on the client side. When enabled, nil values are treated as optional, and absent fields are handled as nilable types. Enabled by default.

The client also accepts a hostname string parameter (the SAP SuccessFactors API server host) and an optional port (defaults to 443).

Initializing the client​

import ballerinax/sap.successfactors.ecemploymentinformation;

configurable string hostname = ?;
configurable string username = ?;
configurable string password = ?;

ecemploymentinformation:Client client = check new (
{
auth: { username, password }
},
hostname
);

Operations​

EmpBeneficiary​

listEmpBeneficiaries

Queries the EmpBeneficiary collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmpBeneficiariesQueriesNoQueries to be sent with the request

Returns: ListEmpBeneficiariesResponse&#124;error

Sample code:

ListEmpBeneficiariesResponse result = check client->listEmpBeneficiaries();

Sample response:

{
"d": {
"results": [
{
"employmentNav": {},
"personIdExternal": "1000",
"userId": "1000"
}
]
}
}
getEmpBeneficiary

Retrieves a single EmpBeneficiary entity identified by its key property.

Parameters:

NameTypeRequiredDescription
userIdstringYeskey: userId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmpBeneficiaryQueriesNoQueries to be sent with the request

Returns: EmpBeneficiary_1&#124;error

Sample code:

EmpBeneficiary_1 result = check client->getEmpBeneficiary(userId);

Sample response:

{
"d": {
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
},
"personIdExternal": "1000",
"userId": "1000"
}
}

EmpEmployment​

listEmpEmployments

Queries the EmpEmployment collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmpEmploymentsQueriesNoQueries to be sent with the request

Returns: ListEmpEmploymentsResponse&#124;error

Sample code:

ListEmpEmploymentsResponse result = check client->listEmpEmployments();

Sample response:

{
"d": {
"results": [
{
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
}
]
}
}
getEmpEmployment

Retrieves a single EmpEmployment entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
personIdExternalstringYeskey: personIdExternal
userIdstringYeskey: userId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmpEmploymentQueriesNoQueries to be sent with the request

Returns: EmpEmployment_1&#124;error

Sample code:

EmpEmployment_1 result = check client->getEmpEmployment(personIdExternal, userId);

Sample response:

{
"d": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {
"employmentNav": {},
"personIdExternal": "1000",
"userId": "1000"
},
"empJobRelationshipNav": {
"results": []
},
"empPensionPayoutNav": {
"employmentNav": {},
"personIdExternal": "1000",
"userId": "1000"
},
"empWorkPermitNav": {
"results": []
},
"jobInfoNav": {
"results": []
}
}
}

EmpEmploymentTermination​

listEmpEmploymentTerminations

Queries the EmpEmploymentTermination collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmpEmploymentTerminationsQueriesNoQueries to be sent with the request

Returns: ListEmpEmploymentTerminationsResponse&#124;error

Sample code:

ListEmpEmploymentTerminationsResponse result = check client->listEmpEmploymentTerminations();

Sample response:

{
"d": {
"results": [
{
"endDate": "2026-01-01",
"personIdExternal": "1000",
"userId": "1000",
"employmentNav": {},
"jobInfoNav": {}
}
]
}
}
getEmpEmploymentTermination

Retrieves a single EmpEmploymentTermination entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
endDatestringYeskey: endDate
personIdExternalstringYeskey: personIdExternal
userIdstringYeskey: userId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmpEmploymentTerminationQueriesNoQueries to be sent with the request

Returns: EmpEmploymentTermination_1&#124;error

Sample code:

EmpEmploymentTermination_1 result = check client->getEmpEmploymentTermination(endDate, personIdExternal, userId);

Sample response:

{
"d": {
"endDate": "2026-01-01",
"personIdExternal": "1000",
"userId": "1000",
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
},
"jobInfoNav": {
"seqNumber": "string",
"startDate": "2026-01-01",
"userId": "1000",
"employmentNav": {},
"managerEmploymentNav": {}
}
}
}

EmpPensionPayout​

listEmpPensionPayouts

Queries the EmpPensionPayout collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmpPensionPayoutsQueriesNoQueries to be sent with the request

Returns: ListEmpPensionPayoutsResponse&#124;error

Sample code:

ListEmpPensionPayoutsResponse result = check client->listEmpPensionPayouts();

Sample response:

{
"d": {
"results": [
{
"employmentNav": {},
"personIdExternal": "1000",
"userId": "1000"
}
]
}
}
getEmpPensionPayout

Retrieves a single EmpPensionPayout entity identified by its key property.

Parameters:

NameTypeRequiredDescription
userIdstringYeskey: userId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmpPensionPayoutQueriesNoQueries to be sent with the request

Returns: EmpPensionPayout_1&#124;error

Sample code:

EmpPensionPayout_1 result = check client->getEmpPensionPayout(userId);

Sample response:

{
"d": {
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
},
"personIdExternal": "1000",
"userId": "1000"
}
}

EmpWorkPermit​

listEmpWorkPermits

Queries the EmpWorkPermit collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmpWorkPermitsQueriesNoQueries to be sent with the request

Returns: ListEmpWorkPermitsResponse&#124;error

Sample code:

ListEmpWorkPermitsResponse result = check client->listEmpWorkPermits();

Sample response:

{
"d": {
"results": [
{
"country": "string",
"documentNumber": "string",
"documentType": "string",
"userId": "1000",
"employmentNav": {}
}
]
}
}
getEmpWorkPermit

Retrieves a single EmpWorkPermit entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
countrystringYeskey: country
documentNumberstringYeskey: documentNumber
documentTypestringYeskey: documentType
userIdstringYeskey: userId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmpWorkPermitQueriesNoQueries to be sent with the request

Returns: EmpWorkPermit_1&#124;error

Sample code:

EmpWorkPermit_1 result = check client->getEmpWorkPermit(country, documentNumber, documentType, userId);

Sample response:

{
"d": {
"country": "string",
"documentNumber": "string",
"documentType": "string",
"userId": "1000",
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
}
}
}

EmpJobRelationships​

listEmpJobRelationshipss

Queries the EmpJobRelationships collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmpJobRelationshipssQueriesNoQueries to be sent with the request

Returns: ListEmpJobRelationshipssResponse&#124;error

Sample code:

ListEmpJobRelationshipssResponse result = check client->listEmpJobRelationshipss();

Sample response:

{
"d": {
"results": [
{
"relationshipType": "string",
"startDate": "2026-01-01",
"userId": "1000",
"employmentNav": {},
"relEmploymentNav": {}
}
]
}
}
getEmpJobRelationships

Retrieves a single EmpJobRelationships entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
relationshipTypestringYeskey: relationshipType
startDatestringYeskey: startDate
userIdstringYeskey: userId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmpJobRelationshipsQueriesNoQueries to be sent with the request

Returns: EmpJobRelationships_1&#124;error

Sample code:

EmpJobRelationships_1 result = check client->getEmpJobRelationships(relationshipType, startDate, userId);

Sample response:

{
"d": {
"relationshipType": "string",
"startDate": "2026-01-01",
"userId": "1000",
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
},
"relEmploymentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
}
}
}

EmpJob​

listEmpJobs

Queries the EmpJob collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListEmpJobsQueriesNoQueries to be sent with the request

Returns: ListEmpJobsResponse&#124;error

Sample code:

ListEmpJobsResponse result = check client->listEmpJobs();

Sample response:

{
"d": {
"results": [
{
"seqNumber": "string",
"startDate": "2026-01-01",
"userId": "1000",
"employmentNav": {},
"managerEmploymentNav": {}
}
]
}
}
getEmpJob

Retrieves a single EmpJob entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
seqNumberintYeskey: seqNumber
startDatestringYeskey: startDate
userIdstringYeskey: userId
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetEmpJobQueriesNoQueries to be sent with the request

Returns: EmpJob_1&#124;error

Sample code:

EmpJob_1 result = check client->getEmpJob(seqNumber, startDate, userId);

Sample response:

{
"d": {
"seqNumber": "string",
"startDate": "2026-01-01",
"userId": "1000",
"employmentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
},
"managerEmploymentNav": {
"personIdExternal": "1000",
"userId": "1000",
"empBeneficiaryNav": {},
"empJobRelationshipNav": {},
"empPensionPayoutNav": {},
"empWorkPermitNav": {},
"jobInfoNav": {}
}
}
}

PersonEmpTerminationInfo​

listPersonEmpTerminationInfos

Queries the PersonEmpTerminationInfo collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListPersonEmpTerminationInfosQueriesNoQueries to be sent with the request

Returns: ListPersonEmpTerminationInfosResponse&#124;error

Sample code:

ListPersonEmpTerminationInfosResponse result = check client->listPersonEmpTerminationInfos();

Sample response:

{
"d": {
"results": [
{
"personIdExternal": "1000"
}
]
}
}
getPersonEmpTerminationInfo

Retrieves a single PersonEmpTerminationInfo entity identified by its key property.

Parameters:

NameTypeRequiredDescription
personIdExternalstringYeskey: personIdExternal
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetPersonEmpTerminationInfoQueriesNoQueries to be sent with the request

Returns: PersonEmpTerminationInfo_1&#124;error

Sample code:

PersonEmpTerminationInfo_1 result = check client->getPersonEmpTerminationInfo(personIdExternal);

Sample response:

{
"d": {
"personIdExternal": "1000"
}
}

HireDateChange​

listHireDateChanges

Queries the HireDateChange collection and returns a page of entities, optionally filtered, sorted, and paged via OData query options.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queriesListHireDateChangesQueriesNoQueries to be sent with the request

Returns: ListHireDateChangesResponse&#124;error

Sample code:

ListHireDateChangesResponse result = check client->listHireDateChanges();

Sample response:

{
"d": {
"results": [
{
"code": "1000"
}
]
}
}
createHireDateChange

Creates a new HireDateChange entity from the supplied payload.

Parameters:

NameTypeRequiredDescription
payloadHireDateChangeYesNew entity
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CreatedHireDateChange&#124;error

Sample code:

CreatedHireDateChange result = check client->createHireDateChange(payload);

Sample response:

{
"d": {
"code": "1000"
}
}
getHireDateChange

Retrieves a single HireDateChange entity identified by its key property.

Parameters:

NameTypeRequiredDescription
codestringYeskey: code
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetHireDateChangeQueriesNoQueries to be sent with the request

Returns: HireDateChange_1&#124;error

Sample code:

HireDateChange_1 result = check client->getHireDateChange(code);

Sample response:

{
"d": {
"code": "1000"
}
}
deleteHireDateChange

Deletes the HireDateChange identified by its key property.

Parameters:

NameTypeRequiredDescription
codestringYeskey: code
headersDeleteHireDateChangeHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteHireDateChange(code);