dealerkit/decoder-api

DealerKit VIN 解码 API 的包装器

1.0.0 2018-06-14 12:10 UTC

This package is not auto-updated.

Last update: 2024-09-22 04:09:26 UTC


README

此库与DealerKit API配合使用 - https://dealerkit.co

您可以解码车辆识别号码,查看使用统计信息以及获取基本的账单信息

composer.phar require "dealerkit/decoder-api":"~1.0.0"

基本使用方法

在开始使用API之前,您需要注册并进入您的个人资料以获取API密钥。接下来创建DealerKitApi类的基...

$token = '{your-personal-token}';
$client = new DealerKitApi($token);

1. VIN查找

解码vin的基本使用方法

$vin = '1N6AD07U46C418468';
$data = $client->getVinLookup($vin);

成功结果

{
  "success": true,
  "query": "1N6AD07U46C418468",
  "specification": {
    "year": "2006",
    "make": "Nissan",
    "model": "Frontier",
    "trim": "Nismo Crew Cab 2WD",
    "made_in": "UNITED STATES",
    "style": "CREW CAB PICKUP 4-DR",
    "engine": "4.0L V6 DOHC 24V",
    "transmission": "5-Speed Automatic",
    "drive_type": "RWD",
    "tank_size": "21.10",
    "city_mileage": "16",
    "highway_mileage": "20",
    "anti_brake_system": "4-Wheel ABS",
    "steering_type": "R&P",
    "standard_seating": "5",
    "optional_seating": "No data",
    "length": "205.50",
    "width": "72.80",
    "height": "70.10"
  }
}

2. 获取使用统计信息

$data = $client->getUsageStatistics();

成功结果

{
    "success": true,
    "decoded_total": 3121,
    "decoded_today": 127
}

3. 获取关于已订阅的账单计划的详细信息

$data = $client->getBillingInfo();

成功结果

{
    "success": true,
    "billing_plan": {
        "name": "Mega",
        "price": 159.99,
        "price_req": 0.01,
        "price_currency": "USD"
    }
}

常见的错误

令牌不正确。请确保令牌是正确的,并且已正确传输。

{
  "success": false,
  "message": "Your request was made with invalid credentials.",
  "code": 401
}

您尚未订阅账单计划。请访问账单页面并选择计划。

{
  "success": false,
  "message": "Billing plan not choosed",
  "code": 1
}

由于此原因暂时阻止了从卡中扣款,请充值余额或联系管理员。

{
  "success": false,
  "message": "Billing plan is inactive",
  "code": 2
}