jeontwikkeling-nl / ltisaas_client_api_php
<p>API版本简要概述:</p> <ul> <li><strong>v0:</strong> 此版本仅用于测试,不与数据库交互,也不涉及任何验证。它仅提供模拟数据。</li> <li><strong>v1:</strong> 这是LtiSaas API的官方版本,旨在用于生产。</li>
V1.0.35
2023-11-07 14:38 UTC
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
README
API版本简要概述
- v0: 此版本仅用于测试,不与数据库交互,也不涉及任何验证。它仅提供模拟数据。
- v1: 这是LtiSaas API的官方版本,旨在用于生产。
请注意,在测试版本v0时,应将HTTP Access-Token
头设置为值'dummy'。
此外,请注意,API每条响应的响应限制为2500个结果。
此外,所有网络服务都支持POST和GET请求。但是,上传文件时需要使用POST方法。
安装 & 使用
需求
PHP 7.4及更高版本。也应与PHP 8.0兼容。
Composer
要使用Composer安装绑定,请将以下内容添加到composer.json
{ "repositories": [ { "type": "vcs", "url": "https://github.com/jeontwikkeling-nl/ltisaas_client_api_php.git" } ], "require": { "jeontwikkeling-nl/ltisaas_client_api_php": "*@dev" } }
然后运行composer install
手动安装
下载文件并包含autoload.php
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
入门
请按照安装说明进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: token $config = LtiSaasApi\Configuration::getDefaultConfiguration()->setApiKey('Access-Token', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = LtiSaasApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Access-Token', 'Bearer'); $apiInstance = new LtiSaasApi\Api\DefaultApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $coursename = 'coursename_example'; // string | The name of the course to be created $coursenameshort = 'coursenameshort_example'; // string | The shortname of the course to be created try { $result = $apiInstance->courseAdd($coursename, $coursenameshort); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->courseAdd: ', $e->getMessage(), PHP_EOL; }
API端点
所有URI相对于 https://provider42luuk.web11.webv.nl/local/ltisaas/api.php/v0
模型
- CourseAdd200Response
- CourseDelete200Response
- CourseLearningObjectScromAdd200Response
- CourseLearningobjectList200Response
- CourseLearningobjectList200ResponseResultsInner
- CourseList200Response
- CourseList200ResponseResultsInner
- CourseLtiRegistrationsByDay200Response
- CourseLtiRegistrationsByDay200ResponseResultsInner
- CourseLtiRegistrationsSumByCourse200Response
- CourseLtiRegistrationsSumByCourse200ResponseResultsInner
- CourseToolAdd200Response
- CourseToolList200Response
- CourseToolList200ResponseResultsInner
- CourseUpdate200Response
- ErrorResponse
- TokenAdd200Response
- TokenList200Response
- TokenList200ResponseResultsInner
- UserList200Response
- UserList200ResponseResultsInner
授权
为API定义的认证方案
token
- 类型: API密钥
- API密钥参数名称: Access-Token
- 位置: HTTP头
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包由OpenAPI Generator项目自动生成
- API版本:
1.0
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen