承接 bangkeut-technology/supportdock-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

bangkeut-technology/supportdock-sdk

Composer 安装命令:

composer require bangkeut-technology/supportdock-sdk

包简介

SupportDock PHP SDK — submit feedback and manage FAQs from your PHP application

README 文档

README

Submit feedback and manage FAQs from your PHP application.

Requirements

  • PHP 8.1+
  • cURL extension

Installation

composer require bangkeut-technology/supportdock-sdk

Usage

Initialize the client

use SupportDock\SupportDockClient;

$client = new SupportDockClient([
    'apiKey' => 'sdk_your_api_key',
    // 'baseUrl' => 'https://supportdock.io',  // optional
    // 'timeout' => 10,                         // seconds, optional
    // 'defaultMetadata' => ['appVersion' => '1.0.0'],  // optional
]);

Send feedback

$result = $client->sendFeedback([
    'type' => 'bug',           // 'bug' | 'feature' | 'question' | 'general'
    'message' => 'App crashes on login page',
    'email' => 'user@example.com',  // optional
    'name' => 'Jane Doe',           // optional
    'subject' => 'Login crash',     // optional, auto-generated if omitted
    'metadata' => [                 // optional
        'appVersion' => '2.0.0',
        'platform' => 'web',
    ],
    'images' => [                   // optional — up to 3 base64 data URLs (PNG/JPEG/WebP/GIF, each ≤ 2 MB)
        'data:image/png;base64,iVBOR...',
    ],
    'attachments' => [              // optional — up to 3 PDFs (each ≤ 5 MB)
        ['name' => 'report.pdf', 'data' => 'data:application/pdf;base64,JVBERi0...'],
    ],
]);
// $result = ['success' => true]

Attaching images

// Read a local file and convert to base64 data URL
$imageData = file_get_contents('/path/to/screenshot.png');
$base64 = 'data:image/png;base64,' . base64_encode($imageData);

$client->sendFeedback([
    'type' => 'bug',
    'message' => 'UI is broken on this screen',
    'images' => [$base64],
]);

Attaching PDFs

// Read a local PDF and convert to base64 data URL
$pdfData = file_get_contents('/path/to/report.pdf');
$base64 = 'data:application/pdf;base64,' . base64_encode($pdfData);

$client->sendFeedback([
    'type' => 'bug',
    'message' => 'Steps to reproduce are in the attached report',
    'attachments' => [['name' => 'report.pdf', 'data' => $base64]],
]);

List FAQs

$faqs = $client->listFAQs();
// Returns array of FAQ objects

Create a FAQ

$faq = $client->createFAQ([
    'question' => 'How do I reset my password?',
    'answer' => 'Go to Settings > Account > Reset Password.',
    'sortOrder' => 1,  // optional
]);

Update a FAQ

$faq = $client->updateFAQ('faq-id-here', [
    'answer' => 'Updated answer text.',
]);

Delete a FAQ

$result = $client->deleteFAQ('faq-id-here');
// $result = ['success' => true]

Error handling

use SupportDock\Exception\SupportDockException;
use SupportDock\Exception\ValidationException;
use SupportDock\Exception\RateLimitException;

try {
    $client->sendFeedback(['message' => 'Bug report']);
} catch (RateLimitException $e) {
    // 429 — too many requests (5 per 15-minute window)
    echo "Rate limited: " . $e->getMessage();
} catch (ValidationException $e) {
    // Client-side validation failed
    echo "Invalid input: " . $e->getMessage();
} catch (SupportDockException $e) {
    // API error (401, 403, 404, etc.)
    echo "Error ({$e->getStatusCode()}): " . $e->getMessage();
}

API reference

Method Description
sendFeedback(array $options) Submit feedback (bug, feature, question, general) with optional images and PDF attachments
listFAQs() List all FAQs for the app
createFAQ(array $options) Create a new FAQ entry
updateFAQ(string $faqId, array $options) Update an existing FAQ
deleteFAQ(string $faqId) Delete a FAQ entry

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固