定制 amattu2/golo365-wrapper 二次开发

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

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

amattu2/golo365-wrapper

Composer 安装命令:

composer require amattu2/golo365-wrapper

包简介

A Golo365.com and X431.com API wrapper class for interacting with their hidden diagnostic APIs.

README 文档

README

What is Golo365?

Golo365 is the underlying data connection service behind many automotive diagnostic computers and equipment. Device manufacturers, such as Launch Tech LTD and Matco Tools rely on them for various services. The goal of this API wrapper is to simplify access to Golo365's extremely undocumented API endpoints, and to allow for independent individuals or companies to integrate critical data connections between Golo365 and their own proprietary services.

How can I use this wrapper?

The end goal of the wrapper is to remove the concept of relying the handheld diagnostic computer, as well as the physical connection to the vehicle, in order to retrieve diagnostic history for a vehicle. This is possible because Golo365 (i.e. AIT / DBSCAR / X431) stores the scan history in the cloud. Here are some ways you can use this API wrapper to facilitate a connection between your service (e.g. a Shop Management System) and Golo365:

  • Fetch Diagnostic Scan History reports by License Plate or VIN numbers
  • Perform a VIN-to-License plate decode
  • Perform a License-to-VIN decode
  • ... More integrations coming soon

Need More?

I've put an extensive amount of Golo365 research into the DOCUMENTATION.md file. If you want to create your own wrapper, without reverse engineering this one, rely on information from that file. The DOCUMENTATION.md file also details endpoints discovered but not implemented yet.

Contributions

Many hours days of research and development went into discovering these entirely undocumented API endpoints. If you have an unlisted Golo365 endpoint, or know something that isn't listed in this repository, please reach out via a GitHub Issue or Pull Request.

Postman / Thunder Client

This repository comes with a Thunder Client collection for the Golo365 API. To use it, visit .vscode/thunder-client and import the json into your VS Code Thunder Client extension.

Usage

The function documentation is below. Alternatively, see the example.php file included with the repository for hands-on demonstrations of various functionality.

Install

composer require amattu2/golo365-wrapper

__construct

The class constructor accepts only optional arguments.

/**
 * Class Constructor
 *
 * @param  ?string $serial_no reporting device serial number
 * @param  ?string $service Golo365 service ait|aitus
 * @author Alec M.
 * @since  1.0.0
 */
public function __construct(string $serial_no = "", string $service = "aitus")

If a reporting device serial_no is provided, any search/reporting queries that use the optional serial_no argument will be provided with this serial number. See the variable documentation in the class for notes on what this argument is.

The service argument defines which Golo365 service to report/receive data from. If your diagnostic tablet is built for the U.S., it's likely that all of your device-generated reports will reside within the AITUS service.

setSerialNo

This function returns the class instance, which enables function call chaining.

/**
 * Set or Remove the Device Serial Number
 *
 * @param  ?string $serial_no
 * @return self
 * @since  1.0.0
 */
public function setSerialNo(string $serial_no = "") : self

An empty or invalid serial_no argument will result in the serial_no being returned to the default.

setListSize

For the API endpoints that support pagination, this specifies the number of results per page. This function supports chaining.

/**
 * Set or Remove the Report Listing Size Limit
 *
 * @param  ?integer $size
 * @return self
 * @since  1.0.0
 */
public function setListSize(int $size = 0) : self

A size of 0 or below results in the removal of a size pagination limitation.

reportListByVIN

This function fetches all reported diagnostic events for the provided VIN.

/**
 * Fetch Diagnostic Scan History by VIN
 *
 * Note:
 * (1) If the serial_no variable is not empty,
 *     it will be used to limit results to that
 *     specific device
 *
 * @param  string $vin VIN to search
 * @param  mixed $page page number to fetch
 * @return Array of diagnostic scan history
 * @throws \TypeError
 * @throws \InvalidArgumentException
 * @since  1.0.0
 */
public function reportListByVIN(string $VIN, $page = "") : array

Output

Array
(
  [0] => Array
  (
    [record_id] => int
    [serial_no] => int
    [date] => Y-m-d H:i:s
    [VIN] => string
    [plate_number] => string
    [url] => string
    [type] => string
    [_raw] => Closure
    [_reportDetail] => Closure
  )

  // ... repeating

)

Notes

  1. To access the raw API data (messy), you can use the closure function available via the _raw index.
  2. You may call the reportDetail function via the _reportDetail index; it takes no arguments as they are derived from the current element.

reportListByPlateNumber

/**
 * Fetch Diagnostic Scan History by License Plate Number
 *
 * Note:
 * (1) If the serial_no variable is not empty,
 *     it will be used to limit results to that
 *     specific device
 *
 * @param  string $plate_number License Plate # to search
 * @param  mixed $page page number to fetch
 * @return Array of diagnostic scan history
 * @throws \TypeError
 * @throws \InvalidArgumentException
 * @since  1.0.0
 */
public function reportListByPlateNumber(string $plate_number, $page = "") : array

Output

Array
(
  [0] => Array
  (
    [record_id] => int
    [serial_no] => int
    [date] => Y-m-d H:i:s
    [VIN] => string
    [plate_number] => string
    [url] => string
    [type] => string
    [_raw] => Closure
    [_reportDetail] => Closure
  )

  // ... repeating

)

Notes

  1. The reliability of this function is dependent on end-users reporting the License Plate Number during the diagnostic session. If this was not done, those results will not be included in the return value. If possible, use reportListByVIN instead.
  2. To access the raw API data (messy), you can use the closure function available via the _raw index.
  3. You may call the reportDetail function via the _reportDetail index; it takes no arguments as they are derived from the current element.

reportList

This function fetches all reports produced by a device serial number. It accepts one optional argument. The serial number provided during class instantiation (or via setSerialNo) is used.

/**
 * Fetch Diagnostic Scan History by Serial Number
 *
 * @param mixed $page page number to fetch
 */
public function reportList($page = "") : array

Output

Array
(
  [0] => Array
  (
    [record_id] => int
    [serial_no] => int
    [date] => Y-m-d H:i:s
    [VIN] => string
    [plate_number] => string
    [url] => string
    [type] => string
    [_raw] => Closure
    [_reportDetail] => Closure
  )

  // ... repeating

)

Notes

  1. To access the raw API data (messy), you can use the closure function available via the _raw index.
  2. You may call the reportDetail function via the _reportDetail index; it takes no arguments as they are derived from the current element.

reportDetail

This endpoint provides additional details about a diagnostic event record; such as which systems were scanned, which software was used, etc.

/**
 * Fetch additional details about a diagnostic scan
 *
 * @param  int $record_id
 * @param  string $type
 * @return array
 * @throws \TypeError
 * @throws \InvalidArgumentException
 * @since  1.0.0
 */
public function reportDetail(int $record_id, string $type) : array

Output

Array
(
  [software_version] => string
  [software_package] => string
  [system_list] => Array
  (
    [0] => Array
    (
        [system_uid] => padded int
        [system] => string
        [name_id] => int
        [is_new_sys] => int
    )
  )
  [_raw] => Closure Object
)

Notes

  1. To access the raw data from this array, call the anonymous function (closure) _raw

getPlateByVIN

This function will return a license plate number associated with a VIN number. Important see the notes about this endpoint below.

/**
 * Fetch a License Plate by the VIN Number
 *
 * @param  string $VIN the vehicle VIN number to search a plate for
 * @return array
 * @throws \InvalidArgumentException
 * @since  1.0.0
 */
public function getPlateByVIN(string $VIN) : array

Output

Array
(
  [VIN] => string
  [plate_number] => string
  [_raw] => Closure Object
)

Notes

  1. This endpoint relies on user-inputted data to return a matching plate number. This endpoint does not rely on a government data source, and could easily provide incorrect information.
  2. To access raw API data, simply call the _raw closure object

getVINByPlateNumber

This function is the inverse of getPlateByVIN, and returns a VIN number when provided a license plate number. Important see the notes about this endpoint below.

/**
 * Fetch the VIN by License Plate
 *
 * @param  string $plate_number License Plate # to search
 * @return array
 * @throws TypeError
 * @throws InvalidArgumentException
 * @since  1.0.0
 */
public function getVINByPlateNumber(string $plate_number) : array

Output

Array
(
  [VIN] => string
  [plate_number] => string
  [_raw] => Closure Object
)

Notes

  1. This endpoint does not rely on a government data source. It relies on the data passed when a diagnostic device is submitting a diagnostic event. Unless the plate number was reported during this diagnostic event, no results will be returned.
  2. The only raw data returned is vin and plate_number; but for consistency sake, the _raw closure object is still available for accessing the raw API data.

To-Do

  • upload_report_data
  • upload_accessory_info
  • mergeMultiReport

Requirements & Dependencies

  • PHP7+
  • cURL Extension

amattu2/golo365-wrapper 适用场景与选型建议

amattu2/golo365-wrapper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 3, 最近一次更新时间为 2022 年 06 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 amattu2/golo365-wrapper 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: AGPL-3.0-or-later
  • 更新时间: 2022-06-10