Fork me on GitHub

In the context of API, the VLE (Virtual Learning Environment) is just called environment. It serves as an organizer of courses. An environment represents the institution or company that owns these courses. Besides, the environment holds administrative options that make sense to the Knowledge Manager or DL (Distance Learning) Manager. By itself, it does not have content (lectures, files, and posts) nor users. These are, respectively, in classes and courses.

Attributes

Attribute Description
ID Environment ID
name Name
initials Initials
path Path used in URL
description Description
courses_count Number of courses
thumbnails Environment thumbnails. Available dimensions: 32×32, 48×48, 90×90, 96×96, and 140×140

Links

Link Description
self Environment in question
courses Courses
user User who has created the environment

Representation

{
    "description": "Ambiente de MOOCs (Massive Open Online Courses, ou Cursos Online Abertos Massivos), organizados pela ABMES (Associação Brasileira de Mantenedoras de Ensino Superior) e coordenados por João Mattar e o GPTED-TIDD (Grupo de Pesquisa em Tecnologias Educacionais do Programa de Pós-Graduação em Tecnologias da Inteligência e Design Digital da PUC-SP).",
    "links": [
        {
            "href": "http://www.redu.com.br/api/users/Anderson",
            "rel": "user"
        },
        {
            "href": "http://www.redu.com.br/api/environments/moocs",
            "rel": "self"
        },
        {
            "href": "http://www.redu.com.br/api/environments/moocs/courses",
            "rel": "courses"
        }
    ],
    "name": "MOOCs",
    "created_at": "2013-02-23T12:09:56-03:00",
    "path": "moocs",
    "updated_at": "2013-03-16T16:09:00-03:00",
    "initials": "MOOCs",
    "id": 1362,
    "thumbnails": [
        {
            "size": "140x140",
            "href": "http://s3.amazonaws.com/redu_uploads/environments/avatars/1362/thumb_140/logo_abmes_90_90.jpg?1362484765"
        },
        {
            "size": "32x32",
            "href": "http://s3.amazonaws.com/redu_uploads/environments/avatars/1362/thumb_32/logo_abmes_90_90.jpg?1362484765"
        },
        {
            "size": "90x90",
            "href": "http://s3.amazonaws.com/redu_uploads/environments/avatars/1362/thumb_90/logo_abmes_90_90.jpg?1362484765"
        },
        {
            "size": "48x48",
            "href": "http://s3.amazonaws.com/redu_uploads/environments/avatars/1362/thumb_48/logo_abmes_90_90.jpg?1362484765"
        },
        {
            "size": "96x96",
            "href": "http://s3.amazonaws.com/redu_uploads/environments/avatars/1362/thumb_96/logo_abmes_90_90.jpg?1362484765"
        }
    ],
}

GET /api/environments/:id

Returns the specified environment. Both ID and path can be used here, but the path is open to modifications by the user, so it can not work as a unique identifier.

Authorization

The user needs to participate in at least one course from the environment, or be the owner of it.

Parameters

Parameter Description Restrictions
id ID or path to environment N/A

POST /api/environments

Creates environment. By itself, environment is just a way to organize a set of courses, in the context of an institution.

Parameters

Parameter Description Restrictions
environment[name] Environment name Maximum 40 characters; it must be unique
environment[path] Name that will show up in the address bar It must fit the following regex: ^[-_A-Za-z0-9]*$
environment[initials] Abbreviation (used in some places of the interface) It must be unique; Maximum 40 characters
environment[description] Environment description Maximum 400 characters

Example

POST /api/environments/23

Payload (JSON):

{
  "environment" : {
    "name" : "meu novo ambiente",
      "path" : "meu-novo-ambiente",
      "initials" : "mna"
  }
}

Response:

{
  "initials": "mna",
    "links": [
    {
      "href": "http://www.redu.com.br/api/environments/meu-novo-ambiente",
      "rel": "self"
    },
    {
      "href": "http://www.redu.com.br/api/environments/meu-novo-ambiente/courses",
      "rel": "courses"
    },
    {
      "href": "http://www.redu.com.br/api/users/guiocavalcanti",
      "rel": "user"
    }
  ],
    "name": "meu novo ambiente",
    "created_at": "2012-09-10T09:42:00-03:00",
    "path": "meu-novo-ambiente",
    "id": 909
}

PUT /api/environments/:id

Updates information for environment in question.

Authorization

The user needs to be administrator of environment.

Parameters

Parameter Description Restrictions
environment[name] Environment name Maximum 40 characters; it must be unique
environment[path] Name that will show up in the address bar It must fit the following regex: ^[-_A-Za-z0-9]*$
environment[initials] Abbreviation (used in some places of the interface) It must be unique; Maximum 40 characters
environment[description] Environment description Maximum 400 characters

DELETE /api/environments/:id

Deletes the environment in question. All courses, classes, lectures and subjects associated to this environment will be also deleted, and they will no longer be accessible to users.

Authorization

The user needs to be administrator of environment.

Parameters

Parameter Description Restrictions
id ID or path to environment N/A