Skip to content

Doubtfire API

API: Submission

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

This “submission” API has the following operations.

  • GET: /api/submission/assess
  • POST: /api/submission/assess
  • DELETE: /api/submission/project/{id}/portfolio
  • GET: /api/submission/project/{id}/portfolio
  • POST: /api/submission/project/{id}/portfolio

GET: Retrieve Submissions Ready to Mark

GET /api/submission/assess

  • URL: /api/submission/assess

  • Method: GET

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    unit_idUnit ID to retrieve submissions forqueryintegerYes
    user_idUser ID to retrieve submissions for (optional)queryintegerNo
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X GET --header 'Accept: application/json' --header 'Username: admin' --header 'Auth_Token: rrK8BdRfxof9RrJGuk5n' 'http://localhost:3000/api/submission/assess?unit_id=1&user_id=2'
  • Response Body: This endpoint returns a zip file containing the tasks ready for marking. The response does not have a JSON body.


POST: Upload Submission Documents

POST /api/submission/assess

  • URL: /api/submission/assess

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    fileBatch file uploadbodyfileYes
    unit_idUnit ID to upload marked submissions tobodyintegerYes
    user_idUser ID to upload marked submissions to (optional)bodyintegerNo
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 201

  • Example Request:

    Terminal window
    curl -X POST --header 'Content-Type: multipart/form-data' --header 'Username: admin' --header 'Auth_Token: rrK8BdRfxof9RrJGuk5n' -F 'file=@path_to_your_file' -F 'unit_id=1' -F 'user_id=2' 'http://localhost:3000/api/submission/assess'
  • Response Body:

    {
    "message": "Batch upload successful"
    }

POST: Upload Portfolio Document

POST /api/submission/project/{id}/portfolio

  • URL: /api/submission/project/{id}/portfolio

  • Method: POST

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    nameName of the part being uploadedbodystringYes
    kindThe kind of file being uploaded: document, code, or imagebodystringYes
    file0The file being uploadedbodyfileYes
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 201

  • Example Request:

    Terminal window
    curl -X POST --header 'Content-Type: multipart/form-data' --header 'Username: admin' --header 'Auth_Token: rrK8BdRfxof9RrJGuk5n' -F 'name=Part 1' -F 'kind=document' -F 'file0=@path_to_your_file' 'http://localhost:3000/api/submission/project/1/portfolio'
  • Response Body:

    {
    "file_name": "Part 1",
    "file_kind": "document",
    "file_path": "path_to_file"
    }

DELETE: Remove Portfolio Document

DELETE /api/submission/project/{id}/portfolio

  • URL: /api/submission/project/{id}/portfolio

  • Method: DELETE

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    idProject IDpathintegerYes
    idxThe index of the file (optional)queryintegerNo
    kindThe kind of file being removed: document, code, or image (optional)querystringNo
    nameName of file to remove (optional)querystringNo
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 204

  • Example Request:

    Terminal window
    curl -X DELETE --header 'Username: admin' --header 'Auth_Token: rrK8BdRfxof9RrJGuk5n' 'http://localhost:3000/api/submission/project/1/portfolio?idx=0&kind=document&name=Part 1'
  • Response Body: Portfolio deleted


GET: Retrieve Portfolio

GET /api/submission/project/{id}/portfolio

  • URL: /api/submission/project/{id}/portfolio

  • Method: GET

  • Parameters:

    ParameterDescriptionParameter TypeData TypeMandatory
    idProject IDpathintegerYes
    as_attachmentWhether or not to download file as attachment (optional)querybooleanNo
    UsernameUser usernameheaderstringYes
    Auth_TokenAuthentication tokenheaderstringYes
  • Response: 200 OK

  • Example Request:

    Terminal window
    curl -X GET --header 'Accept: application/json' --header 'Username: admin' --header 'Auth_Token: rrK8BdRfxof9RrJGuk5n' 'http://localhost:3000/api/submission/project/1/portfolio?as_attachment=true'
  • Response Body: This endpoint returns a PDF file of the portfolio. The response does not have a JSON body.