CreateClassEnrollment
POST https://shared-tp-api-test.30a.dev/tp-api/classes/:classId/enrollments
Create a new enrollment for a class.
Path Parameters
- classId string required
Class ID
Header Parameters
- training-provider-id string required
- application/json
Request Body required
- employerId string required
Employer ID
newLearner object
- learnerId string
Training provider learner identifier. Note: One of
learnerId
andnewLearner
is required. If both are provided,newLearner
will be ignored. - enrolledAt date-time
The enrollment timestamp, should be in ISO8601 format. If not provided, the system will use the earlier of the current date and time or the class start date and time.
Responses
- 200
- 400
Default Response
- application/json
- Schema
- Example (from schema)
Schema
- id string required
{
"id": "string"
}
Default Response
- application/json
- Schema
- Example (from schema)
Schema
- anyOf
- MOD1
- MOD2
statusCode number requiredcode stringError code
error string requiredError key
message string requiredError message
error object required
{
"statusCode": 0,
"code": "string",
"error": "string",
"message": "string"
}
Authorization
name: Authorizationtype: apiKeyin: headerdescription: An Authorization Header with an auth-scheme of BLN including auth-params type, version, entity, key, token and secret. Example: `bln type=api, version=1, entity=user, key=<api-key>, token=<api-token>, secret=<api-secret>`
Request
Request
curl / cURL
curl -L -X POST 'https://shared-tp-api-test.30a.dev/tp-api/classes/:classId/enrollments' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"employerId": "string",
"newLearner": {
"firstname": "string",
"lastname": "string",
"email": "user@example.com",
"phone": "string"
},
"learnerId": "string",
"enrolledAt": "2024-10-23T16:51:09.155Z"
}'
nodejs / axios
curl -L -X POST 'https://shared-tp-api-test.30a.dev/tp-api/classes/:classId/enrollments' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"employerId": "string",
"newLearner": {
"firstname": "string",
"lastname": "string",
"email": "user@example.com",
"phone": "string"
},
"learnerId": "string",
"enrolledAt": "2024-10-23T16:51:09.155Z"
}'
python / requests
curl -L -X POST 'https://shared-tp-api-test.30a.dev/tp-api/classes/:classId/enrollments' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"employerId": "string",
"newLearner": {
"firstname": "string",
"lastname": "string",
"email": "user@example.com",
"phone": "string"
},
"learnerId": "string",
"enrolledAt": "2024-10-23T16:51:09.155Z"
}'
java / okhttp
curl -L -X POST 'https://shared-tp-api-test.30a.dev/tp-api/classes/:classId/enrollments' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"employerId": "string",
"newLearner": {
"firstname": "string",
"lastname": "string",
"email": "user@example.com",
"phone": "string"
},
"learnerId": "string",
"enrolledAt": "2024-10-23T16:51:09.155Z"
}'
csharp / restsharp
curl -L -X POST 'https://shared-tp-api-test.30a.dev/tp-api/classes/:classId/enrollments' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"employerId": "string",
"newLearner": {
"firstname": "string",
"lastname": "string",
"email": "user@example.com",
"phone": "string"
},
"learnerId": "string",
"enrolledAt": "2024-10-23T16:51:09.155Z"
}'