Skip to content

Send CSV files

Compare
Choose a tag to compare
@exacs exacs released this 23 Aug 14:13
· 155 commits to master since this release

New function: CanvasClient.sendSis(endpoint, filePath, parameters)

Now, it is possible to send CSV files through the API by indicating the Canvas endpoint to send the file and the path of such file. Extra parameters can be sent as well. The request is going to be a POST with a content-type: multipart/form-data header.

Minor changes

New way of debugging. Deprecation of log parameter

  • New recommended way for getting detailed logs: set an environmental variable DEBUG=* or DEBUG=canvas-api. Passing log (function) as parameter in Canvas constructor is now deprecated.

Deprecations and more descriptive messages:

  • CanvasClient.requestUrl(endpoint, method) is deprecated for GET requests. Users should use .get(), .list() and .listPaginated(). For retro-compatibility reasons, the default value of parameter method is kept to GET even being this value the deprecated one.
  • CanvasClient.list(endpoint) throws more descriptive error if the endpoint doesn't return an array of items. Users should use get() for getting single resources instead of lists of them.

TypeScript and ECMAScript modules ready (experimental)

  • The package includes an ECMAScript module version of it under the path /esm ready to be imported. The same path includes types for its usage from TypeScript:

    import Canvas from '@kth/canvas-api/esm'

    Note that this feature is experimental and the path /esm can change in the future