Skip to content

URLR/urlr-php

Repository files navigation

URLR@3.0.2

Packagist Version Packagist Downloads Packagist License

This SDK is automatically generated with the OpenAPI Generator project.

  • API version: 2.0.0
  • Package version: 3.0.2
  • 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');

$apiKey = getenv('URLR_API_KEY'); // 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()
    ->setApiKey('X-API-KEY', $apiKey);

// Create a link

$linksApi = new URLR\Api\LinksApi($client, $configuration);

$linkCreateRequest = new \URLR\Model\LinkCreateRequest([
    'url' => '',
    'workspaceId' => '',
]);

try {
    $link = $linksApi->linkCreate($linkCreateRequest);
} catch (Exception $e) {
    echo 'Exception when calling LinksApi->linkCreate: ', $e->getMessage(), PHP_EOL;
}

Complete examples can be found in the docs directory of the client repository.

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

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.

About

PHP library for link shortening with URLR API.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages