定制 brightflair/spektrix-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

brightflair/spektrix-api

Composer 安装命令:

composer require brightflair/spektrix-api

包简介

Self-documenting, type-safe Spektrix web API.

README 文档

README

This is an unofficial library for accessing Spektrix's v3 API, built to abstract complex authentication in a self-documenting, type-safe PHP API.

Getting an access key

Official docs here: https://support.spektrix.com/hc/en-us/articles/360013592837-Setting-Up-an-API-User

  1. Associate a username, email address and mobile telephone number to a new API user.
  2. The username is required, along with a provided client name, to access the API.
  3. Email address will receive a link to click with a one-off token.
  4. On the page linked via email, enter a code sent via SMS.
  5. You will receive your secret API key - this is used when construct the Client object.

Authentication

API authentication is abstracted by this library, because it involves a multiple-step time-sensitive SHA-1 hashing exercise. To authenticate this library, pass your username and client name into the constructor of the Client object.

$username = "greg\brightflair";
$clientName = "api-test";
$secretKey = "S2VlcCB5b3VyIGtuaWNrZXJzIG9uISBUaGlzIGlzIGEgdGVzdCBBUEkga2V5LCBkb24ndCB3b3JyeSE=";
$client = new BrightFlair\SpektrixAPI\Client($username, $clientName, $secretKey);

Endpoints of the API

Endpoints are mapped to type-safe functions in the library. Use your IDE for self-documentation, with the following naming convention:

  • Functions begin with "create" / "get" / "update".
  • Functions then include the entity name, such as "customer" / "tag".
  • Matching mechanisms are provided as named parameters, such as "id" / "name".

Example call to get a customer, get a tag by its name, and add the tag to the customer's record:

$customer = $client->getCustomerByEmail("greg.bowler@brightflair.com");
$tag = $client->getTagByName("Example tag");
$client->addTagToCustomer($customer, $tag);

Missing functionality

I have built this library for my own use to integrate with Nimbus Disability. I don't plan on building any more functionality than is required for the type of integration I'm using, unless someone persuades me to develop it further.

The following features are implemented, and tested with examples:

  • Create customer
  • Get customer (id or email)
  • Get tag by ID
  • Get all tags
  • Get tags for customer
  • Add tag to customer
  • Remove tag from customer

More functionality will only be added as and when it is required by integrations, but others are free to create pull requests.

brightflair/spektrix-api 适用场景与选型建议

brightflair/spektrix-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 519 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 02 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 brightflair/spektrix-api 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-02-07