interserver/mailbaby-client-php

**通过我们易于使用的[REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API界面快速、自信地发送电子邮件。** # 概述 这是由 [InterServer](https://www.interserver.net) 提供的 [Mail Baby](https//mail.baby/) 邮件服务的 API 界面。为了使用此服务,您必须在我们 my.interserver.net 的账户中拥有账户。

1.0.0 2021-05-03 18:36 UTC

This package is auto-updated.

Last update: 2024-09-26 19:09:44 UTC


README

通过我们易于使用的 REST API 界面快速、自信地发送电子邮件。

概述

这是由 Mail Baby 提供的邮件服务的 API 界面,由 InterServer 提供。要使用此服务,您必须在我们 my.interserver.net 的账户中拥有账户。

身份验证

为了使用大多数 API 调用,您必须从 my.interserver.net 网站传递凭证。我们支持多种不同的身份验证方法,但首选方法是使用 API 密钥,您可以在 账户安全 页面上获取。

有关更多信息,请访问 https://www.mail.baby/contact/

安装和用法

要求

PHP 7.4 及更高版本。也应与 PHP 8.0 兼容。

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/interserver/mailbaby-client-php.git"
    }
  ],
  "require": {
    "interserver/mailbaby-client-php": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

入门

请遵循 安装程序,然后运行以下命令

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



// Configure API key authorization: apiKeyAuth
$config = Interserver\Mailbaby\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Interserver\Mailbaby\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');


$apiInstance = new Interserver\Mailbaby\Api\BlockingApi(
    // 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
);
$type = 'type_example'; // string | The type of deny rule.
$data = 'data_example'; // string | The content of the rule.  If a domain type rule then an example would be google.com. For a begins with type an example would be msgid-.  For the email typer an example would be user@server.com.
$user = 'user_example'; // string | Mail account username that will be tied to this rule.  If not specified the first active mail order will be used.

try {
    $result = $apiInstance->addRule($type, $data, $user);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BlockingApi->addRule: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都相对于 https://api.mailbaby.net

模型

授权

API 定义的身份验证方案

apiKeyAuth

  • 类型: API 密钥
  • API 密钥参数名称: X-API-KEY
  • 位置: HTTP 标头

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

support@interserver.net

关于此包

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

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