emgag/vg-wort-message-api

此包已被废弃,不再维护。未建议替代包。

VG Wort METIS 消息 API 辅助工具

dev-master 2022-12-31 12:56 UTC

This package is auto-updated.

Last update: 2022-12-31 13:02:28 UTC


README

警告:此库不再维护,且不与当前 VG Wort METIS API 版本兼容。

一个简化创建和提交 VG Wort METIS 消息的插件。与官方 T.O.M. WebServices 兼容。

安装

composer require emgag/vg-wort-message-api

使用

MessageService

use Emgag\VGWort\MessageService;

$messageService = new MessageService($username, $password);

$response = $messageService->newMessage(
    $id, // Private Identification Id
    [
        // Multiple Authors possible
        ["firstName" => "", "surName" => "", "cardNumber" => ""]
    ],
    $title, // Title of this message
    $text, // Text of this message (plain text)
    $urls // URLs of this message
);

可以提供多个 URL。$urls URL 可采用以下格式之一

  • 作为一个简单的数组。
$urls = [
    "http://example.com/path/to/file.html"
];
  • 作为一个多维数组。键将被忽略。
$urls = [
    "page-1" => [
        "http://example-1.com/path/to/file.html"
    ],
    "page-2" => [
        "http://example-2.com/path/to/file.html"
    ]
];

PixelService

use Emgag\VGWort\PixelService;

$pixelService = new PixelService($username, $password);

try {
    $ids = $pixelService->overview(PixelService::TYPE_MINDESTZUGRIFF);
} catch (\Exception $e) {
    ...
}

允许的类型

  • PixelService::TYPE_MINDESTZUGRIFF
  • PixelService::TYPE_ANTEILIGER_MINDESTZUGRIFF

许可证

vg-wort-message-api 使用 MIT 许可证 许可。