定制 mediamaskio/mediamask-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mediamaskio/mediamask-php

最新稳定版本:1.0.7

Composer 安装命令:

composer require mediamaskio/mediamask-php

包简介

Mediamask PHP API Client for dynamic image generation

README 文档

README

This PHP Client supports the Mediamask POST API to generate dynamic images. You can find more information about the usage in our docs: https://docs.mediamask.io/docs/post-api.

Installation & Usage

Requirements

PHP 7.4 and later.

Composer

Install via Composer

Install the package into your project by using with Composer :

composer require mediamaskio/mediamask-php

### Manual Installation

Download the files and include `autoload.php`:

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

Getting Started

Please follow the installation procedure and then run the following:

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



// Configure Bearer authorization: bearerAuth
$config = Mediamask\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mediamask\Api\MediamaskApi(
    // 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
);

// \OpenAPI\Client\Model\NewImage | Provide the template and placeholders values that should be rendered in the image
$new_image = {
    "template":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "placeholders": [
        {
            "name":"text placeholder name",
            "text":"an example text"
        },
        {
            "name":"image placeholder name",
            "image":"https://example.com/example.jpg"
            }
        ]
    }; 
try {
    $result = $apiInstance->renderImage($new_image);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MediamaskApi->renderImage: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://mediamask.io/api/v1

Class Method HTTP request Description
MediamaskApi renderImage POST /image Render a new image
MediamaskApi templates GET /templates Get all tempaltes

Models

Authorization

bearerAuth

  • Type: Bearer authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.4
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

统计信息

  • 总下载量: 108
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: mit
  • 更新时间: 2022-07-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固