For Developers

Download File

GET https://ed.link/api/v2/my/classes/:class_id/files/:file_id/download

Download a specific File associated with a Class. The current user must have access to the file within the specified class for this call to succeed. This endpoint returns the raw file content as a stream.

Request Parameters

ParameterTypeDescription
class_idstringThe UUID of the desired Class.
file_idstringThe UUID of the desired File.

Sample Request

axios.get(`https://ed.link/api/v2/my/classes/${class_id}/files/${file_id}/download`, {
    headers: {
        authorization: `Bearer ${person_access_token}`
    },
    responseType: 'stream' // Important for handling file downloads
});

Response Data

On success, this endpoint returns a stream of the file's content. The Content-Type header will be set to the appropriate MIME type of the file (e.g., application/pdf, image/jpeg).

If an error occurs before the stream begins (e.g., file not found, permissions issue), the response will be text/json and contain an error in the standard format:

{
    "$request": "00000000-0000-0000-0000-000000000000",
    "$errors": [
        {
            "code": "NOT_FOUND",
            "message": "File with id 00000000-0000-0000-0000-000000000000 not found for this class or user."
        }
    ]
}
Microsoft and Google require drive access permissions that carry an elevated security level beyond what Edlink can accept. In order for our customers to use this endpoint on those providers, our customers have to create a custom "client" within the provider itself. With this "client" the necessary drive permissions can be requested, if our customer considers that level of security risk worthwhile. We have prepared a guide on how to do this for Google and for Microsoft.

Supported Providers

  • blackboard
  • brightspace
  • canvas
  • google
  • schoology