# kth-canvas-api

> Functions for communicating with Canvas LMS

Latest version **0.15.7** (published 2018-11-08) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install kth-canvas-api
pnpm add kth-canvas-api
yarn add kth-canvas-api
bun add kth-canvas-api
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.15.7 |
| Published | 2018-11-08 |
| First published | 2017-01-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Author | emilsten@kth.se |
| Maintainers | delodax, exacs, hoyce, jhsware, jonlarsson, jonolov, kthwebmaster, patricjansson, pontusn, vikatt, wkchung |

## Links

- npm: https://www.npmjs.com/package/kth-canvas-api
- Repository: https://github.com/kth/canvas-api
- Homepage: https://github.com/kth/canvas-api#readme
- Issues: https://github.com/kth/canvas-api/issues
- npm.io page: https://npm.io/package/kth-canvas-api

## Dependencies (3)

- [request](https://npm.io/package/request.md) ^2.88.0
- [kth-console-log](https://npm.io/package/kth-console-log.md) 1.x
- [request-promise](https://npm.io/package/request-promise.md) ^4.2.2

## Recent versions

- 0.15.7 (latest) — 2018-11-08
- 0.15.6 — 2018-10-22
- 0.15.5 — 2018-04-25
- 0.15.4 — 2018-03-23
- 0.15.3 — 2018-03-16
- 0.15.2 — 2018-01-10
- 0.15.1 — 2018-01-10
- 0.15.0 — 2018-01-09
- 0.14.0 — 2018-01-08
- 0.13.0 — 2018-01-08
- 0.12.2 — 2018-01-03
- 0.12.1 — 2018-01-03
- 0.12.0 — 2018-01-03
- 0.11.0 — 2017-08-11
- 0.10.1 — 2017-08-04
- … 12 more at https://npm.io/package/kth-canvas-api/versions

## README

# This library is used to integrate with the Canvas LMS.

## How to use
You need an instance of Canvas LMS to communicate with.
Log in to that instance and generate an access token (As of this writing under Account/Settings/Approved integrations in Canvas). Store the newly generated access token:
```
const accessToken = '123123123123123123123123123123'
```
Then create a variable containing the url to the Canvas api.
```
const apiUrl = 'https://xxx.test.instructure.com/api/v1'
```
Now, instantiate CanvasApi with these two variables:
```
const CanvasApi = require('canvas-api')

const canvasApi = new CanvasApi(apiUrl, accessToken)
```

## Example functions
### List all accounts
```
canvasApi.listAccounts()
.then(accounts => console.log(JSON.stringify(accounts, null,4)))
```
### List all courses
```
canvasApi.listCourses()
.then(courses => console.log(JSON.stringify(courses, null,4)))
```

### List all users
```
canvasApi.listUsers()
.then(courses => console.log(JSON.stringify(courses, null,4)))
```

---
_Source: https://npm.io/package/kth-canvas-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
