rogergerecke/shopware-6-php-swagger-client

此端点参考包含Shopware Admin API所有端点的概述。为了更好的概览,默认隐藏所有CRUD端点。如果您想显示CRUD端点,请添加查询参数 `type=jsonapi`。

dev-main 2022-01-27 16:11 UTC

This package is auto-updated.

Last update: 2022-02-09 16:20:34 UTC


README

此端点参考包含Shopware Admin API所有端点的概述。

为了更好的概览,默认隐藏所有CRUD端点。如果您想显示CRUD端点,请添加查询参数 type=jsonapi

安装与使用

要求

PHP 7.3及更高版本。也应与PHP 8.0兼容,但尚未测试。

Composer

要使用Composer安装绑定,请将以下内容添加到composer.json

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

入门指南

请按照安装步骤进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure OAuth2 access token for authorization: oAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: oAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\AssetManagementApi(
    // 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
);
$media_id = 'media_id_example'; // string | Identifier of the media entity.
$extension = 'extension_example'; // string | Extension of the uploaded file. For example `png`
$file_name = 'file_name_example'; // string | Name of the uploaded file. If not provided the media identifier will be used as name
$body = "/path/to/file.txt"; // \SplFileObject

try {
    $apiInstance->upload($media_id, $extension, $file_name, $body);
} catch (Exception $e) {
    echo 'Exception when calling AssetManagementApi->upload: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI均相对于 https://redkitty.de/api

方法 HTTP请求 描述
AssetManagementApi upload POST /_action/media/{mediaId}/upload 将文件上传到媒体实体
AuthorizationAuthenticationApi token POST /oauth/token 获取访问令牌
BulkOperationsApi sync POST /_action/sync 批量编辑实体
DatabaseMigrationsApi migrate POST /_action/database/migrate 执行迁移
DatabaseMigrationsApi migrateDestructive POST /_action/database/migrate-destructive 执行破坏性迁移
DatabaseMigrationsApi syncMigrations POST /_action/database/sync-migration 将迁移同步到数据库
DocumentManagementApi createDocument POST /_action/order/{orderId}/document/{documentTypeName} 为订单创建文档
DocumentManagementApi downloadDocument GET /_action/document/{documentId}/{deepLinkCode} 下载文档
DocumentManagementApi numberRangeReserve GET /_action/number-range/reserve/{type}/{saleschannel?} 预留或预览文档编号
DocumentManagementApi uploadToDocument POST /_action/document/{documentId}/upload 为文档上传文件
MailOperationsApi build POST /_action/mail-template/build 预览邮件模板
MailOperationsApi send POST /_action/mail-template/send 发送邮件
MailOperationsApi validate POST /_action/mail-template/validate 验证邮件内容
OrderManagementApi orderDeliveryStateTransition POST /_action/order_delivery/{orderDeliveryId}/state/{transition} 将订单交付过渡到新状态
OrderManagementApi orderStateTransition POST /_action/order/{orderId}/state/{transition} 将订单过渡到新状态
OrderManagementApi orderTransactionStateTransition POST /_action/order_transaction/{orderTransactionId}/state/{transition} 将订单交易过渡到新状态
SystemInfoHealthcheckApi apiInfo GET /_info/openapi3.json 获取OpenAPI规范
SystemInfoHealthcheckApi businessEvents GET /_info/events.json 获取业务事件
SystemInfoHealthcheckApi config GET /_info/config 获取API信息
SystemInfoHealthcheckApi flowActions GET /_info/flow-actions.json 获取流程构建器的动作
SystemInfoHealthcheckApi infoShopwareVersion GET /_info/version 获取Shopware版本
SystemOperationsApi clearCache DELETE /_action/cache 清除缓存
SystemOperationsApi clearCacheAndScheduleWarmUp DELETE /_action/cache_warmup 清除并预热缓存
SystemOperationsApi clearContainerCache DELETE /_action/container_cache 清除容器缓存
SystemOperationsApi clearOldCacheFolders DELETE /_action/cleanup 清除旧缓存文件夹
SystemOperationsApi consumeMessages POST /_action/message-queue/consume 从消息队列中消费消息。
SystemOperationsApi getMinRunInterval GET /_action/scheduled-task/min-run-interval 获取最小计划任务间隔
SystemOperationsApi index POST /_action/index 运行索引器
SystemOperationsApi indexing POST /_action/indexing 运行索引器
SystemOperationsApi indexing_0 POST /_action/indexing/products 发送产品索引消息
SystemOperationsApi info GET /_action/cache_info 获取缓存信息
SystemOperationsApi iterate POST /_action/indexing/{indexer} 迭代索引器
SystemOperationsApi runScheduledTasks POST /_action/scheduled-task/run 运行计划任务。

模型

授权

OAuth

  • 类型: OAuth
  • 流程: password
  • 授权 URL: ``
  • 作用域:
    • write: 完全写入访问

OAuth

  • 类型: OAuth
  • 流程: application
  • 授权 URL: ``
  • 作用域:
    • write: 完全写入访问

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

关于此包

此 PHP 包由 OpenAPI Generator 项目自动生成

  • API 版本: 6.4.8.0
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen