Download the PHP package i3-hackathon/bmw-php-sdk without Composer

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

NOTICE: This fork is modified to work in conjunction with the BMW i3 Hackathon developer center ONLY. If you are not apart of the BMW i3 hackathon, please refer to mojio-php-client project instead.

Mojio.Client

As PHP is the language of choice for many of you developers out there, we have put together a simplified client built on top of Guzzle to help you get started. This client is still very much in it's alpha stages, we appologize for any bugs and incomplete features.

Installation

Using Composer (recommended)

The client has been added to packagist under the name i3-hackathon/bmw-php-sdk and can be included in your project using Composer.

  1. First you will need to add "i3-hackathon/bmw-php-sdk" as a dependency in your composer.json file (currently only the dev-master is available, more stable versioning coming soon):

  2. Next you will need to download an install Composer and dependancies:

  3. Lastly, you need to include the Composer autoloader in your bootstrap:

From Source (GitHub)

If you do not want to use Composer, you can download or checkout the complete source off github. You must also download or checkout Guzzle

Getting Started

To begin developing with our PHP client, you will need your very own application ID and secret key. First you will need to create an account and login to the BMW developer center.

Once you have logged in, you can create a new Application. From here, you will want to copy the Application ID and the Secret Key, these will be required to initialize the MOJIO client

Initializing the Client

To get started using the client, instantiate a new instance of the BMW client class. This is where you will need to pass in the Application ID and Secret Key, as well as the developer environment you are using (in this case the hackthedrive api endpoint data.api.hackthedrive.com).

Authenticate a Mojio User

Now that your MojioClient is associated with your app, you can get started making some API calls. However, many of our API calls also require an authorized user to be associated with the client session. A user can grant you access using our OAuth2 service, and client calls.

Please note, you must add the $redirectUri to the allowed Redirect URIs in your application settings on the Developer Center.

Fetching Data

To retrieve a set of a particular MOJIO entities, you can use the "GET" method. The returned results will depend on what user and application your client session is authorized as. Lists of data will be returned in a paginated form. You are able to set the page size and request a particular page. In order to keep response times fast, it is recommended to keep the page size low.

Fetch a specific Entity

By passing in the ID of an entity (often a GUID), you can request a single MOJIO entity from our API.

Update an Entity

If you want to update and save an entity, you need to first load the entity from the API, make your changes, and then post it back. Typically only the owner of an entity will be authorized to save changes and not all properties of an entity will be editable (for example, for an App, only the Name and Description properties can be changed).

Get a list of child entities

If you want to fetch all the entities associated with another entity, you can call the GetBy method. For example, if you want to fetch all the events associated with a particular MOJIO device.

Using the Mojio Storage

With the MOJIO API, you are able to store your own private data on our servers as key value pairs. These key value pairs will only be accessible by your application, and you can associate them with any MOJIO entities (ex: MOJIO Device, Application, User, Trip, Event, Invoice, Product).

Requesting Event Updates

Instead of continuously polling the API to check for updates, you can request our API send a POST request to an endpoint of your choosing everytime certain events are received.

And in your "receiver.php" file you will want to process any incoming events:


All versions of bmw-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
guzzle/guzzle Version ~3.7.0
league/oauth2-client Version 0.6.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 i3-hackathon/bmw-php-sdk contains the following files

Loading the files please wait ....