Canvas LMS API 之 小组预约交互

admin 发表了文章 • 0 个评论 • 851 次浏览 • 2018-01-08 23:40 • 来自相关话题

1,更新预约PUT /api/v1/appointment_groups/:id参数:Parameter ...查看全部

1,更新预约

PUT /api/v1/appointment_groups/:id

参数:


Parameter
TypeDesc
appointment_group[context_codes][]Requiredstring

这里一般是课程的数组,也有可能是小组的

appointment_group[sub_context_codes][]
string

一些sections

appointment_group[ti
string

Short ti

appointment_group[desc
string

Longer text desc

appointment_group[location_name]
string

Location name of the appointment group.

appointment_group[location_address]
string

Location address.

appointment_group[publish]
boolean

是否发布,一旦发布了就不能取消发布了,谨慎. Defaults to false.

appointment_group[participants_per_appointment]
integer

每一个时间点的参与数量

appointment_group[min_appointments_per_participant]
integer

最少一个时间段有几个人预约才可以生效

appointment_group[max_appointments_per_participant]
integer

最多多少人预约

appointment_group[new_appointments][X][]
string

Nested array of start time/end time pairs indicating time slots for this appointment group. Refer to the example request.

appointment_group[participant_visibility]
string
  • “private”

  • participants cannot see who has signed up for a particular time slot

  • “protected”

  • participants can see who has signed up. Defaults to “private”.

Allowed values:private, protected

请求示例:

curl 'https://

     -X PUT \

     -F 'appointment_group[publish]=1' \

     -H "Authorization: Bearer


删除一个预约组:

DELETE /api/v1/appointment_groups/:id

上面这个可以带上一个 cancel_reason的参数

请求示例:

curl 'https://

     -X DELETE \

     -F 'cancel_reason=El Tigre Chino got fired' \

     -H "Authorization: Bearer



列出某一个组里面的参与者:

GET /api/v1/appointment_groups/:id/users

参数:

Parameter
TypeDesc
registration_status
string

Limits results to the a given participation status, defaults to “all”

Allowed values:all, registered, registered

列出这些组的参与者信息:

GET /api/v1/appointment_groups/:id/groups

参数:

Parameter
TypeDesc
registration_status
string

Limits results to the a given participation status, defaults to “all”

Allowed values:all, registered, registered

列出下一个预约时间段:

GET /api/v1/appointment_groups/next_appointment

参数:

Parameter
TypeDesc
appointment_group_ids[]
string

List of ids of appointment groups to search.


Canvas LMS API 之 小组预约

admin 发表了文章 • 0 个评论 • 760 次浏览 • 2018-01-08 00:56 • 来自相关话题

这个模块的作用举例:1,我明天有空,可以开放给学生预约我的时间,每个学生半个小时,大家自由预定时间。2,我下午有空,开放给学生预约聊天,学生可以自由约我,但是同一时间段只能最多有5个人。这个工具就是干这个的! ...查看全部

这个模块的作用举例:

1,我明天有空,可以开放给学生预约我的时间,每个学生半个小时,大家自由预定时间。

2,我下午有空,开放给学生预约聊天,学生可以自由约我,但是同一时间段只能最多有5个人。

这个工具就是干这个的!


这个API一般跟会议室预约系统,或者你们自己的日历表系统对接。


一个约会的对象如下:

// Date and time for an appointment{
  // The appointment identifier.
  "id": 987,
  // Start time for the appointment
  "start_at": "2012-07-20T15:00:00-06:00",
  // End time for the appointment
  "end_at": "2012-07-20T15:00:00-06:00"}

一组约会的对象如下:

{
  // The ID of the appointment group
  "id": 543,
  // The title of the appointment group
  "title": "Final Presentation",
  // The start of the first time slot in the appointment group
  "start_at": "2012-07-20T15:00:00-06:00",
  // The end of the last time slot in the appointment group
  "end_at": "2012-07-20T17:00:00-06:00",
  // The text description of the appointment group
  "description": "Es muy importante",
  // The location name of the appointment group
  "location_name": "El Tigre Chino's office",
  // The address of the appointment group's location
  "location_address": "Room 234",
  // The number of participant who have reserved slots (see include[] argument)
  "participant_count": 2,
  // The start and end times of slots reserved by the current user as well as the id
  // of the calendar event for the reservation (see include[] argument)
  "reserved_times": [{"id":987,"start_at":"2012-07-20T15:00:00-06:00","end_at":"2012-07-20T15:00:00-06:00"}],
  // The context codes (i.e. courses) this appointment group belongs to. Only people
  // in these courses will be eligible to sign up.
  "context_codes": ["course_123"],
  // The sub-context codes (i.e. course sections and group categories) this
  // appointment group is restricted to
  "sub_context_codes": [course_section_234],
  // Current state of the appointment group ('pending', 'active' or 'deleted').
  // 'pending' indicates that it has not been published yet and is invisible to
  // participants.
  "workflow_state": "active",
  // Boolean indicating whether the current user needs to sign up for this
  // appointment group (i.e. it's reservable and the min_appointments_per_participant
  // limit has not been met by this user).
  "requiring_action": true,
  // Number of time slots in this appointment group
  "appointments_count": 2,
  // Calendar Events representing the time slots (see include[] argument) Refer to
  // the Calendar Events API for more information
  "appointments": [],
  // Newly created time slots (same format as appointments above). Only returned in
  // Create/Update responses where new time slots have been added
  "new_appointments": [],
  // Maximum number of time slots a user may register for, or null if no limit
  "max_appointments_per_participant": 1,
  // Minimum number of time slots a user must register for. If not set, users do not
  // need to sign up for any time slots
  "min_appointments_per_participant": 1,
  // Maximum number of participants that may register for each time slot, or null if
  // no limit
  "participants_per_appointment": 1,
  // 'private' means participants cannot see who has signed up for a particular time
  // slot, 'protected' means that they can
  "participant_visibility": "private",
  // Indicates how participants sign up for the appointment group, either as
  // individuals ('User') or in student groups ('Group'). Related to
  // sub_context_codes (i.e. 'Group' signups always have a single group category)
  "participant_type": "User",
  // URL for this appointment group (to update, delete, etc.)
  "url": "https://example.com/api/v1/appointment_groups/543",
  // URL for a user to view this appointment group
  "html_url": "http://example.com/appointment_groups/1",
  // When the appointment group was created
  "created_at": "2012-07-13T10:55:20-06:00",
  // When the appointment group was last updated
  "updated_at": "2012-07-13T10:55:20-06:00"}


列出一个预约组:

GET /api/v1/appointment_groups


参数
类型描述
范围

默认为“可预留”

允许值: reservablemanageable

context_codes []

用于限制返回结果的上下文代码数组。

include_past_appointments
布尔

默认为false。如果属实,则包括过去的预约组

包括[]

包含其他信息的数组。

  • “约会”

  • 此约会组的日历事件时段

  • “child_events”

  • 这些时间段的保留

  • “PARTICIPANT_COUNT”

  • 预订数量

  • “reserved_times”

  • 事件ID,当前用户预约的开始时间和结束时间)

  • “all_context_codes”

  • 所有与该约会组相关联的上下文代码

允许值: appointmentschild_eventsparticipant_countreserved_timesall_context_codes


获取一个预约组:

GET /api/v1/appointment_groups/:id

参数:

Parameter
TypeDesc
include[]
string

Array of additional information to include. See include[] argument of “List
appointment groups” action.

  • “child_events”

  • reservations of time slots time slots

  • “appointments”

  • will always be returned

  • “all_context_codes”

  • all context codes associated with this appointment group

Allowed values: child_eventsappointmentsall_context_codes


Canvas LMS API 之 通知

admin 发表了文章 • 0 个评论 • 659 次浏览 • 2018-01-04 16:47 • 来自相关话题

这个API是用来get的,么有创建、删除这样的功能,你可以去看看讨论主题的那些API,都是相互适用的。列出通知:GET /api/v1/announcements参 ...查看全部

这个API是用来get的,么有创建、删除这样的功能,你可以去看看讨论主题的那些API,都是相互适用的。


列出通知:

GET /api/v1/announcements


参数:

Parameter
TypeDesc
context_codes[]Requiredstring

List of context_codes to retrieve announcements for (for example,course_123). 

只支持课程,如果用户对这个课程么权限,那调用是失败的

start_date
Date

默认14天,

可以自定义,

格式: yyyy-mm-dd or ISO 8601
YYYY-MM-DDTHH:MM:SSZ.

end_date
Date

默认28天,

可以自定义: yyyy-mm-dd or
ISO 8601 YYYY-MM-DDTHH:MM:SSZ. 

还没生效的课程通知只有管理员才可以看得到

active_only
boolean

Only return active announcements that have been published. 

Applies only to
requesting users that have permission to view unpublished items. 

Defaults
to false for users with access to view unpublished items, 

otherwise true
and unmodifiable.

请求示例:

curl https:///api/v1/announcements?context_codes[]=course_1&context_codes[]=course_2      -H 'Authorization: Bearer'


返回数据示例:

[{
  "id": 1,
  "title": "Hear ye",
  "message": "Henceforth, all assignments must be...",
  "posted_at": "2017-01-31T22:00:00Z",
  "delayed_post_at": null,
  "context_code": "course_2",
  ...}]


Canvas LMS API 之 声明外部订阅相关信息

admin 发表了文章 • 0 个评论 • 677 次浏览 • 2018-01-02 13:10 • 来自相关话题

这个用到的也不多,就是说可以自动生成RSS,可以是课程内容或者群组内容,用户自行订阅RSS对象模型如下:{   // Feed ID    ...查看全部

这个用到的也不多,就是说可以自动生成RSS,可以是课程内容或者群组内容,用户自行订阅

RSS对象模型如下:

{
  // Feed ID
  "id": 5,
  // feed名字,如果没填写,那会有个默认的
  "display_name": "My Blog",
  // The HTTP/HTTPS URL to the feed
  "url": "http://example.com/myblog.rss",
  // If not null, only feed entries whose title contains this string will trigger new
  // posts in Canvas
  "header_match": "pattern",
  // When this external feed was added to Canvas
  "created_at": "2012-06-01T00:00:00-06:00",
  // The verbosity setting determines how much of the feed's content is imported into
  // Canvas as part of the posting. 'link_only' means that only the title and a link
  // to the item. 'truncate' means that a summary of the first portion of the item
  // body will be used. 'full' means that the full item body will be used.  "verbosity": "truncate"}

列出外部课程订阅:

GET /api/v1/courses/:course_id/external_feeds

列出外部群组订阅:

GET /api/v1/groups/:group_id/external_feeds


请求示例:

curl https://<canvas>/api/v1/courses/<course_id>/external_feeds      -H 'Authorization: Bearer'

创建一个外部课程订阅:

POST /api/v1/courses/:course_id/external_feeds

创建一个外部群组订阅:

POST /api/v1/groups/:group_id/external_feeds

参数:

url,必须的,就是外部的RSS地址

header_match,可选的

verbosity,默认是full,可选:full,truncate,li

示例请求:

curl https://<canvas>/api/v1/courses/<course_id>/external_feeds     -F url='http://example.com/rss.xml'     -F header_match='news flash!'     -F verbosity='full'     -H 'Authorization: Bearer'

删除:

DELETE /api/v1/courses/:course_id/external_feeds/:external_feed_id


DELETE /api/v1/groups/:group_id/external_feeds/:external_feed_id


示例请求:

curl -X DELETE https://<canvas>/api/v1/courses/<course_id>/external_feeds/<feed_id>      -H 'Authorization: Bearer'


Canvas LMS API 之课程级分析模块

admin 发表了文章 • 0 个评论 • 825 次浏览 • 2017-12-31 19:33 • 来自相关话题

1,获取课程的参与者数量和点击数GET /api/v1/courses/:course_id/analytics/activity上面这个会按天返回历史数据,一个庞大的数组请 ...查看全部

1,获取课程的参与者数量和点击数

GET /api/v1/courses/:course_id/analytics/activity

上面这个会按天返回历史数据,一个庞大的数组


请求示例:

curl https://<canvas>/api/v1/courses/<course_id>/analytics/activity \    -H 'Authorization: Bearer'


数据返回示例:

[
  { 
    "date": "2012-01-24",
    "participations": 3,
    "views": 10
  }]


2,获取课程的作业分析

这个有点像是API直接获取课程的作业,数据上是差不多的,只不过精简了一些

可能是因为这个数量上回很大,所以这个查询上面会提供一个 async的boolean参数选项,如果是true,则异步获取,可能会造成获取不到,再次获取的时候就可能获取到了,毕竟要给服务器一个任务时间。如果之前就获取过,再次 获取的话得到的结果可能是上次的。

请求示例:

curl https://<canvas>/api/v1/courses/<course_id>/analytics/assignments \    -H 'Authorization: Bearer'

数据返回示例:

[
  {
    "assignment_id": 1234,
    "title": "Assignment 1",
    "points_possible": 10,
    "due_at": "2012-01-25T22:00:00-07:00",
    "unlock_at": "2012-01-20T22:00:00-07:00",
    "muted": false,
    "min_score": 2,
    "max_score": 10,
    "median": 7,
    "first_quartile": 4,
    "third_quartile": 8,
    "tardiness_breakdown": {
      "on_time": 0.75,
      "missing": 0.1,
      "late": 0.15
    }
  },
  {
    "assignment_id": 1235,
    "title": "Assignment 2",
    "points_possible": 15,
    "due_at": "2012-01-26T22:00:00-07:00",
    "unlock_at": null,
    "muted": true,
    "min_score": 8,
    "max_score": 8,
    "median": 8,
    "first_quartile": 8,
    "third_quartile": 8,
    "tardiness_breakdown": {
      "on_time": 0.65,
      "missing": 0.12,
      "late": 0.23
      "total": 275
    }
  }]


3,获取课程中某个用户的汇总数据

GET /api/v1/courses/:course_id/analytics/student_summaries

有两个参数:

sort_column,

支持的值有:name, name_descending, score, score_descending, participations, participations_descending, page_views, page_views_descending,默认是name排序

student_id,

如果设置了学生的id,那就会只返回这个学生的(不是SIS ID哦)


请求示例:

curl https://<canvas>/api/v1/courses/<course_id>/analytics/student_summaries \    -H 'Authorization: Bearer'


数据返回示例:

[
  {
    "id": 2346,
    "page_views": 351,
    "page_views_level": "1"
    "max_page_view": 415,
    "participations": 1,
    "participations_level": "3",
    "max_participations": 10,
    "tardiness_breakdown": {
      "total": 5,
      "on_time": 3,
      "late": 0,
      "missing": 2,
      "floating": 0
    }
  },
  {
    "id": 2345,
    "page_views": 124,
    "participations": 15,
    "tardiness_breakdown": {
      "total": 5,
      "on_time": 1,
      "late": 2,
      "missing": 3,
      "floating": 0
    }
  }]


Canvas LMS API 之 院校级分析模块

admin 发表了文章 • 0 个评论 • 731 次浏览 • 2017-12-31 19:14 • 来自相关话题

1,获取院校级别的相关数据GET /api/v1/accounts/:account_id/analytics/terms/:term_id/activity上面这个是显示某个学期的所有活动课程的分析 ...查看全部

1,获取院校级别的相关数据

GET /api/v1/accounts/:account_id/analytics/terms/:term_id/activity

上面这个是显示某个学期的所有活动课程的分析

GET /api/v1/accounts/:account_id/analytics/current/activity

上面这个是显示当前学期活动课程的所有分析

GET /api/v1/accounts/:account_id/analytics/completed/activity

上面这个是显示当前学期已经结束的课程的分析

提示:删除的或者还没有发布的课程不会在分析之列


请求示例:

curl https://<canvas>/api/v1/accounts/<account_id>/analytics/current/activity     -H 'Authorization: Bearercurl https://<canvas>/api/v1/accounts/<account_id>/analytics/completed/activity     -H 'Authorization: Bearercurl https://<canvas>/api/v1/accounts/<account_id>/analytics/terms/<term_id>/activity     -H 'Authorization: Bearer

返回数据示例:

{
  "by_date": {
    "2012-01-24": 1240,
    "2012-01-27": 912,
  },
  "by_category": {
    "announcements": 54,
    "assignments": 256,
    "collaborations": 18,
    "conferences": 26,
    "discussions": 354,
    "files": 132,
    "general": 59,
    "grades": 177,
    "groups": 132,
    "modules": 71,
    "other": 412,
    "pages": 105,
    "quizzes": 356
  },}


2,获取院校级成绩分析

GET /api/v1/accounts/:account_id/analytics/terms/:term_id/grades

GET /api/v1/accounts/:account_id/analytics/current/grades

GET /api/v1/accounts/:account_id/analytics/completed/grades

提示:一个学生在一个课程中只会返回一条数据

请求示例:
curl https://<canvas>/api/v1/accounts/<account_id>/analytics/current/grades -H 'Authorization: Bearer

curl https://<canvas>/api/v1/accounts/<account_id>/analytics/completed/grades -H 'Authorization: Bearer

curl https://<canvas>/api/v1/accounts/<account_id>/analytics/terms/<term_id>/grades -H 'Authorization: Bearer

返回数据示例:

{
  "0": 95,
  "1": 1,
  "2": 0,
  "3": 0,
  ...
  "93": 125,
  "94": 110,
  "95": 142,
  "96": 157,
  "97": 116,
  "98": 85,
  "99": 63,
  "100": 190}


3,获取院校级统计

GET /api/v1/accounts/:account_id/analytics/terms/:term_id/statistics


GET /api/v1/accounts/:account_id/analytics/current/statistics


GET /api/v1/accounts/:account_id/analytics/completed/statistics


请求示例:

curl https://<canvas>/api/v1/accounts/<account_id>/analytics/current/statistics     -H 'Authorization: Bearercurl https://<canvas>/api/v1/accounts/<account_id>/analytics/completed/statistics     -H 'Authorization: Bearercurl https://<canvas>/api/v1/accounts/<account_id>/analytics/terms/<term_id>/statistics     -H 'Authorization: Bearer

返回数据示例:

{
  "courses": 27,
  "subaccounts": 3,
  "teachers": 36,
  "students": 418,
  "discussion_topics": 77,
  "media_objects": 219,
  "attachments": 1268,
  "assignments": 290,}


Canvas LMS API 之管理员

admin 发表了文章 • 0 个评论 • 699 次浏览 • 2017-12-16 17:44 • 来自相关话题

获取一个管理员的相关信息{   // 管理员的 canvas ID   "id": 1023, &n ...查看全部

获取一个管理员的相关信息

{
  // 管理员的 canvas ID
  "id": 1023,
  // 账号的权限,可以是管理员在canvas系统里面自定义的权限
  "role": "AccountAdmin",
  // 这个最好是去看users的那个API.
  "user": null,
  // 账号的状态.
  "workflow_state": "deleted"}

创建一个管理员

POST /api/v1/accounts/:account_id/admins


参数:

Parameter
TypeDesc
user_idRequiredinteger

The id of the user to promote.

role
string

(deprecated) The user's admin relationship with the account will be
created with the given role. Defaults to 'AccountAdmin'.

role_id
integer

The user's admin relationship with the account will be created with the
given role. Defaults to the built-in role for 'AccountAdmin'.

send_confirmation
boolean

Send a notification email to the new admin if true. Default is true.


从一个账户里删除一个管理员:不是把管理员的账号都删掉,就是把管理员权限给去了而已

DELETE /api/v1/accounts/:account_id/admins/:user_id


参数:


Parameter
TypeDesc
role
string

(Deprecated) Account role to remove from the user. Defaults to
'AccountAdmin'. Any other account role must be specified
explicitly.

role_id
integer

The user's admin relationship with the account will be created with the
given role. Defaults to the built-in role for 'AccountAdmin'.



列出某个账户下的所有管理员:

GET /api/v1/accounts/:account_id/admins


Parameter
TypeDesc
user_id[]
[Integer]

Scope the results to those with user IDs equal to any of the IDs specified
here.

Canvas LMS API 之 账户

admin 发表了文章 • 0 个评论 • 842 次浏览 • 2017-12-15 00:29 • 来自相关话题

账户:就是你创建canvas时候的那个学校,并不是你的管理员账户的字段示意:{   // 账户ID   "id&q ...查看全部

账户:就是你创建canvas时候的那个学校,并不是你的管理员


账户的字段示意:

{
  // 账户ID
  "id": 2,
  // 账户显示名字
  "name": "Canvas Account",
  // The UUID of the account
  "uuid": "WvAHhY5FINzq5IyRIJybGeiXyFkG3SqHUPb7jZY5",
  // 父级账户,根账户的父级账户是0
  "parent_account_id": 1,
  // 根账户ID,如果是根账户的话,就是Null了
  "root_account_id": 1,
  // 默认存储容量
  "default_storage_quota_mb": 500,
  // 默认用户存储容量
  "default_user_storage_quota_mb": 50,
  // 默认群组存储容量
  "default_group_storage_quota_mb": 50,
  // 默认时区
  "default_time_zone": "America/Denver",
  // 账户的SIS ID
  "sis_account_id": "123xyz",
  // 整合ID,不知道干什么玩意的
  "integration_id": "123xyz",
  // 如果这个账户可以管理SIS,并是被导入的,则会有这个ID
  "sis_import_id": 12,
  // The account's identifier that is sent as context_id in LTI launches.
  "lti_guid": "123xyz",
  // 账户状态. Can be 'active' or 'deleted'.
  "workflow_state": "active"}

列出账户:

GET /api/v1/accounts

参数:


获取课程的管理员账户:

GET /api/v1/course_accounts


获取一个账户信息:

GET /api/v1/accounts/:id


获取一个账户的子账户:

GET /api/v1/accounts/:account_id/sub_accounts


获取参数:


获取某个账户下的所有课程:

GET /api/v1/accounts/:account_id/courses


参数:

Parameter
TypeDesc
with_enrollments
boolean

If true, include only courses with at least one enrollment. If false, include only courses with no enrollments. If not present, do not filter on course enrollment status.

enrollment_type[]
string

If set, only return courses that have at least one user enrolled in in the course with one of the specified enrollment types.

Allowed values:teacher, student, ta, observer, designer

published
boolean

If true, include only published courses. If false, exclude published courses. If not present, do not filter on published status.

completed
boolean

If true, include only completed courses (these may be in state 'completed', or their enrollment term may have ended). If false, exclude completed courses. If not present, do not filter on completed status.

blueprint
boolean

If true, include only blueprint courses. If false, exclude them. If not present, do not filter on this basis.

blueprint_associated
boolean

If true, include only courses that inherit content from a blueprint course. If false, exclude them. If not present, do not filter on this basis.

by_teachers[]
integer

List of User IDs of teachers; if supplied, include only courses taught by one of the referenced users.

by_subaccounts[]
integer

List of Account IDs; if supplied, include only courses associated with one of the referenced subaccounts.

hide_enrollmentless_courses
boolean

If present, only return courses that have at least one enrollment. Equivalent to 'with_enrollments=true'; retained for compatibility.

state[]
string

If set, only return courses that are in the given state(s). By default, all states but “deleted” are returned.

Allowed values:created, claimed, available, completed, deleted, all

enrollment_term_id
integer

If set, only includes courses from the specified term.

search_term
string

The partial course name, code, or full ID to match and return in the results list. Must be at least 3 characters.

include[]
string
  • All explanations can be seen in the <a href="https://lms.famousedu.com/doc/api/courses.html#method.courses.index" ti

  • “sections”, “needs_grading_count” and “total_scores” are not valid options at the account level

Allowed values:syllabus_body, term, course_progress, storage_quota_used_mb, total_students, teachers

sort
string

The column to sort results by.

Allowed values:course_name, sis_course_id, teacher, subaccount, enrollments

order
string

The order to sort the given column by.

Allowed values:asc, desc

search_by
string

The filter to search by. “course” searches for course names, course codes, and SIS IDs. “teacher” searches for teacher names

Allowed values:course, teacher



更新账户信息:

PUT /api/v1/accounts/:id

参数:

Parameter
TypeDesc
account[name]
string

Updates the account name

account[sis_account_id]
string

Updates the account sis_account_id Must have manage_sis permission and must not be a root_account.

account[default_time_zone]
string

The default time zone of the account. Allowed time zones are <a href="http://www.iana.org/time-zones" target="_parent" ti

account[default_storage_quota_mb]
integer

The default course storage quota to be used, if not otherwise specified.

account[default_user_storage_quota_mb]
integer

The default user storage quota to be used, if not otherwise specified.

account[default_group_storage_quota_mb]
integer

The default group storage quota to be used, if not otherwise specified.

account[settings][restrict_student_past_view][value]
boolean

Restrict students from viewing courses after end date

account[settings][restrict_student_past_view][locked]
boolean

Lock this setting for sub-accounts and courses

account[settings][restrict_student_future_view][value]
boolean

Restrict students from viewing courses before start date

account[settings][restrict_student_future_view][locked]
boolean

Lock this setting for sub-accounts and courses

account[settings][lock_all_announcements][value]
boolean

Disable comments on announcements

account[settings][lock_all_announcements][locked]
boolean

Lock this setting for sub-accounts and courses

account[settings][restrict_student_future_listing][value]
boolean

Restrict students from viewing future enrollments in course list

account[settings][restrict_student_future_listing][locked]
boolean

Lock this setting for sub-accounts and courses

account[services]
Hash

Give this a set of keys and boolean values to enable or disable services matching the keys


请求示例:

curl https://

  -X PUT \

  -H 'Authorization: Bearer

  -d 'account[name]=New account name' \

  -d 'account[default_time_zone]=Mountain Time (US & Canada)' \

  -d 'account[default_storage_quota_mb]=450'


从某个账户里删除一个用户:

DELETE /api/v1/accounts/:account_id/users/:user_id

请求示例:

curl https://

  -H 'Authorization: Bearer

  -X DELETE


创建子账户:

POST /api/v1/accounts/:account_id/sub_accounts


参数:


Canvas LMS API 之 账户报告报表

admin 发表了文章 • 0 个评论 • 700 次浏览 • 2017-12-13 14:18 • 来自相关话题

报告报表的格式如下:{   // 报表的ID   "id": 1,   // 报表的类型 ...查看全部

报告报表的格式如下:

{
  // 报表的ID
  "id": 1,
  // 报表的类型
  "report": "sis_export_csv",
  // 报表下载地址
  "file_url": "https://example.com/some/path",
  "attachment": null,
  // 状态
  "status": "complete",
  // 参数
  "parameters": {"course_id":2,"start_at":"2012-07-13T10:55:20-06:00","end_at":"2012-07-13T10:55:20-06:00"},
  // 进程ID
  "progress": 100,
  // 报表条目数量
  "current_line": 12000}

参数如下:

// 学期的ID
  "enrollment_term_id": 2,
  // 删除的是否包含
  "include_deleted": false,
  // 课程的ID
  "course_id": 2,
  // 按什么排序: 'users', 'courses', 'outcomes'.
  "order": "users",
  // 获取用户的信息
  "users": false,
  // 账户信息
  "accounts": false,
  // 学期信息
  "terms": false,
  // 课程信息
  "courses": false,
  // 班级信息
  "sections": false,
  // 课程参与者的信息
  "enrollments": false,
  // 群组
  "groups": false,
  // 获取交叉班级的信息
  "xlist": false,
  "sis_terms_csv": 1,
  "sis_accounts_csv": 1,
  // 是否包含参与者的状态. Defaults to false
  "include_enrollment_state": false,
  // 包含参与者的状态: ['active'| 'invited'|'creation_pending'| 'deleted'| 'rejected'| 'completed'| 'inactive'| 'all']
  "enrollment_state": ["all"],
  // 什么时间开始,一般最大两周
  "start_at": "2012-07-13T10:55:20-06:00",
  // 什么时间结束,一般最大2周.
  "end_at": "2012-07-13T10:55:20-06:00"}


列出可以导出的报告报表,自己带上参数

GET /api/v1/accounts/:account_id/reports

请求示例:

curl -H 'Authorization: Bearer' 
     https://<canvas>/api/v1/accounts/<account_id>/reports/

返回值示例:

[
  {
    "report":"student_assignment_outcome_map_csv",
    "title":"Student Competency",
    "parameters":null
  },
  {
    "report":"grade_export_csv",
    "title":"Grade Export",
    "parameters":{
      "term":{
        "description":"The canvas id of the term to get grades from",
        "required":true
      }
    }
  }]


开始生成一个报表,自己带参数:

POST /api/v1/accounts/:account_id/reports/:report


列出现在可以下载的报表:

GET /api/v1/accounts/:account_id/reports/:report


请求示例:

curl -H 'Authorization: Bearer' 
     https://<canvas>/api/v1/accounts/<account_id>/reports/<report_type>


查看一个报表的状态:

GET /api/v1/accounts/:account_id/reports/:report/:id

示例:

curl -H 'Authorization: Bearer' 
     https://<canvas>/api/v1/accounts/<account_id>/reports/<report_type>/<report_id>


删除某个报表:

DELETE /api/v1/accounts/:account_id/reports/:report/:id

请求示例:

curl -H 'Authorization: Bearer'      -X DELETE 
     https://<canvas>/api/v1/accounts/<account_id>/reports/<report_type>/<id>


Canvas LMS API 之创建更新全局通告

admin 发表了文章 • 0 个评论 • 691 次浏览 • 2017-12-12 16:06 • 来自相关话题

创建:POST /api/v1/accounts/:account_id/account_notifications参数: ...查看全部

创建:


POST /api/v1/accounts/:account_id/account_notifications

参数:


示例:

curl -X POST -H 'Authorization: Bearer

https://

-d 'account_notification[subject]=New notification'

-d 'account_notification[start_at]=2014-01-01T00:00:00Z'

-d 'account_notification[end_at]=2014-02-01T00:00:00Z'

-d 'account_notification[message]=This is a global notification'


返回的结果:

{

  "subject": "New notification",

  "start_at": "2014-01-01T00:00:00Z",

  "end_at": "2014-02-01T00:00:00Z",

  "message": "This is a global notification"

}


更新一个全局通告:

PUT /api/v1/accounts/:account_id/account_notifications/:id

参数:


示例:

curl -X PUT -H 'Authorization: Bearer

https://

-d 'account_notification[subject]=New notification' \

-d 'account_notification[start_at]=2014-01-01T00:00:00Z' \

-d 'account_notification[end_at]=2014-02-01T00:00:00Z' \

-d 'account_notification[message]=This is a global notification'


返回的结果:

{
  "subject": "New notification",
  "start_at": "2014-01-01T00:00:00Z",
  "end_at": "2014-02-01T00:00:00Z",
  "message": "This is a global notification"}