Download the PHP package ocolin/tarana-tcs without Composer
On this page you can find all versions of the php package ocolin/tarana-tcs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package tarana-tcs
Tarana TCS
What is it?
This is a lightweight PHP REST client for the Tarana TCS API services.
Requirements
- PHP >=8.3
- guzzlehttp/guzzle ^7.10
- ocolin/global-type ^2.0
Installation
Configuration
Configuration can be done either through environment settings or constructor arguments. Only properties are needed for configuration. Your API token and the URL of the TSC server. The TSC hostname is also optional as Tarana's API is sell established. However, should that ever change, the hostname can be configured.
Configuration Properties
| Environment | Argument | type | Description |
|---|---|---|---|
| TARANA_TCS_API_TOKEN | $token | string | API Key assigned by Tarana |
| TARANA_TCS_API_HOST | $host | string | Tarana TSC hostname |
| -- | $options | array|object | Optional guzzle properties |
Environment Variables
Constructor Arguments
Options
Optional guzzle parameters can be set using the options argument.
HTTP Defaults
| Option | Default | Description |
|---|---|---|
| timeout | 20 | Seconds to give HTTP attempt |
| verify | true | Verify SSL credentials |
Response
The client returns a response object with the payload as well as HTTP data. Tarana TCS returns an object with a property for data, and a property for error on all calls. This client body payload will be either the error content or data content depending on whether the call was successful or not.
| Parameter | Type | Description |
|---|---|---|
| status | integer | HTTP status code |
| statusMessage | string | HTTP status message |
| headers | array | HTTP response headers |
| body | object | TSC payload. Data or error content |
Path interpolation
The TSC client will interpolate any path variable tokens with value in any matching keys or properties in the $query parameter. See the GET method example to see a path token being replaced.
Method functions
GET
Get a resource(s)
POST
Create a resource.
PATCH
Update a resource.
PUT
Complete update of resource.
DELETE
Remove resource
REQUEST
Generic HTTP request function.