pouler / linkfire-api
PHP Package for the Linkfire API
Installs: 6 008
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=8.1
- ext-json: *
- symfony/http-client: ^5.4|^6.0
- symfony/property-access: ^5.4|^6.0
- symfony/serializer: ^5.4|^6.0
Requires (Dev)
- phpunit/phpunit: ^9
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-10-25 17:11:22 UTC
README
This is a PHP wrapper for the Linkfire API.
Requirements
- PHP >=8.1
Installation
Install it using Composer:
composer require pouler/linkfire-api
Example usage
<?php declare(strict_types=1); use PouleR\LinkfireAPI\Entity\CampaignLink; use PouleR\LinkfireAPI\LinkfireAPI; use PouleR\LinkfireAPI\LinkfireAPIClient; use Symfony\Component\HttpClient\CurlHttpClient; require 'vendor/autoload.php'; $httpClient = new CurlHttpClient(); $apiClient = new LinkfireAPIClient($httpClient); $linkfireAPI = new LinkfireAPI($apiClient); $authenticatedToken = $linkfireAPI->authenticate('client-id', 'client-secret'); $linkfireAPI->setAccessToken($authenticatedToken->getAccessToken()); // Retrieve all mediaServices for a given board $mediaServices = $linkfireAPI->getBoardMediaServices('board-id'); // Create a campaign link $campaignLink = $api->createCampaignLink('board-id', [ 'title' => 'Readme', 'baseUrl' => 'https://open.spotify.com/album/your-album-uri', 'domainId' => 'domain-id', 'artist' => 'PouleR', 'album' => 'Readme', 'mediaType' => 'Music', ]);