Skip to content

Doubtfire API

List of Doubtfire

API: tutorials

tutorials : Operations about tutorials This markdown document provides detailed documentation for the “tutorials” API endpoints, including their URLs, methods, parameters (if any), responses, and example requests using curl.

This “tutorials” API has the following operations.

  • DELETE /api/tutorials/{id}
  • PUT /api/tutorials/{id}
  • POST /api/tutorials
  • DELETE /api/units/{unit_id}/tutorials/{tutorial_abbr}/enrolments/{project_id}
  • POST /api/units/{unit_id}/tutorials/{tutorial_abbr}/enrolments/{project_id}

DELETE: Delete a tutorial

DELETE /api/tutorials/{id}

  • URL: /api/tutorials/{id}

  • Method: DELETE

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    idpathintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 204 OK: Tutorial deleted successfully.

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: yzRDggcmzbVnYEbszVV1' 'http://localhost:3000/api/campuses/6'
  • Response body:

    true

PUT: Update a tutorial

PUT /api/tutorials/{id}

  • URL: /api/tutorials/{id}

  • Method: PUT

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    tutorial [unit_id]Id of the unitformDataintegerYes
    tutorial [tutor_id]Id of the tutorformDatainteger
    tutorial [campus_id]Id of the campusformDatainteger
    tutorial [capacity]Capacity of the tutorialformDatainteger
    tutorial[abbreviation]The tutorials codeformDatastring
    tutorial[meeting_location]The tutorials locationformDatastring
    tutorial[meeting_day]Day of the tutorialsformDatastring
    tutorial[meeting_time]Time of the tutorialsformDatastring
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X PUT --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 3DLo9xQoiKbXb7-ViNzJ' -d 'tutorial%5Btutor_id%5D=43&tutorial%5Bcapacity%5D=45' 'http://localhost:3000/api/tutorials/1'
  • Response body:

    {
    "id": 1,
    "meeting_day": "Wednesday",
    "meeting_time": "15:00",
    "meeting_location": "geelong",
    "abbreviation": "LA1-01",
    "campus_id": 2,
    "capacity": 45,
    "tutorial_stream_abbr": "wrkshop-2",
    "num_students": 6,
    "tutor_id": 2
    }

POST: Create a tutorial

POST /api/tutorials

  • URL: /api/tutorials

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    tutorial [unit_id]Id of the unitformDataintegerYes
    tutorial [tutor_id]Id of the tutorformDataintegerYes
    tutorial [campus_id]Id of the campusformDatainteger
    tutorial [capacity]Capacity of the tutorialformDataintegerYes
    tutorial[abbreviation]The tutorials codeformDatastringYes
    tutorial[meeting_location]The tutorials locationformDatastringYes
    tutorial[meeting_day]Day of the tutorialsformDatastringYes
    tutorial[meeting_time]Time of the tutorialsformDatastringYes
    tutorial[tutorial_stream_abbr]Abbreviation of the associated tutorial streamformDatastring
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 201 Created: Tutorial added successfully.

  • Example Request:

    Terminal window
    curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: 3DLo9xQoiKbXb7-ViNzJ' -d 'tutorial%5Bunit_id%5D=1&tutorial%5Btutor_id%5D=43&tutorial%5Bcapacity%5D=45&tutorial%5Babbreviation%5D=tut_test2&tutorial%5Bmeeting_location%5D=online&tutorial%5Bmeeting_day%5D=Tue&tutorial%5Bmeeting_time%5D=11%3A00' 'http://localhost:3000/api/tutorials'
  • Response body: Tutorial added successfully. ---- ### DELETE: Delete an enrolment in the tutorial DELETE /api/units/{unit_id}/tutorials/{tutorial_abbr}/enrolments/{project_id}

  • URL: /api/units/{unit_id}/tutorials/{tutorial_abbr}/enrolments/{project_id}

  • Method: DELETE

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    UsernameUsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    unit_idpathintegerYes
    tutorial_abbrpathintegerYes
    project_idpathintegerYes
  • Response: 204

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Accept: application/json' --header 'Username: atutor' --header 'Auth_Token: _RjGmj9uZ1yDNLJy-rLa' 'http://localhost:3000/api/units/1/tutorials/LA1-01/enrolments/1'
  • Response Body:

    true

POST: Enrol project in a tutorial

POST /api/units/{unit_id}/tutorials/{tutorial_abbr}/enrolments/{project_id}

  • URL: /api/units/{unit_id}/tutorials/{tutorial_abbr}/enrolments/{project_id}

  • Method: POST

  • Parameter:

    ParameterDescriptionParameter TypeData TypeMandatory
    UsernameUsernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    unit_idpathintegerYes
    tutorial_abbrpathintegerYes
    project_idpathintegerYes
  • Response: 201

  • Example Request:

    Terminal window
    curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Username: atutor' --header 'Auth_Token: _RjGmj9uZ1yDNLJy-rLa' 'http://localhost:3000/api/units/1/tutorials/LA1-01/enrolments/1'
  • Response Body:

    {
    "enrolments": [
    {
    "project_id": 1,
    "tutorial_id": 1
    }
    ]
    }