Skip to content

Doubtfire API

API: CSV

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

This “csv” API has the following operations.

  • GET /api/csv/users
  • POST /api/csv/users
  • GET /api/csv/units/{id}/tutor_assessments
  • GET /api/csv/units/{id}/task_completion
  • GET /api/csv/units/{id}
  • POST /api/csv/units/{id}
  • POST /api/csv/units/{id}/withdraw
  • GET /api/csv/task_definitions
  • POST /api/csv/task_definitions

GET: Download CSV of all users

GET /api/csv/users

  • URL: /api/csv/users

  • Method: GET

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response:

    • 200 OK: Download CSV of all users
  • Example Request

    Terminal window
    curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' 'http://localhost:3000/api/csv/users'
  • Response body:

    Download users


POST: Upload CSV of users

POST /api/csv/users

  • URL: /api/csv/users

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    fileCSV upload file.formDatafileYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response:

    • 201 OK: Upload CSV of users
  • Example Request

    Terminal window
    curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' -F file=@"Book2.xlsx" 'http://localhost:3000/api/csv/users'
  • Response body:

    {
    "success": [2],
    "ignored": [],
    "errors": []
    }

GET /api/csv/units/{id}/tutor_assessments

  • URL: /api/csv/units/{id}/tutor_assessments

  • Method: GET

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    idpathintegerYes
  • Response:

    • 200 OK: Download stats related to the number of tasks assessed by each tutor
  • Example Request

    Terminal window
    curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' 'http://localhost:3000/api/csv/units/1/tutor_assessments'
  • Response body:

    Download tutor assessments


GET: Download CSV of all student tasks in this unit

GET /api/csv/units/{id}/task_completion

  • URL: /api/csv/units/{id}/task_completion

  • Method: GET

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    idpathintegerYes
  • Response:

    • 200 OK: Download CSV of all students in this unit
  • Example Request

    Terminal window
    curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: B34P_wnsuosY1a2SXA3Q' 'http://localhost:3000/api/csv/units/1/task_completion'
  • Response body:

    Download task completion


GET: Download CSV of all students in this unit

GET /api/csv/units/{id}

  • URL: /api/csv/units/{id}

  • Method: GET

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    idpathintegerYes
  • Response:

    • 200 OK: Download CSV of all students in this unit
  • Example Request

    Terminal window
    curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' 'http://localhost:3000/api/csv/units/1'
  • Response body:

    Download1


POST: Upload CSV of all the students in a unit

POST /api/csv/units/{id}

  • URL: /api/csv/units/{id}

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    fileCSV upload file.formDatafileYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    idpathintegerYes
  • Response:

    • 201 OK: Upload CSV of all the students in a unit
  • Example Request

    Terminal window
    curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' -F file=@"Book2.xlsx" 'http://localhost:3000/api/csv/units/1'
  • Response body:

    {
    "success": [],
    "ignored": [],
    "errors": []
    }

POST: Upload CSV with the students to un-enrol from the unit

POST /api/csv/units/{id}/withdraw

  • URL: /api/csv/units/{id}/withdraw

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    fileCSV upload file.formDatafileYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
    idpathintegerYes
  • Response:

    • 201 OK: Upload CSV with the students to un-enrol from the unit
  • Example Request

    Terminal window
    curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: B34P_wnsuosY1a2SXA3Q' -F file=@"Book2.xlsx" 'http://localhost:3000/api/csv/units/1/withdraw'
  • Response body:

    {
    "success": [],
    "ignored": [],
    "errors": []
    }

GET: Download CSV of all task definitions for the given unit

GET /api/csv/task_definitions

  • URL: /api/csv/task_definitions

  • Method: GET

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idThe unit to download tasks fromqueryintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response:

    • 200 OK: Download CSV of all student tasks in this unit
  • Example Request

    Terminal window
    curl -X GET --header 'Accept: application/octet-stream' --header 'Username: aadmin' --header 'Auth_Token: orofzZ7rMY5ivQzat2Kv' 'http://localhost:3000/api/csv/units/1/task_completion'
  • Response body:

    Download task completion


POST: Upload CSV of task definitions to the provided unit

POST /api/csv/task_definitions

  • URL: /api/csv/task_definitions

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    fileCSV upload file.formDatafileYes
    unit_idThe unit to upload tasks toformDataintegerYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response:

    • 201 OK: Upload CSV with the students to un-enrol from the unit
  • Example Request

    Terminal window
    curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Username: aadmin' --header 'Auth_Token: B34P_wnsuosY1a2SXA3Q' -F file=@"Book2.xlsx" -F unit_id=1 'http://localhost:3000/api/csv/task_definitions'
  • Response body:

    {
    "success": [],
    "ignored": [],
    "errors": []
    }