GithubHelp home page GithubHelp logo

ents24-api-client's Introduction

Ents24 API Client

Code Climate

This is a PHP client for Ents24's API. It's built on the Guzzle client framework, which means it plays nice with Service Docs.

Requirements

Installation

Add the following to the require section of your project's composer.json.

"Ents24/ents24-api-client": "dev-master"

Add the folowing to the repositories section of your project's composer.json.

{
  "type": "vcs",
  "url":  "https://www.github.com/Ents24/ents24-api-client.git"
}

Run composer install.

Usage

You need client ID and secret keys for the Ents24 API in order to make requests. You can get these here.

Once you have credentials build a client instance using the factory and pass the credentials to it.

The Client extends the Guzzle client object. It has all of the normal Guzzle client capabilities. It is provided with a service description of the Ents24 API which we will be endeavouring to keep up to date. If you are familiar with Guzzle then go nuts.

If you are not familiar with Guzzle, don't worry. For ease of use we have provided functions on the client object each corresponding to one of our API endpoints. They all accept a key-value array which should contain the parameters you want to pass to the endpoint. To pass no parameters to an endpoint with no required parameters pass an empty array or no array at all.

For documentation of our endpoints and the parameters they accept check out our API documentation.

This short example code with a valid client ID and secret loads a list of artists and prints the first result to stdout.

<?php
require 'vendor/autoload.php';

$client = Ents24\Api\Client::factory(
    [
        'client_id'     => 'my_client_id',
        'client_secret' => 'my_client_secret',
    ]
);

$artistList = $client->artistList(["name" => "Texas"]);
$firstArtist = current($artistList);

echo $firstArtist['name'], "\n";
echo $firstArtist['description'], "\n";

This code produces the following output.

Texas
This Glasgow based band have been playing their mix of rock, soul and new country...

License

This project is released under the MIT License.

ents24-api-client's People

Contributors

cole007 avatar hellawiggly avatar henrycatalinismith avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.