friends-of-vertex-cards / api-client
PHP library for Vertex Cards API interaction
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/friends-of-vertex-cards/api-client
Requires
- php: >=8.3
- nyholm/psr7: ^1.8
- php-http/guzzle7-adapter: ^1.1
- php-http/httplug: ^2.4
- php-http/logger-plugin: ^1.4
- psr/log: ^3.0
- ramsey/uuid: ^4.9
- symfony/property-access: ^7.3
- symfony/serializer: ^7.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.88
- phpunit/phpunit: ^12.4
- psalm/phar: ^6.13
README
PHP library for Vertex Cards API interaction
Supported PHP Versions
- PHP 8.3+
Documentation
1. Installation
The Vertex Cards API Client can be installed using Composer by running the following command:
composer require friends-of-vertex-cards/api-client
2. Getting API token
The library provides authorization flows for users based on a custom header.
Proceed to documentation to obtain your Live API Key and Company Uuid.
3. Client Initialization
Create ApiClient object using the following code:
$apiKey = 'your-api-key'; // step 2. Getting API token $factory = new \FriendsOfVertexCards\ApiClient\VertexCardsClientFactory( new \Http\Adapter\Guzzle7\Client(), new \Symfony\Component\Serializer\Serializer(), 'https://gateway.vertex-cards.com', '/api/v1/cards', new \Psr\Log\NullLogger(), ); $client = $factory->create(new ConfigureDto($apiKey));
Also you can implement your own factory by implementing \FriendsOfVertexCards\ApiClient\VertexCardsClientFactoryInterface
4. API Requests
You can find the full list of API methods here.
4.1 Request Sample
Example of getting accounts:
$companyUuid = Ramsey\Uuid\Uuid::fromString('your-company-uuid') // step 2. Getting API token $apiKey = 'your-api-key'; // step 2. Getting API token /** @var \FriendsOfVertexCards\ApiClient\VertexCardsClientInterface $client */ $client = $factory->create(new ConfigureDto($apiKey)); // step 3. Client Initialization /** @var \FriendsOfVertexCards\ApiClient\Account\List\GetListAccountResponse $accounts */ $accounts = $client->getAccounts(new \FriendsOfVertexCards\ApiClient\Account\List\GetListAccountRequest($companyUuid, 1, 10));