定制 bitly-api/sdk 二次开发

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

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

bitly-api/sdk

最新稳定版本:1.7.0

Composer 安装命令:

composer require bitly-api/sdk

包简介

PHP library for Bitly API.

README 文档

README

packagist build test

PHP library for Bitly. Code is generated using the OpenAPI spec. See the API reference.

Requirements

Version

PHP >=8.0

API Key

Generate an access token.

Install

Install the package with Composer:

composer require bitly-api/sdk

If you're missing a package providing psr/http-client-implementation:

composer require php-http/guzzle7-adapter

Add autoloading:

require_once 'vendor/autoload.php';

Usage

Instantiate the SDK:

use Bitly\Bitly;

$bitly = new Bitly('YOUR_API_KEY');

$client = $bitly->client;

Convert a long URL to a Bitlink:

use Bitly\Bitly;
use Bitly\Model\Shorten;

$bitly = new Bitly('YOUR_API_KEY');

$shorten = new Shorten();
$shorten->setLongUrl('https://example.com/my-long-url');
$response = $bitly->client->createBitLink($shorten);

Handle an API error:

use Bitly\Bitly;

$bitly = new Bitly('YOUR_API_KEY');

try {
    $bitly->client->getBitlink('http://bit.ly/2OUJim0');
} catch (Throwable $exception) {
    echo $exception->getMessage();
    echo $exception->getCode();
}

Scripts

composer build

Generate the code:

composer build

composer clean

Delete the lib/ directory:

composer clean

composer test

Run the tests:

composer test

About This Package

This package is automatically generated by Jane.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固