/api/applications/ID/documents

HEAD, GET

Get a list of documents that have been attached to this application. The HEAD verb is useful if you only want to test if this application has any documents attached at all (and how many). Use the GET verb to get the listing of documents.

In order to retrieve the binary data of the document, you need to call /api/applications/ID/documents/ID. In the example below, you will need to call /api/applications/123/documents/222 to retrieve the first document as an image file.

Syntax

GET /api/applications/123/documents
Host: apply.example.edu
Authorization: DREAM apikey="..."

Response headers

Content-Type: application/json
Content-Length: 1234
X-Count: 15

Response example

{
  "222": {
    "id": 222,
    "uploaded": "2014-04-29T15:46:38+00:00",
    "name": "Passport",
    "mime": "image/jpeg",
    "size": "1966954"
  },
  "333": {
    "id": 333,
    "uploaded": "2014-04-29T15:46:38+00:00",
    "name": "Diploma",
    "mime": "image/jpeg",
    "size": "310178"
  }
}

POST

Initiate an upload process to add a new document to the application.

Please note that there is also a call to upload a document to a specific task: /api/applications/ID/tasks/ID/documents

The process is as follows:

  1. Client calls POST /api/application/123/documents
  2. API returns code 204 and an ingress URL on the Location header, such as `https://svcs-ingress.dreamapply.com/……..` that contains a JWT token, authorising the upload.
  3. Client pushes a file using a standard multipart request, for example like curl -v -F upload=@somefile.jpg https://svcs-ingress.dreamapply.com/……..
  4. The ingress service returns code 201 if the file was accepted.

The ingress URL is valid for 30 minutes to upload the file (or files - the URL can be used multiple times to upload multiple files within the 30 minute window). Up to 10MiB are allowed, and any of the usual MIME-s are allowed (same as in the UI). :!: The ingress URL should not be made public, but should be treated as secure material.

Syntax

POST /api/application/123/documents
Host: apply.example.edu
Authorization: DREAM apikey="..."

Response codes

204 No Content The ingress URL was returned in the Location header