transip / transip-api-php
TransIP Rest API Library
Installs: 147 672
Dependents: 4
Suggesters: 0
Security: 0
Stars: 33
Watchers: 13
Forks: 17
Open Issues: 3
Requires
- php: ^7.2.0|^8.0
- ext-json: *
- ext-openssl: *
- guzzlehttp/guzzle: ^6.5|^7.4
- php-http/client-common: ^2.5
- php-http/discovery: ^1.14
- psr/cache: ^1.0.1|^3.0
- symfony/cache: ^3.4|^4.4|^5.0|^6.0|^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- nyholm/psr7: ^1.5
- php-http/client-implementation: ^1.0
- php-http/guzzle7-adapter: ^1.0
- php-parallel-lint/php-parallel-lint: ^1.2
- phpstan/phpstan: ^1.5
- phpunit/phpunit: ^9.5
Suggests
- php-http/guzzle7-adapter: Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services.
- dev-master
- 6.53.2
- 6.53.1
- 6.53.0
- 6.52.4
- 6.52.3
- 6.52.2
- 6.52.1
- 6.52.0
- 6.51.5
- 6.51.4
- 6.51.3
- 6.51.2
- 6.51.1
- 6.51.0
- 6.50.1
- 6.50.0
- 6.49.10
- 6.49.9
- 6.49.8
- 6.49.7
- 6.49.6
- 6.49.5
- 6.49.4
- 6.49.3
- 6.49.2
- 6.49.1
- 6.49.0
- 6.48.9
- 6.48.8
- 6.48.7
- 6.48.6
- 6.48.5
- 6.48.4
- 6.48.3
- 6.48.2
- 6.48.1
- 6.48.0
- 6.47.1
- 6.47.0
- 6.46.0
- 6.45.0
- 6.44.0
- 6.43.0
- 6.42.0
- 6.41.0
- 6.40.0
- 6.39.0
- 6.38.0
- 6.37.2
- 6.37.1
- 6.37.0
- 6.36.0
- 6.35.2
- 6.35.1
- 6.35.0
- 6.34.0
- 6.33.1
- 6.33.0
- 6.32.0
- 6.31.0
- 6.30.1
- 6.30.0
- 6.29.3
- 6.29.2
- 6.29.1
- 6.29.0
- 6.28.0
- v6.27.1
- v6.27.0
- v6.26.0
- v6.25.0
- v6.24.0
- v6.23.0
- v6.22.0
- v6.21.0
- v6.19.0
- v6.18.0
- v6.17.0
- v6.16.3
- v6.16.2
- v6.16.1
- v6.16.0
- v6.15.1
- v6.15.0
- v6.14.0
- v6.13.0
- v6.12.1
- v6.12.0
- v6.11.0
- 6.10.0
- v6.9.2
- v6.9.1
- 6.9.0
- v6.8.0
- v6.7.2
- v6.7.1
- v6.7.0
- v6.6.3
- v6.6.2
- v6.6.1
- v6.6.0
- v6.5.0
- v6.4.0
- v6.3.0
- v6.2.0
- v6.1.1
- v6.1.0
- v6.0.4
- v6.0.3
- v6.0.2
- v6.0.1
- v6.0.0
- v5.x-dev
- v5.25
- v5.24
- v5.23
- v5.22
- v5.21.0
- v5.20.0
- v5.18.0
- V5.17.0
- v5.16
- v5.15
- v5.14.1
- dev-fix/action-response
- dev-jansenh-master-patch-eb49
- dev-acronis-upgrade-downgrade
- dev-Openstack_AMS2_open_beta_ordering
- dev-feature/openstack-totp
- dev-feature/ssl-certificate-reissue
This package is auto-updated.
Last update: 2024-11-18 14:03:06 UTC
README
RestAPI library for PHP
This library is a complete implementation for communicating with the TransIP RestAPI. It covers all resource calls available in the TransIP RestAPI Docs and it allows your project(s) to connect to the TransIP RestAPI easily. Using this library you can order, update and remove products from your TransIP account.
Deprecated SOAP API library (v5.x)
As of version 6.0 this library is no longer compatible with TransIP SOAP API because the library is now organized around REST. The SOAP API library versions 5.* are now deprecated and will no longer receive future updates.
Requirements
The PHP RestAPI library requires the following in order to work properly:
Composer
You can install the RestAPI library using Composer. Run the following command:
composer require transip/transip-api-php
To use the library in your code, use Composer's autoloader:
require_once('vendor/autoload.php');
Getting started
How to get authenticated:
use Transip\Api\Library\TransipAPI; require_once(__DIR__ . '/vendor/autoload.php'); // Your login name on the TransIP website. $login = ''; // If the generated token should only be usable by whitelisted IP addresses in your Controlpanel $generateWhitelistOnlyTokens = true; // One of your private keys; these can be requested via your Controlpanel $privateKey = ''; $api = new TransipAPI( $login, $privateKey, $generateWhitelistOnlyTokens ); // Create a test connection to the api $response = $api->test()->test(); if ($response === true) { echo 'API connection successful!'; }
Get all domains
$allDomains = $api->domains()->getAll();
Update a single DNS record
$homeIpAddress = '37.97.254.1'; $dnsEntry = new \Transip\Api\Library\Entity\Domain\DnsEntry(); $dnsEntry->setName('homeip'); // subdomain $dnsEntry->setExpire(300); $dnsEntry->setType('A'); $dnsEntry->setContent($homeIpAddress); $api->domainDns()->updateEntry('example.com', $dnsEntry);
For basic examples, please take a look into the examples/
directory. You can also see all resource calls implemented in our command line application