|
| 1 | +--- |
| 2 | +id: course-run-synchronization-api |
| 3 | +title: Course run synchronization API |
| 4 | +sidebar_label: course run sync |
| 5 | +--- |
| 6 | + |
| 7 | +API endpoint allowing remote systems to synchronize their course runs with a Richie instance. |
| 8 | + |
| 9 | +## Synchronization endpoint [/api/1.0/course-runs-sync] |
| 10 | + |
| 11 | +This documentation describes version "1.0" of this API endpoint. |
| 12 | + |
| 13 | +### Synchronize a course run [POST] |
| 14 | + |
| 15 | +It takes a JSON object containing the course run details: |
| 16 | + |
| 17 | +- resource_link: `https://lms.example.com/courses/course-v1:001+001+001/info` (string, required) - |
| 18 | + url of the course syllabus on the LMS from which a unique course identifier can be extracted |
| 19 | +- start: `2018-02-01T06:00:00Z` (string, optional) - ISO 8601 date, when this session of the |
| 20 | + course starts |
| 21 | +- end: `2018-02-28T06:00:00Z` (string, optional) - ISO 8601 date, when this session of the course |
| 22 | + ends |
| 23 | +- enrollment_start: `2018-01-01T06:00:00Z` (string, optional) - ISO 8601 date, when enrollment |
| 24 | + for this session of the course starts |
| 25 | +- enrollment_end: `2018-01-31T06:00:00Z` (string, optional) - ISO 8601 date, when enrollment for |
| 26 | + this session of the course ends |
| 27 | +- languages: ['fr', 'en'] (array[string], required) - ISO 639-1 code (2 letters) for the course's |
| 28 | + languages |
| 29 | + |
| 30 | + |
| 31 | ++ Request (application/json) |
| 32 | + + Headers |
| 33 | + + Authorization: `SIG-HMAC-SHA256 xxxxxxx` (string, required) - Authorization header |
| 34 | + containing the digest of the utf-8 encoded json representation of the submitted data |
| 35 | + for the given secret key and SHA256 digest algorithm (see [synchronizing-course-runs] |
| 36 | + for an example). |
| 37 | + + Body |
| 38 | + ```json |
| 39 | + { |
| 40 | + "resource_link": "https://lms.example.com/courses/course-v1:001+001+001/info", |
| 41 | + "start": "2021-02-01T00:00:00Z", |
| 42 | + "end": "2021-02-31T23:59:59Z", |
| 43 | + "enrollment_start": "2021-01-01T00:00:00Z", |
| 44 | + "enrollment_end": "2021-01-31T23:59:59Z", |
| 45 | + "languages": ["en", "fr"] |
| 46 | + } |
| 47 | + ``` |
| 48 | + |
| 49 | ++ Response 200 (application/json) |
| 50 | + |
| 51 | + + Body |
| 52 | + ```json |
| 53 | + { |
| 54 | + "success": True |
| 55 | + } |
| 56 | + ``` |
0 commit comments