upscale/cisco-meraki-client

Client for Cisco Meraki REST API

1.0.0 2018-05-25 08:15 UTC

This package is auto-updated.

Last update: 2024-11-18 06:56:32 UTC


README

This library is a simplistic PHP client for Cisco Meraki Dashboard API.

Features:

  • Authorization via API Key
  • Base URL of API endpoints
  • Parsing JSON responses
  • Following HTTP redirects
  • Rate limiting (default: 5 req/sec)

Installation

The library is to be installed via Composer as a project dependency in composer.json:

{
    "require": {
        "upscale/cisco-meraki-client": "*"
    }
}

Basic Usage

The library implements a handful of shortcut API methods:

$meraki = new \Upscale\Cisco\Meraki\ApiClient(
    new \GuzzleHttp\Client(),
    '0011223344556677889900aaabbbcccdddeeefff'
);

$organizationId = 123456;
$networks = $meraki->fetchNetworks($organizationId);

$networkId = $networks[0]['id'];
$devices = $meraki->fetchDevices($networkId);

$deviceId = $devices[0]['serial'];
$clients = $meraki->fetchClients($deviceId);

Advanced Usage

Arbitrary REST API endpoints can be called via the generic interface:

$organizations = $meraki->callApi('organizations', 'GET');

The arguments are passed through to Guzzle HTTP Client providing full control over API requests.

Contributing

Pull Requests are welcome to introduce the missing shortcut methods!

License

Licensed under the Apache License, Version 2.0.