Skip to main content

Actions

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

Available clients:

ClientPurpose
ClientManages ecapprenticemanagement objects: ApprenticeEventType, DepartmentApprenticeDetail, ApprenticeSchool, ApprenticeGroup, ApprenticeSchoolEvent, ApprenticePracticalTrainingEvent, ApprenticeInternalTrainingEvent, Apprentice, over the SAP SuccessFactors OData v2 API.

Client​

API to access apprentice management related data.

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.ecapprenticemanagement;

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

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

Operations​

ApprenticeEventType​

listApprenticeEventTypes

Queries the ApprenticeEventType 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
queriesListApprenticeEventTypesQueriesNoQueries to be sent with the request

Returns: ListApprenticeEventTypesResponse&#124;error

Sample code:

ListApprenticeEventTypesResponse result = check client->listApprenticeEventTypes();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000"
}
]
}
}
createApprenticeEventType

Creates a new ApprenticeEventType entity from the supplied payload.

Parameters:

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

Returns: CreatedApprenticeEventType&#124;error

Sample code:

CreatedApprenticeEventType result = check client->createApprenticeEventType(payload);

Sample response:

{
"d": {
"externalCode": "1000"
}
}
getApprenticeEventType

Retrieves a single ApprenticeEventType entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetApprenticeEventTypeQueriesNoQueries to be sent with the request

Returns: ApprenticeEventType&#124;error

Sample code:

ApprenticeEventType result = check client->getApprenticeEventType(externalCode);

Sample response:

{
"d": {
"externalCode": "1000"
}
}
updateApprenticeEventType

Updates the ApprenticeEventType identified by its key property with the supplied payload.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
payloadModifiedApprenticeEventTypeYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateApprenticeEventType(externalCode, payload);
deleteApprenticeEventType

Deletes the ApprenticeEventType identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersDeleteApprenticeEventTypeHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteApprenticeEventType(externalCode);

DepartmentApprenticeDetail​

listDepartmentApprenticeDetails

Queries the DepartmentApprenticeDetail 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
queriesListDepartmentApprenticeDetailsQueriesNoQueries to be sent with the request

Returns: ListDepartmentApprenticeDetailsResponse&#124;error

Sample code:

ListDepartmentApprenticeDetailsResponse result = check client->listDepartmentApprenticeDetails();

Sample response:

{
"d": {
"results": [
{
"Department_effectiveStartDate": "2026-01-01",
"Department_externalCode": "1000",
"externalCode": "1000"
}
]
}
}
createDepartmentApprenticeDetail

Creates a new DepartmentApprenticeDetail entity from the supplied payload.

Parameters:

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

Returns: CreatedDepartmentApprenticeDetail&#124;error

Sample code:

CreatedDepartmentApprenticeDetail result = check client->createDepartmentApprenticeDetail(payload);

Sample response:

{
"d": {
"Department_effectiveStartDate": "2026-01-01",
"Department_externalCode": "1000",
"externalCode": "1000"
}
}
getDepartmentApprenticeDetail

Retrieves a single DepartmentApprenticeDetail entity identified by its key properties.

Parameters:

NameTypeRequiredDescription
Department_effectiveStartDatestringYeskey: Department_effectiveStartDate
Department_externalCodestringYeskey: Department_externalCode
externalCodeintYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetDepartmentApprenticeDetailQueriesNoQueries to be sent with the request

Returns: DepartmentApprenticeDetail_1&#124;error

Sample code:

DepartmentApprenticeDetail_1 result = check client->getDepartmentApprenticeDetail(Department_effectiveStartDate, Department_externalCode, externalCode);

Sample response:

{
"d": {
"Department_effectiveStartDate": "2026-01-01",
"Department_externalCode": "1000",
"externalCode": "1000"
}
}
updateDepartmentApprenticeDetail

Updates the DepartmentApprenticeDetail identified by its key properties with the supplied payload.

Parameters:

NameTypeRequiredDescription
Department_effectiveStartDatestringYeskey: Department_effectiveStartDate
Department_externalCodestringYeskey: Department_externalCode
externalCodeintYeskey: externalCode
payloadModifiedDepartmentApprenticeDetailYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateDepartmentApprenticeDetail(Department_effectiveStartDate, Department_externalCode, externalCode, payload);
deleteDepartmentApprenticeDetail

Deletes the DepartmentApprenticeDetail identified by its key properties.

Parameters:

NameTypeRequiredDescription
Department_effectiveStartDatestringYeskey: Department_effectiveStartDate
Department_externalCodestringYeskey: Department_externalCode
externalCodeintYeskey: externalCode
headersDeleteDepartmentApprenticeDetailHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteDepartmentApprenticeDetail(Department_effectiveStartDate, Department_externalCode, externalCode);

ApprenticeSchool​

listApprenticeSchools

Queries the ApprenticeSchool 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
queriesListApprenticeSchoolsQueriesNoQueries to be sent with the request

Returns: ListApprenticeSchoolsResponse&#124;error

Sample code:

ListApprenticeSchoolsResponse result = check client->listApprenticeSchools();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000"
}
]
}
}
createApprenticeSchool

Creates a new ApprenticeSchool entity from the supplied payload.

Parameters:

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

Returns: CreatedApprenticeSchool&#124;error

Sample code:

CreatedApprenticeSchool result = check client->createApprenticeSchool(payload);

Sample response:

{
"d": {
"externalCode": "1000"
}
}
getApprenticeSchool

Retrieves a single ApprenticeSchool entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetApprenticeSchoolQueriesNoQueries to be sent with the request

Returns: ApprenticeSchool_1&#124;error

Sample code:

ApprenticeSchool_1 result = check client->getApprenticeSchool(externalCode);

Sample response:

{
"d": {
"externalCode": "1000"
}
}
updateApprenticeSchool

Updates the ApprenticeSchool identified by its key property with the supplied payload.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
payloadModifiedApprenticeSchoolYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateApprenticeSchool(externalCode, payload);
deleteApprenticeSchool

Deletes the ApprenticeSchool identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersDeleteApprenticeSchoolHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteApprenticeSchool(externalCode);

ApprenticeGroup​

listApprenticeGroups

Queries the ApprenticeGroup 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
queriesListApprenticeGroupsQueriesNoQueries to be sent with the request

Returns: ListApprenticeGroupsResponse&#124;error

Sample code:

ListApprenticeGroupsResponse result = check client->listApprenticeGroups();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000"
}
]
}
}
createApprenticeGroup

Creates a new ApprenticeGroup entity from the supplied payload.

Parameters:

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

Returns: CreatedApprenticeGroup&#124;error

Sample code:

CreatedApprenticeGroup result = check client->createApprenticeGroup(payload);

Sample response:

{
"d": {
"externalCode": "1000"
}
}
getApprenticeGroup

Retrieves a single ApprenticeGroup entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetApprenticeGroupQueriesNoQueries to be sent with the request

Returns: ApprenticeGroup_1&#124;error

Sample code:

ApprenticeGroup_1 result = check client->getApprenticeGroup(externalCode);

Sample response:

{
"d": {
"externalCode": "1000"
}
}
updateApprenticeGroup

Updates the ApprenticeGroup identified by its key property with the supplied payload.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
payloadModifiedApprenticeGroupYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateApprenticeGroup(externalCode, payload);
deleteApprenticeGroup

Deletes the ApprenticeGroup identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersDeleteApprenticeGroupHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteApprenticeGroup(externalCode);

ApprenticeSchoolEvent​

listApprenticeSchoolEvents

Queries the ApprenticeSchoolEvent 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
queriesListApprenticeSchoolEventsQueriesNoQueries to be sent with the request

Returns: ListApprenticeSchoolEventsResponse&#124;error

Sample code:

ListApprenticeSchoolEventsResponse result = check client->listApprenticeSchoolEvents();

Sample response:

{
"d": {
"results": [
{
"externalCode": "1000",
"assignedApprentices": {},
"eventTypeNav": {},
"schoolNav": {}
}
]
}
}
createApprenticeSchoolEvent

Creates a new ApprenticeSchoolEvent entity from the supplied payload.

Parameters:

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

Returns: CreatedApprenticeSchoolEvent&#124;error

Sample code:

CreatedApprenticeSchoolEvent result = check client->createApprenticeSchoolEvent(payload);

Sample response:

{
"d": {
"externalCode": "1000",
"assignedApprentices": {
"results": []
},
"eventTypeNav": {
"externalCode": "1000"
},
"schoolNav": {
"externalCode": "1000"
}
}
}
getApprenticeSchoolEvent

Retrieves a single ApprenticeSchoolEvent entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetApprenticeSchoolEventQueriesNoQueries to be sent with the request

Returns: ApprenticeSchoolEvent_1&#124;error

Sample code:

ApprenticeSchoolEvent_1 result = check client->getApprenticeSchoolEvent(externalCode);

Sample response:

{
"d": {
"externalCode": "1000",
"assignedApprentices": {
"results": []
},
"eventTypeNav": {
"externalCode": "1000"
},
"schoolNav": {
"externalCode": "1000"
}
}
}
updateApprenticeSchoolEvent

Updates the ApprenticeSchoolEvent identified by its key property with the supplied payload.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
payloadModifiedApprenticeSchoolEventYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateApprenticeSchoolEvent(externalCode, payload);
deleteApprenticeSchoolEvent

Deletes the ApprenticeSchoolEvent identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersDeleteApprenticeSchoolEventHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteApprenticeSchoolEvent(externalCode);

ApprenticePracticalTrainingEvent​

listApprenticePracticalTrainingEvents

Queries the ApprenticePracticalTrainingEvent 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
queriesListApprenticePracticalTrainingEventsQueriesNoQueries to be sent with the request

Returns: json&#124;error

Sample code:

json result = check client->listApprenticePracticalTrainingEvents();
getApprenticePracticalTrainingEvent

Retrieves a single ApprenticePracticalTrainingEvent entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetApprenticePracticalTrainingEventQueriesNoQueries to be sent with the request

Returns: json&#124;error

Sample code:

json result = check client->getApprenticePracticalTrainingEvent(externalCode);
deleteApprenticePracticalTrainingEvent

Deletes the ApprenticePracticalTrainingEvent identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersDeleteApprenticePracticalTrainingEventHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteApprenticePracticalTrainingEvent(externalCode);

ApprenticeInternalTrainingEvent​

listApprenticeInternalTrainingEvents

Queries the ApprenticeInternalTrainingEvent 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
queriesListApprenticeInternalTrainingEventsQueriesNoQueries to be sent with the request

Returns: json&#124;error

Sample code:

json result = check client->listApprenticeInternalTrainingEvents();
getApprenticeInternalTrainingEvent

Retrieves a single ApprenticeInternalTrainingEvent entity identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetApprenticeInternalTrainingEventQueriesNoQueries to be sent with the request

Returns: json&#124;error

Sample code:

json result = check client->getApprenticeInternalTrainingEvent(externalCode);
deleteApprenticeInternalTrainingEvent

Deletes the ApprenticeInternalTrainingEvent identified by its key property.

Parameters:

NameTypeRequiredDescription
externalCodestringYeskey: externalCode
headersDeleteApprenticeInternalTrainingEventHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteApprenticeInternalTrainingEvent(externalCode);

Apprentice​

listApprentices

Queries the Apprentice 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
queriesListApprenticesQueriesNoQueries to be sent with the request

Returns: ListApprenticesResponse&#124;error

Sample code:

ListApprenticesResponse result = check client->listApprentices();

Sample response:

{
"d": {
"results": [
{
"user": "string",
"assignedGroupNav": {},
"assignedSchoolNav": {}
}
]
}
}
createApprentice

Creates a new Apprentice entity from the supplied payload.

Parameters:

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

Returns: CreatedApprentice&#124;error

Sample code:

CreatedApprentice result = check client->createApprentice(payload);

Sample response:

{
"d": {
"user": "string",
"assignedGroupNav": {
"externalCode": "1000"
},
"assignedSchoolNav": {
"externalCode": "1000"
}
}
}
getApprentice

Retrieves a single Apprentice entity identified by its key property.

Parameters:

NameTypeRequiredDescription
userstringYeskey: user
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetApprenticeQueriesNoQueries to be sent with the request

Returns: Apprentice_1&#124;error

Sample code:

Apprentice_1 result = check client->getApprentice(user);

Sample response:

{
"d": {
"user": "string",
"assignedGroupNav": {
"externalCode": "1000"
},
"assignedSchoolNav": {
"externalCode": "1000"
}
}
}
updateApprentice

Updates the Apprentice identified by its key property with the supplied payload.

Parameters:

NameTypeRequiredDescription
userstringYeskey: user
payloadModifiedApprenticeYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateApprentice(user, payload);
deleteApprentice

Deletes the Apprentice identified by its key property.

Parameters:

NameTypeRequiredDescription
userstringYeskey: user
headersDeleteApprenticeHeadersNoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteApprentice(user);