urlr/urlr-php

PHP client for URLR

2.11.1 2025-08-07 12:10 UTC

This package is auto-updated.

Last update: 2025-08-07 12:10:28 UTC


README

Packagist Version Packagist Downloads Packagist License

This SDK is automatically generated with the OpenAPI Generator project.

  • API version: 1.10
  • Package version: 2.11.1
  • 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/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
DomainsApi createDomain POST /domains/create Create a domain
FoldersApi getFolders GET /folders/{team_id} Get folders of workspace
LinksApi createLink POST /links/create Create a link
LinksApi editLink PATCH /links/{link_id} Edit 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
WorkspacesApi getTeams GET /teams Get workspaces of user

Models

Authorization

bearerAuth

  • Type: Bearer authentication (JWT)

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.