All URIs are relative to https://YOUR_SUPLA_SERVER/api/v3
.
Method | HTTP request | Description |
---|---|---|
createLocation() | POST /locations | Create a new location |
deleteLocation() | DELETE /locations/{id} | Delete the location |
getLocation() | GET /locations/{id} | Get location by ID |
getLocations() | GET /locations | Get locations |
updateLocation() | PUT /locations/{id} | Update the location |
createLocation(): \Supla\ApiClient\Model\Location
Create a new location
<?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\LocationsApi(
// 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->createLocation();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LocationsApi->createLocation: ', $e->getMessage(), PHP_EOL;
}
This endpoint does not need any parameter.
\Supla\ApiClient\Model\Location
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteLocation($id)
Delete the location
<?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\LocationsApi(
// 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
);
$id = 56; // int | ID
try {
$apiInstance->deleteLocation($id);
} catch (Exception $e) {
echo 'Exception when calling LocationsApi->deleteLocation: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getLocation($id, $include): \Supla\ApiClient\Model\Location
Get location by ID
<?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\LocationsApi(
// 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
);
$id = 56; // int | ID
$include = array('include_example'); // string[] | List of extra fields to include in the response.
try {
$result = $apiInstance->getLocation($id, $include);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LocationsApi->getLocation: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID | |
include | string[] | List of extra fields to include in the response. | [optional] |
\Supla\ApiClient\Model\Location
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getLocations($include): \Supla\ApiClient\Model\Location[]
Get locations
<?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\LocationsApi(
// 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
);
$include = array('include_example'); // string[] | List of extra fields to include in the response.
try {
$result = $apiInstance->getLocations($include);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LocationsApi->getLocations: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
include | string[] | List of extra fields to include in the response. | [optional] |
\Supla\ApiClient\Model\Location[]
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateLocation($id, $inlineObject8): \Supla\ApiClient\Model\Location
Update the location
<?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\LocationsApi(
// 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
);
$id = 56; // int | ID
$inlineObject8 = new \Supla\ApiClient\Model\InlineObject8(); // \Supla\ApiClient\Model\InlineObject8
try {
$result = $apiInstance->updateLocation($id, $inlineObject8);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LocationsApi->updateLocation: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID | |
inlineObject8 | \Supla\ApiClient\Model\InlineObject8 |
\Supla\ApiClient\Model\Location
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]