Download the PHP package antevenio/oauth2-mdirector without Composer

On this page you can find all versions of the php package antevenio/oauth2-mdirector. 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 oauth2-mdirector

oauth2-mdirector

Latest Stable Version Total Downloads License Travis build Coverage Status Maintainability

OAuth client library specific to access MDirector API services, written in PHP.

This package provides MDirector (http://www.mdirector.com) OAuth 2.0 support for the PHP League's OAuth 2.0 Client.

As of now, only an OAuth2 implementation for the MDirector email marketing and transactional applications are provided. The package is composed of two oauth2-client providers (for the email marketing and transactional services) and wrappers around them to hide the burden of the required OAuth2 negotiations.

As a consumer you may choose to use just a provider or a client wrapper, as it suits you best.

There is also a command line script to help you test it from the shell.

Requirements

The following versions of PHP are supported.

Installation

Usage

As mentioned before, you can choose to use just a provider or the wrapper around it. Here you can find examples for each case:

1. MDirector Oauth2-client provider (email marketing application)

You can find the oauth2-client provider under OAuth2/Client/Provider, for generic usage instructions please refer to generic usage in the oauth2-client github project.

The MDirector email marketing provider as of now is just providing the Resource Owner Password Credentials Grant having a generic clientId named webapp. Here is an example to get a valid accessToken:

When building your requests to the mdirector api, take into account that our api expects the parameters to be on the query string for GET requests, or being application/x-www-form-urlencoded on the body of the request for any other method

i.e. POST, PUT, DELETE... etc.

2. Transactional Oauth2-client provider (transactional application)

You can find the oauth2-client provider under OAuth2/Client/Provider, for generic usage instructions please refer to generic usage in the oauth2-client github project.

The Transactional provider as of now is just providing the Resource Owner Password Credentials Grant having a generic clientId named webapp. Here is an example to get a valid accessToken:

When building your requests to the transactional api, take into account that our api expects the parameters to be on the query string for GET requests, or being application/json encoded on the body of the request for any other method

i.e. POST, PUT, DELETE... etc.

The headers:

and

Are required on every request.

3. Wrapper clients

The wrapper clients offer a simplified way to call the API. They take care of obtaining tokens and refreshing them where needed. You just have to set parameters as an associative array, the wrapper knows how to pass them depending on the specified method. You can also specify a custom user-agent to be send on request headers ("oauth2-mdirector client" by default)

Example of use:

3. Shell script

The library also provides a console client so you can call the mdirector api from a shell. To do so run:

The command will display some self explanatory help about its usage and parameters.

4. Others

If you plan on using another client implementation, or have to call the API using a language other than PHP, here you'll find the little bits of information you'll need to know:

You'll be asking for access tokens using "webapp" as your fixed clientId, specifying password as the grant type, being your company id your username and your secret your password.

The endpoint for getting such tokens (or refresh them) would be:

https://app.mdirector.com/oauth2

And you'll be carrying your token on a Bearer header in your requests. (https://oauth.net/2/bearer-tokens/)


All versions of oauth2-mdirector with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
league/oauth2-client Version ^2.3
symfony/console 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 antevenio/oauth2-mdirector contains the following files

Loading the files please wait ....