Download the PHP package streamone/php-sdk-v3 without Composer

On this page you can find all versions of the php package streamone/php-sdk-v3. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-sdk-v3

StreamOne PHP SDK version 3

This is the SDK that can be used to communicate with the StreamOne Platform by using the StreamOne API version 3.

Table of contents

Requirements

The SDK requires PHP 5.4 or higher and the PHP fopen wrappers should be enabled.

Installation

Using composer

The recommended way to install the SDK is to use Composer. To install, add the following to your composer.json file:

Afterwards, you should update the package by running Composer in the directory where the composer.json file is located:

Manually

You can download a ZIP of the latest release using the "tags" button at the top of the Github page. Place the contents of the ZIP-file somewhere and you can use it. Note that if you use this method you should require the files of the SDK yourself.

Usage

To use the StreamOne SDK, you should first set up a configuration and afterwards you can start communicating with the StreamOne API.

Configuration

To set up a configuration, you should initialize the StreamOne\API\v3\Config with the required configuration options:

For authentication_type user the following is required:

For authentication_type application the following is required:

In addition, the following optional values can be used:

Note that for request_factory, cache, request_cache, token_cache and session_store you can either pass an instance of an object implementing the required interface or an array of values where the first element should be the full class name (including namespace) and the other arguments will be passed to the constructor of that class.

If you have forgotten your user_psk or application_psk you may reset it via the StreamOne Manager

An example configuration is as follows:

Platform

The Platform class is the main entry point for performing requests. You pass it the Config during creation and it allows you to perform requests, start a new session or create an actor.

Example:

Request

A Request can be used to perform an actual request to the StreamOne API. It extends RequestBase which contains code that should be used by other request classes.

The following actions can be done using a request:

After setting up a request you should call execute() to actually connect to the API and perform the request. After doing so, the following information is available in the request:

We provide a StreamOne\API\v3\RequestException class that can be used to throw an exception when the API request fails.

An example API request:

Session

NOTE: Session requests are only required when authentication_type is set to application. It is not required when authentication_type is user

A Session can be used in the StreamOne platform by an application to perform API actions on behalf of a user.

To use a session, you need to authenticate as an application (by setting authentication_type to application). Then you can use the StreamOne\API\v3\Session class to start a session and to perform actions using that session.

The Session class provides the following useful methods:

An example of using a session:

Actor

An Actor corresponds to a user or an application. It can be used to perform multiple requests with the same settings, like accounts and / or customer.

Actors can also be used to check if the required tokens for an API action are available for the given actor. The system will request tokens from the API when required and it will cache this information so this is not done for every request. The token_cache from the Config will be used to store this information.

A full list of tokens can be found at https://manager.streamonecloud.net/docs/api_v3/tokens

An example of using an actor:

Other useful classes

There are more classes available in the StreamOne SDK:

Complete example

License and copyright

All source code is licensed under the MIT License.

Copyright (c) 2014-2017 StreamOne B.V.


All versions of php-sdk-v3 with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package streamone/php-sdk-v3 contains the following files

Loading the files please wait ....