Download the PHP package 3scale/3scale_ws_api_for_php without Composer

On this page you can find all versions of the php package 3scale/3scale_ws_api_for_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 3scale_ws_api_for_php

Client for 3scale Web Service Management API Build Status

3scale integration plugin for PHP applications. 3scale is an API Infrastructure service which handles API Keys, Rate Limiting, Analytics, Billing Payments and Developer Management. Includes a configurable API dashboard and developer portal CMS. More product stuff at http://www.3scale.net/, support information at http://support.3scale.net/.

Tutorials

Installation

Download the source code from github: http://github.com/3scale/3scale_ws_api_for_php and place it somewhere accessible from your project.

Usage

Require the ThreeScaleClient.php file (assuming you placed the library somewhere within the include path):

Then create an instance of the client

NOTE: unless you specify you will be expected to specify a provider_key parameter, which is deprecated in favor of Service Tokens:

Because the object is stateless, you can create just one and store it globally.

Then you can perform calls in the client:

NOTE:service_id is mandatory since November 2016, both when using service tokens and when using provider keys

Authorize

To authorize a particular application, call the authorize method passing it the application id and service id and optionally the application key:

If you had configured a (deprecated) provider key, you would instead use:

Then call the isSuccess() method on the returned object to see if the authorization was successful:

If both provider and app id are valid, the response object contains additional information about the status of the application:

If the plan has defined usage limits, the response contains details about the usage broken down by the metrics and usage limit periods.

If the authorization failed, the getErrorCode() returns system error code and getErrorMessage() human readable error description:

Authrep

To authorize a particular application, call the authrep method passing it the application id and service id and optionally the application key:

Then call the isSuccess() method on the returned object to see if the authorization was successful:

If both provider and app id are valid, the response object contains additional information about the status of the application:

You can also use other patterns such as user_key mode during the authrep call

Report

To report usage, use the report method. You can report multiple transaction at the same time:

The "app_id", "usage" parameters are required alongiwth service id and service token. Additionaly, you can specify a timestamp of the transaction:

The timestamp can be either an unix timestamp (as integer) or a string. The string has to be in a format parseable by the strtotime function. For example:

If the timestamp is not in UTC, you have to specify a time offset. That's the "+0200" (two hours ahead of the Universal Coordinate Time) in the example above.

Then call the isSuccess() method on the returned response object to see if the report was successful:

In case of error, the getErrorCode() returns system error code and getErrorMessage() human readable error description:

Custom backend for the 3scale Service Management API

The default URI used for the 3scale Service Management API is http://su1.3scale.net:80. This value can be changed, which is useful when the plugin is used together with the on-premise version of the Red Hat 3scale API Management Platform.

In order to override the URL, pass the custom URI while creating instance an instance of the client

Plugin integration

If you are interested in integrating the plugin with:

To Test

To run tests: php test/all.php

Legal

Copyright (c) 2010 3scale networks S.L., released under the MIT license.


All versions of 3scale_ws_api_for_php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 3scale/3scale_ws_api_for_php contains the following files

Loading the files please wait ....