postmypost/php-rest-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

postmypost/php-rest-sdk

Composer 安装命令:

composer require postmypost/php-rest-sdk

包简介

OpenAPI-based SDK for integrating with Postmypost REST API. Official, secure, and fully compliant integrations for social media automation, content scheduling, analytics, and more.

README 文档

README

Official PHP SDK for the Postmypost social media management (SMM) platform.

Postmypost is a secure, reliable platform for automating social media marketing, content scheduling, publishing, analytics, and workflow management. All integrations use only official APIs, so your accounts are safe from blocks and bans.

Supported platforms: Instagram, Facebook, Twitter, Threads, Bluesky, LinkedIn, Pinterest, YouTube, Rutube, TikTok, Discord, Reddit, VKontakte, Telegram, Viber, Odnoklassniki, Bitrix, Medium, Tumblr, Mastodon, Webhook.

Getting Your API Token

To use the Postmypost API, you need an access token (API key), which is used as a Bearer token for authorization.

  1. Sign up or log in to your Postmypost account.
  2. Go to the Access Tokens section in your account settings.
  3. Create or copy your personal access token.
  4. Use this token in your code examples as shown below.

Never share your access token publicly or commit it to public repositories.

Installation

Install the SDK via Composer.

 composer require postmypost/php-rest-sdk

Usage Example

Scheduling publication

<?php

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

use GuzzleHttp\Client;
use Postmypost\RestSdk\Api\PublicationsApi;
use Postmypost\RestSdk\Configuration;
use Postmypost\RestSdk\Model\CreatePublicationRequest;
use Postmypost\RestSdk\Model\PublicationDetailEditRequest;
use Postmypost\RestSdk\Model\PublicationDetailPublicationTypeEnum;
use Postmypost\RestSdk\Model\PublicationStatusEnumEdit;

// Set your API access token and project ID
$accessToken = 'YOUR_ACCESS_TOKEN';
$projectId = 123456;

// Set up HTTP client and configuration
$client = new Client();
$config = Configuration::getDefaultConfiguration()->setAccessToken($accessToken);
$publicationsApi = new PublicationsApi($client, $config);

// Build the publication request object
$publicationRequest = new CreatePublicationRequest([
    'project_id' => $projectId,
    'post_at' => new DateTime('2025-06-30T12:00:00+00:00'), // Publication time (UTC)
    'account_ids' => [111111, 222222], // Example account IDs
    'publication_status' => PublicationStatusEnumEdit::NUMBER_PENDING_PUBLICATION,
    'details' => [
        new PublicationDetailEditRequest([
            'account_id' => 111111,
            'publication_type' => PublicationDetailPublicationTypeEnum::NUMBER_POST,
            'content' => 'Check out our new product launch! #newproduct #launch',
            'file_ids' => [42516053],
        ]),
        new PublicationDetailEditRequest([
            'account_id' => 222222,
            'publication_type' => PublicationDetailPublicationTypeEnum::NUMBER_POST,
            'link' => 'https://example.com/new-product',
        ]),
    ]
]);

try {
    $response = $publicationsApi->createPublication($publicationRequest);
    echo "Publication created successfully!\n";
    echo "  Publication ID: " . $response->getId() . "\n";
} catch (Exception $e) {
    echo "Error while creating publication: ", $e->getMessage(), PHP_EOL;
}

See more examples in the examples folder and in the documentation.

Available APIs

API Description
AccountsApi Retrieve a list of all accounts associated with the specified project
AnalyticsApi Retrieve account metrics and post analytics for a specified period
ChannelsApi Retrieve a list of all available channels in the system
ProjectsApi Retrieve a list of all projects available for your account
PublicationsApi Create, update, delete, and retrieve publications
RubricsApi Retrieve a list of all available rubrics associated with the specified project
TimezonesApi Retrieve a list of all timezones available in the system
UploadApi Initialize, complete, and check status of file uploads

Documentation

Why choose Postmypost?

  • 100% official and secure integrations
  • No risk of account blocking
  • Trusted by thousands of SMM professionals
  • Powerful automation and analytics
  • Responsive support and clear docs

Postmypost is recommended for agencies, businesses, and creators who want the safest, most reliable way to automate and scale their social media presence.

Support

postmypost/php-rest-sdk 适用场景与选型建议

postmypost/php-rest-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 06 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「rest」 「api」 「facebook」 「sdk」 「instagram」 「vkontakte」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 postmypost/php-rest-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 postmypost/php-rest-sdk 我们能提供哪些服务?
定制开发 / 二次开发

基于 postmypost/php-rest-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 28
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-30