Download the PHP package robsonsanches/stays-php-client without Composer
On this page you can find all versions of the php package robsonsanches/stays-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download robsonsanches/stays-php-client
More information about robsonsanches/stays-php-client
Files in robsonsanches/stays-php-client
Package stays-php-client
Short Description PHP client for server-side integration with Stays API v1 (unofficial library)
License MIT
Informations about the package stays-php-client
Stays API - PHP Client (Unofficial)
PHP client for server-side integration with Stays API v1 (unofficial library)
Table of contents:
- Requirements
- Installation
- Getting started
- Setup
- Making Requests
- Using Responses
- Docs
- License
- Release History
Requirements
- PHP >= 7.3
- Composer
Installation
Getting started
To obtain API credentials please read the Stays API Docs https://stays.net/external-api/#introduction.
Setup
Setup for the Stays API integration:
Client Parameters
Parameter | Type | Required | Description |
---|---|---|---|
$domain |
string |
yes | System's domain, example: https://play.stays.net/ |
$clientId |
string |
yes | API Client ID |
$clientSecret |
string |
yes | API Client Secret |
$options |
array |
no | Additional options (see additional options table) |
Additional options
Option | Type | Required | Description |
---|---|---|---|
type |
string |
no | API type, default is external |
version |
string |
no | API version, default is v1 |
timeout |
number |
no | Request timeout, default is 2.0 |
response_format |
string |
no | Response format (array , object or string ), default is array |
http_errors |
bool |
no | Set to false to disable throwing exceptions, default is true |
http_client_options |
array |
no | Guzzle HTTP client options |
Making Requests
You may use the get, post, patch, and delete methods to make requests to Stays API.
Request Methods
Arguments
Parameter | Type | Description |
---|---|---|
$endpoint |
string |
Stays API endpoint, example: content/groups |
$data |
array |
Only for POST and PATCH, data that will be converted to JSON |
$query |
array |
Only for GET and DELETE, request query string |
$headers |
array |
Additional http headers |
Using Responses
All the request methods will return a response that can be a multidimensional array, array of objects or JSON string on success. If is present the argument http_errors = true
, will throwing ClientException
error on failure.
To get the response data from Http Client:
If you need to get the last requested data:
Docs
Licence
Release History
- 2022-02-20 - 1.0.0 - Initial release.