Simple client for the Kiron Partner API to manage courses
A token for the test system can be created here:
https://uat-internal.kiron.ngo/backend/kiron/organization/partnerapitokens
A token for the production system can be created here:
https://internal.kiron.ngo/backend/kiron/organization/partnerapitokens
<?php
require_once 'KironPartnerAPIClient.php'; // Require class
$client = new KironPartnerAPIClient('tokenfrombackend', 'UAT'); // Init client
$client->createOrUpdateCourse('200', [
'denomination' => 'Test Course',
'ects' => 5,
'link' => 'http://example.com/course',
'language' => 'German',
'startDateSemesterTwo' => '2020-12-10',
'endDateSemesterTwo' => '2021-02-04',
])); // Create or update course, for attirbutes see below
$client->getSections(); // Returns array of all sections
$client->getCourses(); // Returns array of all courses
$client->getCourse('200'); // Returns coruse with id 200
$client->deleteCourse('200'); // Deletes course with id 200
Params:
$token
is a valid token obtained in the backend$env
is one of:- 'LOCAL' (Local development system of Kiron),
- 'UAT' (Test System),
- 'PROD' (Production system)
Returns client object
Params:
$id
id of the course in the partner system (also called "externalId")$attributes
array of course attributes, see here for a description of all possible attributes
Returns response array:
- If course was created:
['response' => 'Created course as JSON string', 'code' => 200, 'successful' => true]
- If course was updated:
['response' => '', 'code' => 204, 'successful' => true]
- On error
['response' => 'Error message', 'code' => (A number >= 400), 'successful' => false]
No params
Returns list of sections with the following attributes:
- id: Id of the section
- denomination: Name of the section
- path: Name of the category / name of the secion
No params
Returns list of courses with all attributes listed here and the id in the partner system as externalId
Throws an Exception when list cannot be found retrieved!
Params:
$id
id of the course in the partner system (also called "externalId")
Returns course with the given id with all attributes listed here and given id as externalId
Throws an Exception when course cannot be found!
Params:
$id
id of the course in the partner system (also called "externalId")
Returns response array:
- If course was deleted:
['response' => '', 'code' => 204, 'successful' => true]
- On error
['response' => 'Error message', 'code' => (A number >= 400), 'successful' => false]
Property | Type | Required |
---|---|---|
denomination | string |
Required |
ects | integer |
Required |
workload | number |
Optional |
weeks | integer |
Optional |
link | string |
Required |
language | string |
Required |
sectionId | integer |
Optional |
courseLevel | string |
Optional |
certificateType | string |
Optional |
certificateCost | string |
Optional |
registrationDeadline | string |
Optional |
degreeLevel | string |
Optional |
yufeFocusArea | string |
Optional |
physicalOrVirtual | string |
Optional |
studyProgramYear | string |
Optional |
semesterOffered | string |
Optional |
startDateSemesterOne | string |
Optional* |
endDateSemesterOne | string |
Optional* |
startDateSemesterTwo | string |
Optional* |
endDateSemesterTwo | string |
Optional* |
courseExaminationType | string |
Optional |
availableSeats | integer |
Optional |
dublinDescriptors | string |
Optional |
admissionCriteria | string |
Optional |
courseCoordinator | string |
Optional |
shortDescription | string |
Optional |
longDescription | string |
Optional |
imageUrl | string |
Optional |
status | string |
Optional |
*Note that not all start and end dates are optional at the same time. At least one set of start and end dates must be provided for the first or second semester
The name of the course.
denomination
- is required
- Type:
string
- cannot be null
- defined in: Course
string
Amount of ECTS awarded for the completion of this course.
ects
- is required
- Type:
integer
- cannot be null
- defined in: Course
integer
Estimated amount of hours of work needed to complete the course. Defaults to 30*ects if not provided.
workload
- is optional
- Type:
number
- cannot be null
- defined in: Course
number
How many weeks does this course run? Will be calculated from start and end dates if not provided
weeks
- is optional
- Type:
integer
- cannot be null
- defined in: Course
integer
Link to this course in the partner LMS.
link
- is required
- Type:
string
- cannot be null
- defined in: Course
string
URI: the string must be a URI, according to RFC 3986
The name of the language that is spoken in this course.
language
- is required
- Type:
string
- cannot be null
- defined in: Course
string
Id of the section this course is shown in.
sectionId
- is optional
- Type:
integer
- cannot be null
- defined in: Course
integer
Difficulty level of this course.
courseLevel
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
"Introductory" |
|
"Intermediate" |
|
"Advanced" |
certificateType
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
"None" |
|
"Verified Certificate" |
|
"Unverified Certificate" |
Cost of the certificate.
certificateCost
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
"Free" |
|
"Paid" |
Date and time, when the registration for this courses closes.
registrationDeadline
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
The degree level of the course.
degreeLevel
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
yufeFocusArea
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
Information about the mode of the course. Can be any descriptive string.
physicalOrVirtual
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
Which year should the students study this course.
studyProgramYear
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
Semesters in which this course is offered.
semesterOffered
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
Start date of the course in the first semester if applicable.
startDateSemesterOne
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
date: the string must be a date string, according to RFC 3339, section 5.6
End date of the course in the first semester if applicable.
endDateSemesterOne
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
date: the string must be a date string, according to RFC 3339, section 5.6
Start date of the course in the second semester if applicable.
startDateSemesterTwo
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
date: the string must be a date string, according to RFC 3339, section 5.6
End date of the course in the second semester if applicable.
endDateSemesterTwo
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
date: the string must be a date string, according to RFC 3339, section 5.6
courseExaminationType
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
Seats available for YUFE incomings (positive integer)
availableSeats
- is optional
- Type:
integer
- cannot be null
- defined in: Course
integer
Learning outcomes of this course
dublinDescriptors
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
Requirements the students need to fulfill in order to study this course.
admissionCriteria
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
Person or institute responsible for running this course.
courseCoordinator
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
Optional description of the course.
shortDescription
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
Optional longer description of the course.
longDescription
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
URL of an image for the course.
imageUrl
- is optional
- Type:
string
- cannot be null
- defined in: Course
string
URI: the string must be a URI, according to RFC 3986
Status of this course.
status
- is optional
- Type:
string
- cannot be null
string
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
"new" |
Course not yet published on campus |
"ready" |
Course visible on campus |
"old" |
Only visible to students who are enrolled in the course |