This SDK is automatically generated with the OpenAPI Generator project.
- API version: 1.3
- Package version: 2.4.0
- Build package: urlr/urlr-php
For more information, please visit https://urlr.me/en
PHP 8.1 and later.
You can install the bindings via Composer. Run the following command:
composer require urlr/urlr-php
Download the files and include autoload.php
:
<?php
require_once('/path/to/URLR/vendor/autoload.php');
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Access Tokens
$accessTokensApi = new URLR\Api\AccessTokensApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$accessTokensRequest = new \URLR\Model\AccessTokensRequest([
'username' => '',
'password' => '',
]); // \URLR\Model\AccessTokensRequest | Your credentials
try {
$token = $accessTokensApi->createAccessToken($accessTokensRequest)->getToken();
} catch (Exception $e) {
echo 'Exception when calling AccessTokensApi->createAccessToken: ', $e->getMessage(), PHP_EOL;
exit;
}
$config = URLR\Configuration::getDefaultConfiguration()->setAccessToken($token);
// Link shortening
$linksApi = new URLR\Api\LinksApi(null, $config);
$createLinkRequest = new \URLR\Model\CreateLinkRequest([
'url' => '',
'teamId' => ''
]); // \URLR\Model\CreateLinkRequest | Infos of the link to shorten
try {
$result = $apiInstance->createLink($createLinkRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LinksApi->createLink: ', $e->getMessage(), PHP_EOL;
}
A complete example is available here.
All URIs are relative to https://urlr.me/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
AccessTokensApi | createAccessToken | POST /access_tokens/create | Get an access token |
AccessTokensApi | refreshAccessToken | POST /access_tokens/refresh | Refresh an access token |
FoldersApi | getFolders | GET /folders/{team_id} | Get folders of team |
LinksApi | createLink | POST /links/create | Create a link |
LinksApi | getLink | GET /links/{link_id} | Get a link |
QRCodesApi | createQrCode | POST /qrcodes/create | Create a QR Code |
StatisticsApi | getStatistics | POST /statistics | Get statistics of a link |
TeamsApi | getTeams | GET /teams | Get teams of user |
- CreateAccessToken200Response
- CreateAccessToken401Response
- CreateAccessTokenRequest
- CreateLink429Response
- CreateLink500Response
- CreateLinkRequest
- CreateLinkRequestMetatag
- CreateLinkRequestQrcode
- CreateQrCodeRequest
- CreateQrCodeRequestOneOf
- CreateQrCodeRequestOneOf1
- GetFolders200Response
- GetFolders200ResponseFoldersInner
- GetLink200Response
- GetLink200ResponseGeolinksInner
- GetLink200ResponseMetatag
- GetLink200ResponseQrcode
- GetLink401Response
- GetLink404Response
- GetLink422Response
- GetStatistics200Response
- GetStatisticsRequest
- GetTeams200Response
- GetTeams200ResponseTeamsInner
- RefreshAccessToken401Response
- RefreshAccessTokenRequest
- Type: Bearer authentication (JWT)
To run the tests, use:
composer install
vendor/bin/phpunit
Please contact contact@urlr.me and we can take more direct action toward finding a solution.