emnify/emnify-sdk

Supply your swarm of IoT devices with cloud connectivity by emnify. Automate your routines with this SDK for PHP.

0.0.2 2024-07-09 19:11 UTC

README

Rest API resources of the emnify System.

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "require": {
    "emnify/emnify-sdk": "*@dev"
  }
}

Then run composer install

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');


$apiInstance = new Swagger\Client\Api\ApplicationTokensApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \Swagger\Client\Model\ApplicationToken(); // \Swagger\Client\Model\ApplicationToken | 
$app_token_id = 1.2; // float | application token ID

try {
    $apiInstance->applicationTokenByIdPatch($body, $app_token_id);
} catch (Exception $e) {
    echo 'Exception when calling ApplicationTokensApi->applicationTokenByIdPatch: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\ApplicationTokensApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->applicationTokenGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ApplicationTokensApi->applicationTokenGet: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\ApplicationTokensApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \Swagger\Client\Model\CreateApplicationTokenrequest(); // \Swagger\Client\Model\CreateApplicationTokenrequest | 

try {
    $result = $apiInstance->applicationTokenPost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ApplicationTokensApi->applicationTokenPost: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://cdn.emnify.net

Documentation For Models

Documentation For Authorization

bearerAuth

  • Type: HTTP bearer authentication

Author