enius/freshdesk-php-sdk 问题修复 & 功能扩展

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

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

enius/freshdesk-php-sdk

最新稳定版本:0.4.0

Composer 安装命令:

composer require enius/freshdesk-php-sdk

包简介

PHP SDK for the Freshdesk API (v2) fork mpclarkson/freshdesk-php-sdk

README 文档

README

This is a PHP 5.5+ SDK for the Freshdesk API v2.

If you have questions, please contact me or open an issue on GitHub.

Quick Start

require __DIR__ . '/vendor/autoload.php'; use \Freshdesk\Api; $api = new Api("your_freshdesk_api_key", "your_freshdesk_domain"); $all = $api->tickets->all(); $some = $api->tickets->all(['page' => 2]); $new = $api->tickets->create($data); $updated = $api->tickets->update($data); $api->tickets->delete($id); $existing = $api->tickets->view($id); //Responses are simple arrays, e.g.: $id = $existing['id']; $first = $all[0];

Installation

To integrate this library into your application, use Composer.

Add enius/freshdesk-php-sdk to your composer.json file:

{ "require": { "enius/freshdesk-php-sdk": "dev-master" } }

Then run:

php composer.phar install

API Overview

Full documentation is available here

Getting started

Creating a new API instance is very easy. All you need is your Freshdesk API key and your Freshdesk domain.

require __DIR__ . '/vendor/autoload.php'; use \Freshdesk\Api; $api = new Api("your_freshdesk_api_key", "your_freshdesk_domain");

Resources

The available methods for each resource are available via a public property on the api, for example:

//Contacts $contacts = $api->contacts->update($contactId, $data); //Agents $me = $api->agents->current(); //Companies $company = $api->companies->create($data); //Groups $deleted = $api->groups->delete($groupId); //Tickets $ticket = $api->tickets->view($filters); //Time Entries $time = $api->timeEntries->all($ticket['id']); //Conversations $ticket = $api->conversations->note($ticketId, $data); //Categories $newCategory = $api->categories->create($data); //Forums $forum = $api->forums->create($categoryId, $data); //Topics $topics = $api->topics->monitor($topicId, $userId); //Comments $comment = $api->comments->create($forumId); //Email Configs $configs = $api->emailConfigs->all(); //Products $product = $api->products->view($productId); //Business Hours $hours = $api->businessHours->all(); //SLA Policy $policies = $api->slaPolicies->all();

Responses

All responses are arrays of data. Please refer to Freshdesk's documentation for further information.

Filtering

All GET requests accept an optional array $query parameter to filter results. For example:

//Page 2 with 50 results per page $page2 = $this->forums->all(['page' => 2, 'per_page' => 50]); //Tickets for a specific customer $tickets = $this->tickets->view(['company_id' => $companyId]);

Please read the Freshdesk documentation for further information on filtering GET requests.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固