Download the PHP package nocksapp/nocks-sdk-php without Composer

On this page you can find all versions of the php package nocksapp/nocks-sdk-php. 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 nocks-sdk-php

Latest Stable Version Total Downloads Latest Unstable Version

Nocks SDK PHP

Nocks SDK PHP is a php package for Nocks. It can be used in any php >=5.4.0 environment. The SDK supports both the calls to the Nocks api endpoints as well to the oauth endpoints.



Installation

This SDK uses composer.

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

For more information on how to use/install composer, please visit: https://github.com/composer/composer

To install this SDK into your project with composer, simply use:

$ composer require nocksapp/nocks-sdk-php

Getting Started

Oauth

The NocksOauth class provides the following methods:

Example

Please checkout the oauth docs and examples to see how the oauth methods can be used.

API

The NocksApi class provides all the Nocks resources. Please checkout the resources docs and examples.

Results

The result returned from a method call in the SDK will differ, please check the PHPDocs to see what will be returned from a method. Most of the time it will be a Model or a NocksResponse.

Model

A Model is just a simple object which holds the data returned from the api. Each Model will provide the necessary getters and setters for the specific data.

NocksResponse

A NocksResponse is an object which holds a data array and a pagination object. This is typically returned from a .find method.

Example:

Exceptions

The SDK uses the following exceptions. All exceptions are inherit from Nocks\SDK\Exception\Exception.

HttpException

A HttpException is thrown when a http call to Nocks fails. The HttpException is the super exception and the actual exception that is thrown is corresponding to the http statuscode, see the documentation.

ValidationException

A ValidationException may occur when you call a function with invalid parameters or when there are missing required parameters. For example:

Note that the SDK doesn't check your request data, if there is something wrong with your data, the http call will resolve in a HttpException

ScopeConfigurationException

A ScopeConfigurationException may occur when calling a function which depends on a certain scope parameter that was not provided. For example, calling a private resource while there was no accessToken configured:

Examples

In the examples directory you will find examples for each call that is supported in this SDK.

Support

Need help or support? Please check https://www.nocks.com/support.

Found a bug? Please check the existing GitHub issues and open a new issue if necessary. Or even better, create a pull request to directly resolve the issue you have found!


All versions of nocks-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-curl Version *
ext-json Version *
ext-mbstring Version *
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 nocksapp/nocks-sdk-php contains the following files

Loading the files please wait ....