Actions
The ballerinax/sap.successfactors.ecapprenticemanagement package exposes the following clients:
Available clients:
| Client | Purpose |
|---|---|
Client | Manages 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.
| Field | Type | Default | Description |
|---|---|---|---|
auth | http:CredentialsConfig | Required | Configurations related to client authentication |
httpVersion | http:HttpVersion | See default | The HTTP version understood by the client |
http1Settings | http:ClientHttp1Settings | See default | Configurations related to HTTP/1.x protocol |
http2Settings | http:ClientHttp2Settings | See default | Configurations related to HTTP/2 protocol |
timeout | decimal | See default | The maximum time to wait (in seconds) for a response before closing the connection |
forwarded | string | See default | The choice of setting forwarded/x-forwarded header |
followRedirects | http:FollowRedirects | Optional | Configurations associated with Redirection |
poolConfig | http:PoolConfiguration | Optional | Configurations associated with request pooling |
cache | http:CacheConfig | See default | HTTP caching related configurations |
compression | http:Compression | See default | Specifies the way of handling compression (accept-encoding) header |
circuitBreaker | http:CircuitBreakerConfig | Optional | Configurations associated with the behaviour of the Circuit Breaker |
retryConfig | http:RetryConfig | Optional | Configurations associated with retrying |
cookieConfig | http:CookieConfig | Optional | Configurations associated with cookies |
responseLimits | http:ResponseLimitConfigs | See default | Configurations associated with inbound response size limits |
secureSocket | http:ClientSecureSocket | Optional | SSL/TLS-related options |
proxy | http:ProxyConfig | Optional | Proxy server related options |
socketConfig | http:ClientSocketConfig | See default | Provides settings related to client socket configuration |
validation | boolean | See default | Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default |
laxDataBinding | boolean | See default | Enables 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:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListApprenticeEventTypesQueries | No | Queries to be sent with the request |
Returns: ListApprenticeEventTypesResponse|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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ApprenticeEvent | Yes | New entity |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: CreatedApprenticeEventType|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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetApprenticeEventTypeQueries | No | Queries to be sent with the request |
Returns: ApprenticeEventType|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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
payload | ModifiedApprenticeEventType | Yes | New property values |
headers | map<string|string[]> | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | DeleteApprenticeEventTypeHeaders | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListDepartmentApprenticeDetailsQueries | No | Queries to be sent with the request |
Returns: ListDepartmentApprenticeDetailsResponse|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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | DepartmentApprenticeDetail | Yes | New entity |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: CreatedDepartmentApprenticeDetail|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:
| Name | Type | Required | Description |
|---|---|---|---|
Department_effectiveStartDate | string | Yes | key: Department_effectiveStartDate |
Department_externalCode | string | Yes | key: Department_externalCode |
externalCode | int | Yes | key: externalCode |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetDepartmentApprenticeDetailQueries | No | Queries to be sent with the request |
Returns: DepartmentApprenticeDetail_1|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:
| Name | Type | Required | Description |
|---|---|---|---|
Department_effectiveStartDate | string | Yes | key: Department_effectiveStartDate |
Department_externalCode | string | Yes | key: Department_externalCode |
externalCode | int | Yes | key: externalCode |
payload | ModifiedDepartmentApprenticeDetail | Yes | New property values |
headers | map<string|string[]> | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
Department_effectiveStartDate | string | Yes | key: Department_effectiveStartDate |
Department_externalCode | string | Yes | key: Department_externalCode |
externalCode | int | Yes | key: externalCode |
headers | DeleteDepartmentApprenticeDetailHeaders | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListApprenticeSchoolsQueries | No | Queries to be sent with the request |
Returns: ListApprenticeSchoolsResponse|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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ApprenticeSchool | Yes | New entity |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: CreatedApprenticeSchool|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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetApprenticeSchoolQueries | No | Queries to be sent with the request |
Returns: ApprenticeSchool_1|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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
payload | ModifiedApprenticeSchool | Yes | New property values |
headers | map<string|string[]> | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | DeleteApprenticeSchoolHeaders | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListApprenticeGroupsQueries | No | Queries to be sent with the request |
Returns: ListApprenticeGroupsResponse|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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ApprenticeGroup | Yes | New entity |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: CreatedApprenticeGroup|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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetApprenticeGroupQueries | No | Queries to be sent with the request |
Returns: ApprenticeGroup_1|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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
payload | ModifiedApprenticeGroup | Yes | New property values |
headers | map<string|string[]> | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | DeleteApprenticeGroupHeaders | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListApprenticeSchoolEventsQueries | No | Queries to be sent with the request |
Returns: ListApprenticeSchoolEventsResponse|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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ApprenticeSchoolEvent | Yes | New entity |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: CreatedApprenticeSchoolEvent|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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetApprenticeSchoolEventQueries | No | Queries to be sent with the request |
Returns: ApprenticeSchoolEvent_1|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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
payload | ModifiedApprenticeSchoolEvent | Yes | New property values |
headers | map<string|string[]> | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | DeleteApprenticeSchoolEventHeaders | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListApprenticePracticalTrainingEventsQueries | No | Queries to be sent with the request |
Returns: json|error
Sample code:
json result = check client->listApprenticePracticalTrainingEvents();
getApprenticePracticalTrainingEvent
Retrieves a single ApprenticePracticalTrainingEvent entity identified by its key property.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetApprenticePracticalTrainingEventQueries | No | Queries to be sent with the request |
Returns: json|error
Sample code:
json result = check client->getApprenticePracticalTrainingEvent(externalCode);
deleteApprenticePracticalTrainingEvent
Deletes the ApprenticePracticalTrainingEvent identified by its key property.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | DeleteApprenticePracticalTrainingEventHeaders | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListApprenticeInternalTrainingEventsQueries | No | Queries to be sent with the request |
Returns: json|error
Sample code:
json result = check client->listApprenticeInternalTrainingEvents();
getApprenticeInternalTrainingEvent
Retrieves a single ApprenticeInternalTrainingEvent entity identified by its key property.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetApprenticeInternalTrainingEventQueries | No | Queries to be sent with the request |
Returns: json|error
Sample code:
json result = check client->getApprenticeInternalTrainingEvent(externalCode);
deleteApprenticeInternalTrainingEvent
Deletes the ApprenticeInternalTrainingEvent identified by its key property.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | key: externalCode |
headers | DeleteApprenticeInternalTrainingEventHeaders | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | ListApprenticesQueries | No | Queries to be sent with the request |
Returns: ListApprenticesResponse|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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | Apprentice | Yes | New entity |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: CreatedApprentice|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:
| Name | Type | Required | Description |
|---|---|---|---|
user | string | Yes | key: user |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetApprenticeQueries | No | Queries to be sent with the request |
Returns: Apprentice_1|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:
| Name | Type | Required | Description |
|---|---|---|---|
user | string | Yes | key: user |
payload | ModifiedApprentice | Yes | New property values |
headers | map<string|string[]> | No | Headers 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:
| Name | Type | Required | Description |
|---|---|---|---|
user | string | Yes | key: user |
headers | DeleteApprenticeHeaders | No | Headers to be sent with the request |
Returns: error?
Sample code:
check client->deleteApprentice(user);