如何与 Moodle REST API 交互

问题描述 投票:0回答:2

所以我想像moodleApp一样使用flutter构建移动应用程序,这样应用程序只需从现有的moodle web获取api, 那么moodle是否提供API可以免费使用呢?还是其他方式?

moodle
2个回答
9
投票

是的。 Moodle提供API

https://docs.moodle.org/dev/Core_APIs

https://docs.moodle.org/dev/Web_service_API_functions

https://docs.moodle.org/dev/Creating_a_web_service_client

Example : https://example.com/moodle/webservice/rest/server.php?wstoken=...&wsfunction=...&moodlewsrestformat=json

0
投票

要启用 Moodle 作为 API(此处称为

Web-Services
)并创建端点以发出 外部 HTTP 请求,您需要执行以下步骤:

  1. 启用网络服务支持
    /admin/settings.php?section=optionalsubsystems#admin-enablewebservices
  2. 启用 REST 协议
    /admin/settings.php?section=webserviceprotocols
  3. 创建您的网络服务
    /admin/webservice/service.php?id=0
  4. 为您的 WS 创建令牌
    /admin/webservice/tokens.php?action=create
  5. 在服务列表中
    /admin/settings.php?section=externalservices
    将外部功能添加到您的 WS(单击 WS 旁边的
    Functions
    )。在这里您可以添加核心外部函数,也可以使用您的插件创建自己的函数
  6. 阅读文档如何使用令牌函数协议创建端点并将针参数传递给它。

Moodle Web 服务插件

Moodle

API/Web-Service
是一个涉及很多事情的大问题,要从一个地方控制和轻松管理它有一个本地插件WSManager

© www.soinside.com 2019 - 2024. All rights reserved.