2017 © Pedro Peláez
 

library api-client-php

Niland API Client for PHP

image

niland/api-client-php

Niland API Client for PHP

  • Thursday, March 9, 2017
  • by BruceWouaigne
  • Repository
  • 4 Watchers
  • 2 Stars
  • 2,285 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 4 % Grown

The README.md

Niland API PHP Wrapper

Setup

To setup your project, follow these steps:, (*1)

  1. Install the package via Composer:
composer require niland/api-client-php
  1. Next you'll have to initialize the client with your API-Key. You can find it on your Niland API account.
// composer autoload
require __DIR__ . '/vendor/autoload.php';
$client = new \NilandApi\Client(YOUR_API_KEY);

Quick Start

List tracks using pagination, (*2)

$response = $client->get('tracks', array('page_size' => 10, 'page' => 2));

Retrieve a track by its reference, (*3)

$response = $client->get('tracks/reference/YOUR_REFERENCE');

Find tracks by similarity and/or tags, (*4)

$response = $client->get('tracks/search', array(
    'similar_ids' => array(1234),
    'tag_ids'     => array(21, 41)
));

Post a track, (*5)

$response = $client->post('tracks', array(
    'title'     => 'foobar',
    'artist'    => 'foobar',
    'reference' => 'foobar',
    'tags'      => array(21, 41),
    'audio'     => fopen('/path/to/your/audio/file.mp3', 'r')
));

Known Issues

You will get a 400 Bad Request if you use a URL in fopen with PHP 7. It generate an invalid chunk body error., (*6)

The following exemple will generate a 400:, (*7)

$response = $client->post('tracks', array(
    'title'     => 'foobar',
    'artist'    => 'foobar',
    'reference' => 'foobar',
    'tags'      => array(21, 41),
    'audio'     => fopen('http://myawesomewebsite.com/file.mp3', 'r')
));

The Versions

09/03 2017

dev-master

9999999-dev https://github.com/niland/api-client-php

Niland API Client for PHP

  Sources   Download

MIT

The Requires

 

by Niland Team

11/10 2016

1.2.1

1.2.1.0 https://github.com/niland/api-client-php

Niland API Client for PHP

  Sources   Download

MIT

The Requires

 

by Niland Team

30/09 2016

1.2

1.2.0.0 https://github.com/niland/api-client-php

Niland API Client for PHP

  Sources   Download

MIT

The Requires

 

by Niland Team

07/09 2016

1.1

1.1.0.0 https://github.com/niland/api-client-php

Niland API Client for PHP

  Sources   Download

MIT

The Requires

 

by Niland Team

21/03 2016

1.0

1.0.0.0 https://github.com/niland/api-client-php

Niland API Client for PHP

  Sources   Download

MIT

The Requires

 

by Niland Team