urlr/urlr-php
最新稳定版本:3.0.0
Composer 安装命令:
composer require urlr/urlr-php
包简介
PHP client for URLR
README 文档
README
This SDK is automatically generated with the OpenAPI Generator project.
- API version: 2.0.0
- Package version: 3.0.0
- Build package: urlr/urlr-php
For more information, please visit https://urlr.me/en.
Installation & Usage
Requirements
PHP 8.1 and later.
Composer
You can install the bindings via Composer. Run the following command:
composer require urlr/urlr-php
Manual Installation
Download the files and include autoload.php:
<?php require_once('/path/to/URLR/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); $username = getenv('URLR_API_USERNAME'); // to be defined on your side $password = getenv('URLR_API_PASSWORD'); // to be defined on your side // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. $client = new GuzzleHttp\Client(); $configuration = URLR\Configuration::getDefaultConfiguration(); // Access Tokens $accessTokensApi = new URLR\Api\AccessTokensApi($client, $configuration); $createAccessTokensRequest = new \URLR\Model\CreateAccessTokenRequest([ 'username' => $username, 'password' => $password, ]); try { $token = $accessTokensApi->createAccessToken($createAccessTokensRequest)->getToken(); } catch (Exception $e) { echo 'Exception when calling AccessTokensApi->createAccessToken: ', $e->getMessage(), PHP_EOL; exit; } $configuration->setAccessToken($token); // Create a link $linksApi = new URLR\Api\LinksApi($client, $configuration); $createLinkRequest = new \URLR\Model\CreateLinkRequest([ 'url' => '', 'teamId' => '', ]); try { $link = $linksApi->createLink($createLinkRequest); } catch (Exception $e) { echo 'Exception when calling LinksApi->createLink: ', $e->getMessage(), PHP_EOL; }
A complete example is available here.
API Endpoints
All URIs are relative to https://urlr.me/api/v2
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DomainsApi | domainCreate | POST /domains | Create a domain |
| DomainsApi | domainGet | GET /domains/{domain_id} | Get a domain |
| DomainsApi | domainList | GET /domains | List domains |
| FoldersApi | folderCreate | POST /folders | Create a folder |
| FoldersApi | folderGet | GET /folders/{folder_id} | Get a folder |
| FoldersApi | folderList | GET /folders | List folders |
| LinksApi | linkCreate | POST /links | Create a link |
| LinksApi | linkDelete | DELETE /links/{link_id} | Delete a link |
| LinksApi | linkEdit | PATCH /links/{link_id} | Edit a link |
| LinksApi | linkGet | GET /links/{link_id} | Get a link |
| LinksApi | linkList | GET /links | List links |
| QRCodesApi | qrcodeCreate | POST /qrcodes | Create a QR Code |
| StatisticsApi | statisticGet | GET /statistics | Get statistics |
| WorkspacesApi | workspaceGet | GET /workspaces/{workspace_id} | Get a workspace |
| WorkspacesApi | workspaceList | GET /workspaces | List workspaces of user |
Models
- Domain
- DomainCreate409Response
- DomainCreate429Response
- DomainCreateRequest
- DomainGet401Response
- DomainGet404Response
- DomainGet422Response
- DomainList200Response
- Folder
- FolderCreateRequest
- FolderList200Response
- Link
- LinkBaseRequest
- LinkBaseRequestMetatag
- LinkBaseRequestQrcode
- LinkCreateRequest
- LinkDelete500Response
- LinkEditRequest
- LinkGeolinksInner
- LinkGeolinksInnerConditionsInner
- LinkList200Response
- LinkMetatag
- LinkQrcode
- LinkTagsInner
- LinkUtm
- QrcodeCreateRequest
- QrcodeCreateRequestOneOf
- QrcodeCreateRequestOneOf1
- StatisticGet200Response
- Workspace
- WorkspaceList200Response
Authorization
ApiKeyAuth
- Type: API key
- API key parameter name: X-API-KEY
- Location: HTTP header
Tests
To run the tests, use:
composer install vendor/bin/phpunit
Get help / support
Please contact contact@urlr.me and we can take more direct action toward finding a solution.
统计信息
- 总下载量: 288
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-26