htwg-cloud-application-development / frontend

0 stars 0 forks source link

Import courses #12

Closed phaldan closed 8 years ago

phaldan commented 8 years ago

Request course list

Call rest api after login to retrieve course list of moodle-user:

Route:

GET: /import/<moodle-token>

Reponse:

{
  "courses": [
    {
      "id": 1337,
      "shortname": "SE-AIN",
      "fullname": "Software Engineering"
    },
    {
      "id": 42,
      "shortname": "MDSD",
      "fullname": "Modellgetriebene Softwareentwicklung"
    },
    {
      "id": 1234,
      "shortname": "CLOUD",
      "fullname": "Cloud Application Development (Master)"
    }
  ]
}

Submit course list

User selects courses for import and calls rest-api to finally imports courses

Route:

POST: /import/courses/<moodle-token>

Body

{
  "courses": [
 {
      "id": 42,
      "shortname": "MDSD",
      "fullname": "Modellgetriebene Softwareentwicklung"
    },
    {
      "id": 1234,
      "shortname": "CLOUD",
      "fullname": "Cloud Application Development (Master)"
    }
  ]
}
SteffenGorenflo commented 8 years ago

The response will be: (when successful)

{
  "ok": true
}

Note: The request will take a long time. But no need to wait on it