Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 1.69 KB

UsersApi.md

File metadata and controls

66 lines (43 loc) · 1.69 KB

Supla\ApiClient\UsersApi

All URIs are relative to https://YOUR_SUPLA_SERVER/api/v3.

Method HTTP request Description
getCurrentUser() GET /users/current Get info about user for the token.

getCurrentUser()

getCurrentUser(): \Supla\ApiClient\Model\User

Get info about user for the token.

Example

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


// Configure Bearer authorization: BearerAuth
$config = Supla\ApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: OAuth2
$config = Supla\ApiClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Supla\ApiClient\Api\UsersApi(
    // 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->getCurrentUser();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->getCurrentUser: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\Supla\ApiClient\Model\User

Authorization

BearerAuth, OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]