iqual/iq_hootsuite_api
Composer 安装命令:
composer require iqual/iq_hootsuite_api
包简介
Provides integration with the Hootsuite REST API for scheduling messages, managing social profiles, and more.
README 文档
README
A Drupal module that provides integration with the Hootsuite REST API for scheduling messages, managing social profiles, and more.
Requirements
- Drupal 10 / 11
- PHP 8.1+
- Guzzle HTTP client (included with Drupal core)
Installation
- Place the module in your
modules/customormodules/contribdirectory. - Enable the module:
drush en iq_hootsuite_api
Configuration
- Navigate to Administration > Configuration > Web services > Hootsuite API Settings (/admin/config/services/iq_hootsuite_api).
- Enter your Client ID and Client Secret from the Hootsuite Developer Portal.
- The OAuth2 and API endpoints are pre-filled with Hootsuite defaults. Adjust only if needed.
- Save the configuration, then click the authentication link to complete the OAuth2 flow.
OAuth2 Authentication
The module uses the OAuth2 authorization code flow:
- A user with the Administer Hootsuite API settings permission initiates authentication from the settings page.
- The user is redirected to Hootsuite to grant access.
- Hootsuite redirects back to /iq_hootsuite_api/callback with an authorization code.
- The module exchanges the code for access and refresh tokens, stored securely in Drupal's State API.
- Tokens are automatically refreshed when they expire.
Usage
The module exposes a service iq_hootsuite_api.client that can be injected into your custom code.
Dependency injection (recommended)
In your my_module.services.yml:
services:
my_module.my_service:
class: Drupal\my_module\Service\MyService
arguments:
- '@iq_hootsuite_api.client'
In your service class:
use Drupal\iq_hootsuite_api\Service\HootsuiteApiClientInterface;
class MyService {
public function __construct(
protected HootsuiteApiClientInterface $hootsuiteClient,
) {}
}
Available methods
| Method | Description |
|---|---|
| getMe() | Retrieve the authenticated member's info |
| getSocialProfiles() | List accessible social profiles |
| scheduleMessage($text, $profileIds, $time, $options) | Schedule a message to social profiles |
| getMessage($messageId) | Retrieve a specific message |
| getMessages($startTime, $endTime, $options) | List outbound messages in a date range |
| deleteMessage($messageId) | Delete a message |
| createMediaUploadUrl($sizeBytes, $mimeType) | Get an S3 upload URL for media |
| request($method, $endpoint, $query, $body) | Make any authenticated API request |
| getEndpointUrl($name) | Build a full URL from a configured endpoint name |
| getHttpClient() | Access the underlying Guzzle HTTP client |
Examples
$client = \Drupal::service('iq_hootsuite_api.client');
// Get authenticated user info.
$me = $client->getMe();
// List social profiles.
$profiles = $client->getSocialProfiles();
// Schedule a message.
$result = $client->scheduleMessage(
'Check out our latest post!',
['115185509'],
'2026-04-01T14:00:00Z',
['tags' => ['campaign_spring']],
);
// Retrieve messages from the last 7 days.
$messages = $client->getMessages(
'2026-02-23T00:00:00Z',
'2026-03-02T00:00:00Z',
['state' => 'SCHEDULED', 'limit' => 10],
);
// Generic API call.
$team = $client->request(
'GET',
$client->getEndpointUrl('organizations') . '/626731/teams'
);
Permissions
| Permission | Description |
|---|---|
| Administer Hootsuite API settings | Access the configuration form and OAuth2 callback |
API Reference
This module wraps the Hootsuite REST API v1. Refer to the official documentation for full details on request/response formats.
iqual/iq_hootsuite_api 适用场景与选型建议
iqual/iq_hootsuite_api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 43 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「drupal」 「social media」 「hootsuite」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 iqual/iq_hootsuite_api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 iqual/iq_hootsuite_api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 iqual/iq_hootsuite_api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
Provides an add-on purchasable entity.
Drupal integration module for the Kalastatic prototyping and styleguide tool
Provides a base set of configuration and module dependencies for starting new Drupal projects.
LinkedIn integration for Social
This module extends Drupal Migrate framework.
统计信息
- 总下载量: 43
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 30
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2026-03-02